i915: apply commit a0a5e8cfc04c14873441b50f7d594ef11806b9a8 from 965.
authorXiang, Haihao <haihao.xiang@intel.com>
Tue, 25 Dec 2007 09:22:19 +0000 (17:22 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Tue, 25 Dec 2007 09:22:19 +0000 (17:22 +0800)
fix #11925

src/mesa/drivers/dri/i915/i915_texstate.c
src/mesa/drivers/dri/i915/intel_context.h
src/mesa/drivers/dri/i915/intel_state.c

index 09684e87b4eedf87ca1d89574c182fa31083c86b..1c45fd5dcd5dbbb2f2afb7d766a2462db138f5cb 100644 (file)
@@ -246,7 +246,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
 
          state[I915_TEXREG_SS2] |=
             (SS2_SHADOW_ENABLE |
-             intel_translate_compare_func(tObj->CompareFunc));
+             intel_translate_shadow_compare_func(tObj->CompareFunc));
 
          minFilt = FILTER_4X4_FLAT;
          magFilt = FILTER_4X4_FLAT;
index 25486ed001bb4ccfa503047048cfa8791d3d1d91..528e749c33ff6e689a020eed33163788f0a41a02 100644 (file)
@@ -433,6 +433,7 @@ extern void intelInitStateFuncs(struct dd_function_table *functions);
 #define BLENDFACT_INV_CONST_ALPHA      0x0f
 #define BLENDFACT_MASK                 0x0f
 
+extern int intel_translate_shadow_compare_func(GLenum func);
 extern int intel_translate_compare_func(GLenum func);
 extern int intel_translate_stencil_op(GLenum op);
 extern int intel_translate_blend_factor(GLenum factor);
index 271511037e975e75a053aaade24aef2050ddeb57..558f068a42ccbab20888665a04e64e2ebe75bbfb 100644 (file)
 #include "intel_regions.h"
 #include "swrast/swrast.h"
 
+int 
+intel_translate_shadow_compare_func( GLenum func )
+{
+   switch(func) {
+   case GL_NEVER: 
+       return COMPAREFUNC_ALWAYS; 
+   case GL_LESS: 
+       return COMPAREFUNC_LEQUAL; 
+   case GL_LEQUAL: 
+       return COMPAREFUNC_LESS;
+   case GL_GREATER: 
+       return COMPAREFUNC_GEQUAL; 
+   case GL_GEQUAL: 
+      return COMPAREFUNC_GREATER; 
+   case GL_NOTEQUAL: 
+      return COMPAREFUNC_EQUAL; 
+   case GL_EQUAL: 
+      return COMPAREFUNC_NOTEQUAL; 
+   case GL_ALWAYS: 
+       return COMPAREFUNC_NEVER; 
+   }
+
+   fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+   return COMPAREFUNC_NEVER; 
+}
+
 int
 intel_translate_compare_func(GLenum func)
 {