diff options
author | Brian Paul <[email protected]> | 2011-11-03 10:39:26 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-11-03 15:32:19 -0600 |
commit | bf5255fb30d9d9832f93616016c94782469d43ad (patch) | |
tree | 175e6a37d6f0b28e9be3e99944a90ff46a220440 /src/mesa/program | |
parent | f37b1ad937dd2c420f4c9fd9aa5887942bd31f3f (diff) |
mesa: fix texture target mix-up in NV_fragment_program parser
The returned value should be a texture target index, not a bit.
I spotted this from seeing a new compiler warning caused by the increase
in the number of texture targets. This has been broken for a long time.
Note: This is a candidate for the 7.11 branch.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/program')
-rw-r--r-- | src/mesa/program/nvfragparse.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/program/nvfragparse.c b/src/mesa/program/nvfragparse.c index ce72c610d89..bcc553a9bc6 100644 --- a/src/mesa/program/nvfragparse.c +++ b/src/mesa/program/nvfragparse.c @@ -568,7 +568,7 @@ Parse_VectorOrScalarConstant(struct parse_state *parseState, GLfloat *vec) */ static GLboolean Parse_TextureImageId(struct parse_state *parseState, - GLubyte *texUnit, GLubyte *texTargetBit) + GLubyte *texUnit, GLubyte *texTarget) { GLubyte imageSrc[100]; GLint unit; @@ -592,26 +592,26 @@ Parse_TextureImageId(struct parse_state *parseState, RETURN_ERROR1("Expected ,"); if (Parse_String(parseState, "1D")) { - *texTargetBit = TEXTURE_1D_BIT; + *texTarget = TEXTURE_1D_INDEX; } else if (Parse_String(parseState, "2D")) { - *texTargetBit = TEXTURE_2D_BIT; + *texTarget = TEXTURE_2D_INDEX; } else if (Parse_String(parseState, "3D")) { - *texTargetBit = TEXTURE_3D_BIT; + *texTarget = TEXTURE_3D_INDEX; } else if (Parse_String(parseState, "CUBE")) { - *texTargetBit = TEXTURE_CUBE_BIT; + *texTarget = TEXTURE_CUBE_INDEX; } else if (Parse_String(parseState, "RECT")) { - *texTargetBit = TEXTURE_RECT_BIT; + *texTarget = TEXTURE_RECT_INDEX; } else { RETURN_ERROR1("Invalid texture target token"); } /* update record of referenced texture units */ - parseState->texturesUsed[*texUnit] |= *texTargetBit; + parseState->texturesUsed[*texUnit] |= (1 << *texTarget); if (_mesa_bitcount(parseState->texturesUsed[*texUnit]) > 1) { RETURN_ERROR1("Only one texture target can be used per texture unit."); } |