i965: Enable GL_ARB_fragment_program_shadow and fix key->shadowtex_mask. (bug #16852...
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 20 Aug 2008 07:54:41 +0000 (15:54 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 20 Aug 2008 07:54:41 +0000 (15:54 +0800)
src/mesa/drivers/dri/i965/brw_wm.c
src/mesa/drivers/dri/intel/intel_context.c

index 93ae8dc..361312c 100644 (file)
@@ -279,12 +279,6 @@ static void brw_wm_populate_key( struct brw_context *brw,
       const struct gl_texture_object *t = unit->_Current;
 
       if (unit->_ReallyEnabled) {
-
-        if (t->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB &&
-            t->Image[0][t->BaseLevel]->_BaseFormat == GL_DEPTH_COMPONENT) {
-           key->shadowtex_mask |= 1<<i;
-        }
-
         if (t->Image[0][t->BaseLevel]->InternalFormat == GL_YCBCR_MESA) {
            key->yuvtex_mask |= 1<<i;
            if (t->Image[0][t->BaseLevel]->TexFormat->MesaFormat == 
@@ -294,6 +288,9 @@ static void brw_wm_populate_key( struct brw_context *brw,
       }
    }
 
+   /* Shadow */
+   key->shadowtex_mask = fp->program.Base.ShadowSamplers;
+
    /* _NEW_BUFFERS */
    /*
     * Include the draw buffer origin and height so that we can calculate
index 8a4d5d2..50c1964 100644 (file)
@@ -266,6 +266,7 @@ static const struct dri_extension brw_extensions[] = {
    { "GL_ARB_fragment_program",           NULL },
    { "GL_ARB_shadow",                     NULL },
    { "GL_EXT_shadow_funcs",               NULL },
+   { "GL_ARB_fragment_program_shadow",    NULL },
    /* ARB extn won't work if not enabled */
    { "GL_SGIX_depth_texture",             NULL },
    { "GL_EXT_texture_sRGB",              NULL},