summaryrefslogtreecommitdiff
path: root/src/mesa/main/texstate.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2008-07-25 18:31:44 -0700
committerIan Romanick <ian.d.romanick@intel.com>2008-07-25 18:31:44 -0700
commit1e645b365900cf1c71ca5594bd6b549a1f203040 (patch)
treed114e55df428550c9829acf929b9fb7bcb89c429 /src/mesa/main/texstate.c
parente5022c3fdf9888857f22f9a1690035ff3f90d36b (diff)
parent9bc9e0ecb0fb2069b2c123e665eb2118e358098f (diff)
Merge branch 'master' into drm-gem
Conflicts: src/mesa/drivers/dri/common/dri_bufmgr.c src/mesa/drivers/dri/i965/brw_wm_surface_state.c
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r--src/mesa/main/texstate.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 626c264863..a6c92cb1af 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -2999,6 +2999,24 @@ update_texture_state( GLcontext *ctx )
_mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state");
break;
}
+ }
+
+ /* Determine which texture coordinate sets are actually needed */
+ if (fprog) {
+ const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
+ ctx->Texture._EnabledCoordUnits
+ = (fprog->Base.InputsRead >> FRAG_ATTRIB_TEX0) & coordMask;
+ }
+ else {
+ ctx->Texture._EnabledCoordUnits = ctx->Texture._EnabledUnits;
+ }
+
+ /* Setup texgen for those texture coordinate sets that are in use */
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+
+ if (!(ctx->Texture._EnabledCoordUnits & (1 << unit)))
+ continue;
if (texUnit->TexGenEnabled) {
if (texUnit->TexGenEnabled & S_BIT) {
@@ -3021,16 +3039,6 @@ update_texture_state( GLcontext *ctx )
if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY)
ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
}
-
- /* Determine which texture coordinate sets are actually needed */
- if (fprog) {
- const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
- ctx->Texture._EnabledCoordUnits
- = (fprog->Base.InputsRead >> FRAG_ATTRIB_TEX0) & coordMask;
- }
- else {
- ctx->Texture._EnabledCoordUnits = ctx->Texture._EnabledUnits;
- }
}