summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2004-05-12 16:29:55 +0000
committerIan Romanick <[email protected]>2004-05-12 16:29:55 +0000
commit0e22d598e679b2d2c56b4dbd63c3212a5800d999 (patch)
tree9ff469b4ca313c01a6c8c5aab5171b27a86a6aa4 /src
parentf1cfb4b7a79c38a6c03795eb5e3dd9076e51d9ef (diff)
Fixed a bug that showed up in several multitexturing games (Quake3 and
ThinkTanks were tested) that was related to the recent 4 TMU changes. Removed the un-needed TexBlendColorPipeNum field from the hardware context.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i830/i830_context.h2
-rw-r--r--src/mesa/drivers/dri/i830/i830_state.c4
-rw-r--r--src/mesa/drivers/dri/i830/i830_texstate.c45
3 files changed, 16 insertions, 35 deletions
diff --git a/src/mesa/drivers/dri/i830/i830_context.h b/src/mesa/drivers/dri/i830/i830_context.h
index 99d2a39c787..bb88c97de35 100644
--- a/src/mesa/drivers/dri/i830/i830_context.h
+++ b/src/mesa/drivers/dri/i830/i830_context.h
@@ -86,8 +86,6 @@ struct i830_context_t
GLuint TexBlend[I830_MAX_TEXTURE_UNITS][I830_TEXBLEND_SIZE];
GLuint Init_TexBlend[I830_MAX_TEXTURE_UNITS][I830_TEXBLEND_SIZE];
GLuint Init_TexBlendWordsUsed[I830_MAX_TEXTURE_UNITS];
- GLuint Init_TexBlendColorPipeNum[I830_MAX_TEXTURE_UNITS];
- GLuint TexBlendColorPipeNum[I830_MAX_TEXTURE_UNITS];
GLuint Init_BufferSetup[I830_DEST_SETUP_SIZE];
GLuint LodBias[I830_MAX_TEXTURE_UNITS];
diff --git a/src/mesa/drivers/dri/i830/i830_state.c b/src/mesa/drivers/dri/i830/i830_state.c
index 8bfe392682b..2f7ff9f3a1a 100644
--- a/src/mesa/drivers/dri/i830/i830_state.c
+++ b/src/mesa/drivers/dri/i830/i830_state.c
@@ -1429,8 +1429,6 @@ void i830DDInitState( GLcontext *ctx )
imesa->TexBlendWordsUsed[i] = 0;
imesa->Init_TexBlendWordsUsed[i] = 0;
- imesa->TexBlendColorPipeNum[i] = 0;
- imesa->Init_TexBlendColorPipeNum[i] = 0;
}
/* Set default blend state */
@@ -1462,7 +1460,6 @@ void i830DDInitState( GLcontext *ctx )
TEXBLENDARG_DIFFUSE);
imesa->TexBlendWordsUsed[0] = 4;
- imesa->TexBlendColorPipeNum[0] = 0;
imesa->Init_TexBlend[0][0] = (STATE3D_MAP_BLEND_OP_CMD(0) |
TEXPIPE_COLOR |
@@ -1491,7 +1488,6 @@ void i830DDInitState( GLcontext *ctx )
TEXBLENDARG_MODIFY_PARMS |
TEXBLENDARG_CURRENT);
imesa->Init_TexBlendWordsUsed[0] = 4;
- imesa->Init_TexBlendColorPipeNum[0] = 0;
memset(imesa->Setup, 0, sizeof(imesa->Setup));
diff --git a/src/mesa/drivers/dri/i830/i830_texstate.c b/src/mesa/drivers/dri/i830/i830_texstate.c
index d27ac916604..03407eb7718 100644
--- a/src/mesa/drivers/dri/i830/i830_texstate.c
+++ b/src/mesa/drivers/dri/i830/i830_texstate.c
@@ -278,7 +278,6 @@ static void i830UpdateTexEnv( GLcontext *ctx, GLuint unit )
TEXBLEND_ARG1 |
TEXBLENDARG_MODIFY_PARMS |
TEXBLENDARG_CURRENT);
- imesa->TexBlendColorPipeNum[unit] = 0;
imesa->TexBlendWordsUsed[unit] = 4;
}
else {
@@ -440,15 +439,9 @@ static void i830UpdateTexEnv( GLcontext *ctx, GLuint unit )
/* Native Arg2 == Arg1 in GL_EXT_texture_env_combine spec */
/* Native Arg0 == Arg2 in GL_EXT_texture_env_combine spec */
- /* When we render we need to figure out which is the last really enabled
- * tex unit, and put last stage on it
- */
-
- imesa->TexBlendColorPipeNum[unit] = 0;
- used = 0;
-
/* Build color pipeline */
+ used = 0;
imesa->TexBlend[unit][used++] = (STATE3D_MAP_BLEND_OP_CMD(unit) |
TEXPIPE_COLOR |
ENABLE_TEXOUTPUT_WRT_SEL |
@@ -659,40 +652,34 @@ static GLboolean i830UpdateTexUnit( GLcontext *ctx, GLuint unit )
return GL_FALSE;
}
else {
- disable_tex( ctx, unit );
- return GL_TRUE;
+ return disable_tex( ctx, unit );
}
}
-/* Only deal with unit 0 and 1 for right now */
void i830UpdateTextureState( GLcontext *ctx )
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
- int pipe_num = 0;
+ int i;
+ int last_stage = 0;
GLboolean ok;
- ok = (i830UpdateTexUnit( ctx, 0 ) &&
- i830UpdateTexUnit( ctx, 1 ) &&
- i830UpdateTexUnit( ctx, 2 ) &&
- i830UpdateTexUnit( ctx, 3 ));
+ for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
+ if ( (ctx->Texture.Unit[i]._ReallyEnabled == TEXTURE_2D_BIT)
+ || (ctx->Texture.Unit[i]._ReallyEnabled == TEXTURE_RECT_BIT) ) {
+ last_stage = i;
+ }
+ }
+
+ ok = GL_TRUE;
+ for ( i = 0 ; i <= last_stage ; i++ ) {
+ ok = ok && i830UpdateTexUnit( ctx, i );
+ }
FALLBACK( imesa, I830_FALLBACK_TEXTURE, !ok );
/* Make sure last stage is set correctly */
- if(imesa->TexEnabledMask & I830_TEX_UNIT_ENABLED(3)) {
- pipe_num = imesa->TexBlendColorPipeNum[3];
- imesa->TexBlend[3][pipe_num] |= TEXOP_LAST_STAGE;
- } else if(imesa->TexEnabledMask & I830_TEX_UNIT_ENABLED(2)) {
- pipe_num = imesa->TexBlendColorPipeNum[2];
- imesa->TexBlend[2][pipe_num] |= TEXOP_LAST_STAGE;
- } else if(imesa->TexEnabledMask & I830_TEX_UNIT_ENABLED(1)) {
- pipe_num = imesa->TexBlendColorPipeNum[1];
- imesa->TexBlend[1][pipe_num] |= TEXOP_LAST_STAGE;
- } else {
- pipe_num = imesa->TexBlendColorPipeNum[0];
- imesa->TexBlend[0][pipe_num] |= TEXOP_LAST_STAGE;
- }
+ imesa->TexBlend[last_stage][0] |= TEXOP_LAST_STAGE;
}