summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstate.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-02-21 15:15:20 -0700
committerBrian Paul <[email protected]>2009-02-21 15:15:20 -0700
commitd059d030342fc232a5b54298c0591f5f814f4adb (patch)
tree63b709b44ac9a6b07f184ed8ac209654a192c665 /src/mesa/main/texstate.c
parent9818734e0148510967ca9ee0d1aa8b196b509f02 (diff)
mesa: use enums for TEXTURE_x_INDEX values
Plus, put them in the order of highest to lowest priority to simplify the texture_override() loop.
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r--src/mesa/main/texstate.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 27927d60b03..3f16d49a419 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -548,7 +548,7 @@ update_texture_state( GLcontext *ctx )
for (unit = 0; unit < ctx->Const.MaxTextureImageUnits; unit++) {
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
GLbitfield enableBits;
- GLuint tex;
+ GLuint texIndex;
texUnit->_Current = NULL;
texUnit->_ReallyEnabled = 0;
@@ -575,26 +575,12 @@ update_texture_state( GLcontext *ctx )
if (enableBits == 0x0)
continue;
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- ASSERT(texUnit->CurrentTex[tex]);
- }
-
/* Look for the highest-priority texture target that's enabled and
* complete. That's the one we'll use for texturing. If we're using
* a fragment program we're guaranteed that bitcount(enabledBits) <= 1.
+ * Note that the TEXTURE_x_INDEX values are in high to low priority.
*/
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- /* texture indexes from highest to lowest priority */
- static const GLuint targets[NUM_TEXTURE_TARGETS] = {
- TEXTURE_2D_ARRAY_INDEX,
- TEXTURE_1D_ARRAY_INDEX,
- TEXTURE_CUBE_INDEX,
- TEXTURE_3D_INDEX,
- TEXTURE_RECT_INDEX,
- TEXTURE_2D_INDEX,
- TEXTURE_1D_INDEX
- };
- GLuint texIndex = targets[tex];
+ for (texIndex = 0; texIndex < NUM_TEXTURE_TARGETS; texIndex++) {
texture_override(ctx, texUnit, enableBits,
texUnit->CurrentTex[texIndex], 1 << texIndex);
}