diff options
author | Eric Anholt <[email protected]> | 2014-04-23 15:30:27 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-04-30 14:33:17 -0700 |
commit | c703658b3965bf2e4f3593a0d54be03e8e8b1436 (patch) | |
tree | b5b6b201cbc4816dec9b6f51c0da3570b50585a3 /src/mesa/swrast | |
parent | 3dfe56c53bc7f37b65b72408fe3470ecfd218595 (diff) |
mesa: Drop _EnabledUnits.
The field wasn't really valid, since we've got more than 32 units now. It
turns out it was mostly just used for checking != 0, or checking for fixed
function coordinates, though.
v2: Fix mis-conversion in xm_line.c (caught by Ken).
Reviewed-by: Matt Turner <[email protected]> (v1)
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_context.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_texture.c | 29 | ||||
-rw-r--r-- | src/mesa/swrast/s_triangle.c | 2 |
3 files changed, 15 insertions, 20 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 9fe12f14beb..fbc976379ec 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -73,7 +73,7 @@ _swrast_update_rasterflags( struct gl_context *ctx ) } } if (ctx->Color.ColorLogicOpEnabled) rasterMask |= LOGIC_OP_BIT; - if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT; + if (ctx->Texture._MaxEnabledTexImageUnit >= 0) rasterMask |= TEXTURE_BIT; if ( ctx->ViewportArray[0].X < 0 || ctx->ViewportArray[0].X + ctx->ViewportArray[0].Width > (GLfloat) ctx->DrawBuffer->Width || ctx->ViewportArray[0].Y < 0 @@ -286,7 +286,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx) ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR); swrast->SpecularVertexAdd = (separateSpecular - && ctx->Texture._EnabledUnits == 0x0 + && ctx->Texture._MaxEnabledTexImageUnit == -1 && !_swrast_use_fragment_program(ctx) && !ctx->ATIFragmentShader._Enabled); } diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 5fd80ca4d83..a735e69c2ee 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -359,16 +359,14 @@ _swrast_unmap_texture(struct gl_context *ctx, struct gl_texture_object *texObj) void _swrast_map_textures(struct gl_context *ctx) { - GLbitfield enabledUnits = ctx->Texture._EnabledUnits; + int unit; - /* loop over enabled texture units */ - while (enabledUnits) { - GLuint unit = ffs(enabledUnits) - 1; - struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; - - _swrast_map_texture(ctx, texObj); + for (unit = 0; unit <= ctx->Texture._MaxEnabledTexImageUnit; unit++) { + if (ctx->Texture.Unit[unit]._ReallyEnabled) { + struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; - enabledUnits &= ~(1 << unit); + _swrast_map_texture(ctx, texObj); + } } } @@ -379,15 +377,12 @@ _swrast_map_textures(struct gl_context *ctx) void _swrast_unmap_textures(struct gl_context *ctx) { - GLbitfield enabledUnits = ctx->Texture._EnabledUnits; - - /* loop over enabled texture units */ - while (enabledUnits) { - GLuint unit = ffs(enabledUnits) - 1; - struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; - - _swrast_unmap_texture(ctx, texObj); + int unit; + for (unit = 0; unit <= ctx->Texture._MaxEnabledTexImageUnit; unit++) { + if (ctx->Texture.Unit[unit]._ReallyEnabled) { + struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; - enabledUnits &= ~(1 << unit); + _swrast_unmap_texture(ctx, texObj); + } } } diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 00383fb84f8..ef02abec8c2 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1071,7 +1071,7 @@ _swrast_choose_triangle( struct gl_context *ctx ) if (ctx->Texture._EnabledCoordUnits == 0x1 && !_swrast_use_fragment_program(ctx) && !ctx->ATIFragmentShader._Enabled - && ctx->Texture._EnabledUnits == 0x1 + && ctx->Texture._MaxEnabledTexImageUnit == 0 && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT && samp->WrapS == GL_REPEAT && samp->WrapT == GL_REPEAT |