[Intel-gfx] [intel-gfx][patch]fallback for 915/945 cubemap

Xiang, Haihao haihao.xiang at intel.com
Tue Dec 9 07:01:01 CET 2008


Hi, 
  According to spec, 915/945 only supports TEXCOORDMODE_CLAMP(defined as
TEXCOORDMODE_CUBE_EDGE in i915 driver) and TEXCOORDMODE_CUBE(not used in
i915 driver) when using cube map texture coordinates. Currently i915
driver doesn't handle it correctly so that GPU always get hung when
running a game (such as scorched3d) which is using cube map texture. 

  Here is a fallback for cubemap. With it, scorched3d no longer result
in ring lockup. (However it runs slowly). Another way is always
translating GL_xxx into TEXCOORDMODE_CLAMP, but it isn't compliant with
GL spec. Which is the best choice?


diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index d1b0dcd..5b53b22 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -295,6 +295,10 @@ i915_update_tex_unit(struct intel_context *intel,
GLuint unit, GLuint ss3)
            wt == GL_CLAMP_TO_BORDER || wr == GL_CLAMP_TO_BORDER))
          return GL_FALSE;

+      if (tObj->Target == GL_TEXTURE_CUBE_MAP_ARB &&
+          (((ws != GL_CLAMP) && (ws != GL_CLAMP_TO_EDGE)) ||
+           ((wr != GL_CLAMP) && (wr != GL_CLAMP_TO_EDGE))))
+          return GL_FALSE;

       state[I915_TEXREG_SS3] = ss3;     /* SS3_NORMALIZED_COORDS */





More information about the Intel-gfx mailing list