diff options
author | Eric Anholt <[email protected]> | 2005-10-24 22:01:40 +0000 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2005-10-24 22:01:40 +0000 |
commit | f33beed330c22b56bb97af73f56d83c34e985cb6 (patch) | |
tree | 3b129f0363f8a81e86fbb6aa01ba36882f6a83c9 /src | |
parent | 81d3bf58ff2b143b7df16e5d7af8672b33626e40 (diff) |
Fix and enable GL_MESA_ycbcr_texture. Looks fine with yuvrect. I'm slightly
concerned that TEXEL_YUV422 looks like TEXEL_YVU422 and TEXEL_VUY422 looks like
TEXEL_VYU422 in yuvrect, but I'm happy enough for now.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_tex.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_texstate.c | 30 |
3 files changed, 33 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index 642560a0d9e..416ffdac697 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -81,7 +81,7 @@ struct dri_extension card_extensions[] = { "GL_EXT_texture_lod_bias", NULL }, { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, { "GL_EXT_stencil_wrap", NULL }, - /*{ "GL_MESA_ycbcr_texture", NULL },*/ /* not working yet */ + { "GL_MESA_ycbcr_texture", NULL }, { "GL_NV_blend_square", NULL }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c index a97bed833a2..be87f16e298 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.c +++ b/src/mesa/drivers/dri/sis/sis_tex.c @@ -96,10 +96,10 @@ sisAllocTexImage( sisContextPtr smesa, sisTexObjPtr t, int level, t->hwformat = TEXEL_AL88; break; case MESA_FORMAT_YCBCR: - t->hwformat = TEXEL_YVU422; /* Doesn't work? Extension disabled */ + t->hwformat = TEXEL_YUV422; break; case MESA_FORMAT_YCBCR_REV: - t->hwformat = TEXEL_YUV422; /* Doesn't work? Extension disabled */ + t->hwformat = TEXEL_VUY422; break; default: sis_fatal_error("Bad texture format 0x%x.\n", diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c index 2a9bd56bb25..b9942174fe5 100644 --- a/src/mesa/drivers/dri/sis/sis_texstate.c +++ b/src/mesa/drivers/dri/sis/sis_texstate.c @@ -73,6 +73,7 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, break; case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: current->hwTexBlendColor0 = STAGE0_C_CS; current->hwTexBlendAlpha0 = STAGE0_A_AF; break; @@ -82,6 +83,8 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, current->hwTexBlendColor0 = STAGE0_C_CS; current->hwTexBlendAlpha0 = STAGE0_A_AS; break; + default: + sis_fatal_error("unknown base format 0x%x\n", t->format); } break; @@ -94,6 +97,7 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, break; case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: current->hwTexBlendColor0 = STAGE0_C_CFCS; current->hwTexBlendAlpha0 = STAGE0_A_AF; break; @@ -103,6 +107,8 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, current->hwTexBlendColor0 = STAGE0_C_CFCS; current->hwTexBlendAlpha0 = STAGE0_A_AFAS; break; + default: + sis_fatal_error("unknown base format 0x%x\n", t->format); } break; @@ -110,6 +116,7 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_RGB: + case GL_YCBCR_MESA: current->hwTexBlendColor0 = STAGE0_C_CS; current->hwTexBlendAlpha0 = STAGE0_A_AF; break; @@ -117,6 +124,8 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, current->hwTexBlendColor0 = STAGE0_C_CFOMAS_CSAS; current->hwTexBlendAlpha0 = STAGE0_A_AF; break; + default: + sis_fatal_error("unknown base format 0x%x\n", t->format); } break; @@ -134,6 +143,7 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, break; case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS; current->hwTexBlendAlpha0 = STAGE0_A_AF; break; @@ -146,8 +156,13 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS; current->hwTexBlendAlpha0 = STAGE0_A_AFAS; break; + default: + sis_fatal_error("unknown base format 0x%x\n", t->format); } break; + + default: + sis_fatal_error("unknown env mode 0x%x\n", texture_unit->EnvMode); } if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) || @@ -187,6 +202,7 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, break; case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: current->hwTexBlendColor1 = STAGE1_C_CS; current->hwTexBlendAlpha1 = STAGE1_A_AF; break; @@ -196,6 +212,8 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, current->hwTexBlendColor1 = STAGE1_C_CS; current->hwTexBlendAlpha1 = STAGE1_A_AS; break; + default: + sis_fatal_error("unknown base format 0x%x\n", t->format); } break; @@ -208,6 +226,7 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, break; case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: current->hwTexBlendColor1 = STAGE1_C_CFCS; current->hwTexBlendAlpha1 = STAGE1_A_AF; break; @@ -217,6 +236,8 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, current->hwTexBlendColor1 = STAGE1_C_CFCS; current->hwTexBlendAlpha1 = STAGE1_A_AFAS; break; + default: + sis_fatal_error("unknown base format 0x%x\n", t->format); } break; @@ -224,6 +245,7 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_RGB: + case GL_YCBCR_MESA: current->hwTexBlendColor1 = STAGE1_C_CS; current->hwTexBlendAlpha1 = STAGE1_A_AF; break; @@ -231,6 +253,8 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, current->hwTexBlendColor1 = STAGE1_C_CFOMAS_CSAS; current->hwTexBlendAlpha1 = STAGE1_A_AF; break; + default: + sis_fatal_error("unknown base format 0x%x\n", t->format); } break; @@ -248,6 +272,7 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, break; case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS; current->hwTexBlendAlpha1 = STAGE1_A_AF; break; @@ -260,8 +285,13 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS; current->hwTexBlendAlpha1 = STAGE1_A_AFAS; break; + default: + sis_fatal_error("unknown base format 0x%x\n", t->format); } break; + + default: + sis_fatal_error("unknown env mode 0x%x\n", texture_unit->EnvMode); } if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) || |