aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-04-23 15:35:27 -0700
committerEric Anholt <[email protected]>2014-04-30 14:21:59 -0700
commit1ad443ecdd694dd9bf3c4a5050d749fb80db6fa2 (patch)
tree6eb7ca341d9144c092ad9b0eab9d218f1e58f60d /src/mesa/drivers
parent9565392031d96e21ebe21dbf7f2ef55958c674db (diff)
i915: Redo texture unit walking on i830.
We now know what the max unit is in the context state. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i915/i830_texblend.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_texblend.c b/src/mesa/drivers/dri/i915/i830_texblend.c
index c08b2b0e527..e5542afa440 100644
--- a/src/mesa/drivers/dri/i915/i830_texblend.c
+++ b/src/mesa/drivers/dri/i915/i830_texblend.c
@@ -440,20 +440,16 @@ void
i830EmitTextureBlend(struct i830_context *i830)
{
struct gl_context *ctx = &i830->intel.ctx;
- GLuint unit, last_stage = 0, blendunit = 0;
+ GLuint unit, blendunit = 0;
I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND_ALL, false);
- if (ctx->Texture._EnabledUnits) {
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++)
+ if (ctx->Texture._MaxEnabledTexImageUnit != -1) {
+ for (unit = 0; unit < ctx->Texture._MaxEnabledTexImageUnit; unit++)
if (ctx->Texture.Unit[unit]._ReallyEnabled)
- last_stage = unit;
-
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++)
- if (ctx->Texture.Unit[unit]._ReallyEnabled)
- emit_texblend(i830, unit, blendunit++, last_stage == unit);
- }
- else {
+ emit_texblend(i830, unit, blendunit++,
+ unit == ctx->Texture._MaxEnabledTexImageUnit);
+ } else {
emit_passthrough(i830);
}
}