i965: fix projtex_mask

projtex_mask is only an 8bit field, and wm.input_size_masks includes
other attributes' information, therefore right shift is needed.
This commit is contained in:
Xiang, Haihao
2007-08-13 17:16:27 +08:00
parent c9e4aa2b30
commit 88451b04e9
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -285,7 +285,7 @@ static void brw_wm_populate_key( struct brw_context *brw,
/* BRW_NEW_WM_INPUT_DIMENSIONS */
key->projtex_mask = brw->wm.input_size_masks[4-1];
key->projtex_mask = brw->wm.input_size_masks[4-1] >> (FRAG_ATTRIB_TEX0 - FRAG_ATTRIB_WPOS);
/* _NEW_LIGHT */
key->flat_shade = (brw->attribs.Light->ShadeModel == GL_FLAT);
+1 -1
View File
@@ -660,7 +660,7 @@ static GLboolean projtex( struct brw_wm_compile *c,
return 0; /* ut2004 gun rendering !?! */
else if (src.File == PROGRAM_INPUT &&
GET_SWZ(src.Swizzle, W) == W &&
(c->key.projtex_mask & (1<<src.Index)) == 0)
(c->key.projtex_mask & (1<<(src.Index + FRAG_ATTRIB_WPOS - FRAG_ATTRIB_TEX0))) == 0)
return 0;
else
return 1;