aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_texture.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-04-23 15:30:27 -0700
committerEric Anholt <[email protected]>2014-04-30 14:33:17 -0700
commitc703658b3965bf2e4f3593a0d54be03e8e8b1436 (patch)
treeb5b6b201cbc4816dec9b6f51c0da3570b50585a3 /src/mesa/swrast/s_texture.c
parent3dfe56c53bc7f37b65b72408fe3470ecfd218595 (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/s_texture.c')
-rw-r--r--src/mesa/swrast/s_texture.c29
1 files changed, 12 insertions, 17 deletions
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);
+ }
}
}