summaryrefslogtreecommitdiff
path: root/src/mesa/main/texformat.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-09-21 16:51:25 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-09-21 16:51:25 +0000
commitc5b995066020191982b2315fc45d05e068eee761 (patch)
tree9ca2e3a49b84631aa61ef97d072439228478b3cb /src/mesa/main/texformat.c
parentc62aeed003cc20b189d71bc53256419e0d630aaf (diff)
updates from 4.0.4 (MESA_ycbcr_texture, APPLE_client_storage, etc)
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r--src/mesa/main/texformat.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 4795aeffb2..2c95b83859 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -1,4 +1,4 @@
-/* $Id: texformat.c,v 1.14 2002/07/09 01:22:50 brianp Exp $ */
+/* $Id: texformat.c,v 1.15 2002/09/21 16:51:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -437,6 +437,44 @@ const struct gl_texture_format _mesa_texformat_ci8 = {
};
+const struct gl_texture_format _mesa_texformat_ycbcr = {
+ MESA_FORMAT_YCBCR, /* MesaFormat */
+ GL_YCBCR_MESA, /* BaseFormat */
+ GL_UNSIGNED_SHORT_8_8_MESA, /* Type */
+ 0, /* RedBits */
+ 0, /* GreenBits */
+ 0, /* BlueBits */
+ 0, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 2, /* TexelBytes */
+ fetch_1d_texel_ycbcr, /* FetchTexel1D */
+ fetch_2d_texel_ycbcr, /* FetchTexel2D */
+ fetch_3d_texel_ycbcr, /* FetchTexel3D */
+};
+
+
+const struct gl_texture_format _mesa_texformat_ycbcr_rev = {
+ MESA_FORMAT_YCBCR_REV, /* MesaFormat */
+ GL_YCBCR_MESA, /* BaseFormat */
+ GL_UNSIGNED_SHORT_8_8_REV_MESA, /* Type */
+ 0, /* RedBits */
+ 0, /* GreenBits */
+ 0, /* BlueBits */
+ 0, /* AlphaBits */
+ 0, /* LuminanceBits */
+ 0, /* IntensityBits */
+ 0, /* IndexBits */
+ 0, /* DepthBits */
+ 2, /* TexelBytes */
+ fetch_1d_texel_ycbcr_rev, /* FetchTexel1D */
+ fetch_2d_texel_ycbcr_rev, /* FetchTexel2D */
+ fetch_3d_texel_ycbcr_rev, /* FetchTexel3D */
+};
+
+
/* Big-endian */
#if 0
const struct gl_texture_format _mesa_texformat_abgr8888 = {
@@ -736,6 +774,12 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
_mesa_problem(ctx, "texture compression extension not enabled");
return &_mesa_texformat_rgba;
+ case GL_YCBCR_MESA:
+ if (type == GL_UNSIGNED_SHORT_8_8_MESA)
+ return &_mesa_texformat_ycbcr;
+ else
+ return &_mesa_texformat_ycbcr_rev;
+
default:
_mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()");
_mesa_debug(ctx, "intformat = %d %x\n", internalFormat, internalFormat);