Fix and enable GL_MESA_ycbcr_texture. Looks fine with yuvrect. I'm slightly
authorEric Anholt <anholt@FreeBSD.org>
Mon, 24 Oct 2005 22:01:40 +0000 (22:01 +0000)
committerEric Anholt <anholt@FreeBSD.org>
Mon, 24 Oct 2005 22:01:40 +0000 (22:01 +0000)
concerned that TEXEL_YUV422 looks like TEXEL_YVU422 and TEXEL_VUY422 looks like
TEXEL_VYU422 in yuvrect, but I'm happy enough for now.

src/mesa/drivers/dri/sis/sis_context.c
src/mesa/drivers/dri/sis/sis_tex.c
src/mesa/drivers/dri/sis/sis_texstate.c

index 642560a0d9ecf0024a5c3048046b77b6510bc7bf..416ffdac6976beb854710f937ff6ca1bf1aeede0 100644 (file)
@@ -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 }
 };
index a97bed833a224c561e798ce8245c90bd54b5e6c4..be87f16e2983cd21201ad2174148b7ccdabe6414 100644 (file)
@@ -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",
index 2a9bd56bb25f8b985af0437dfcb04e44208ee10d..b9942174fe50f0c7939967be0abdf6381b7719af 100644 (file)
@@ -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) ||