diff options
author | Roland Scheidegger <[email protected]> | 2004-05-27 16:56:47 +0000 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2004-05-27 16:56:47 +0000 |
commit | aaaf38d37215aa1536ff34ec370ecfc04111af22 (patch) | |
tree | 3eafbe589892dbc2e1525fa722704e432f6e0623 /src/mesa/drivers/dri/r200/r200_tcl.c | |
parent | d44e9e39da2663bc2fc610ba1a117ac3ea0b4c8a (diff) |
change some explicit references to texture units 0/1 to unit < MaxTextureUnits (Andreas Stenglein, Ronny Vindenes)
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_tcl.c')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_tcl.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index daf44906088..1090666dd3f 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -302,6 +302,7 @@ static void r200_check_tcl_render( GLcontext *ctx, { r200ContextPtr rmesa = R200_CONTEXT(ctx); GLuint inputs = VERT_BIT_POS; + GLuint unit; /* Validate state: */ @@ -326,23 +327,15 @@ static void r200_check_tcl_render( GLcontext *ctx, } } - if (ctx->Texture.Unit[0]._ReallyEnabled) { - if (ctx->Texture.Unit[0].TexGenEnabled) { - if (rmesa->TexGenNeedNormals[0]) { - inputs |= VERT_BIT_NORMAL; + for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) { + if (ctx->Texture.Unit[unit]._ReallyEnabled) { + if (ctx->Texture.Unit[unit].TexGenEnabled) { + if (rmesa->TexGenNeedNormals[unit]) { + inputs |= VERT_BIT_NORMAL; + } + } else { + inputs |= VERT_BIT_TEX(unit); } - } else { - inputs |= VERT_BIT_TEX0; - } - } - - if (ctx->Texture.Unit[1]._ReallyEnabled) { - if (ctx->Texture.Unit[1].TexGenEnabled) { - if (rmesa->TexGenNeedNormals[1]) { - inputs |= VERT_BIT_NORMAL; - } - } else { - inputs |= VERT_BIT_TEX1; } } |