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

Eric Anholt eric at anholt.net
Tue Dec 9 07:47:26 CET 2008


On Tue, 2008-12-09 at 14:01 +0800, Xiang, Haihao wrote:
> 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 */

Ack for this one -- appears to be correct according to spec, and we
should expect everything to use CLAMP_TO_EDGE.

-- 
Eric Anholt
eric at anholt.net                         eric.anholt at intel.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20081208/7dd9081e/attachment.sig>


More information about the Intel-gfx mailing list