summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_texstate.c
diff options
context:
space:
mode:
authorRoland Scheidegger <rscheidegger@gmx.ch>2004-06-02 21:40:03 +0000
committerRoland Scheidegger <rscheidegger@gmx.ch>2004-06-02 21:40:03 +0000
commit2665a4e74ca0aa56f21ddc91eacc83ec2472cbda (patch)
tree05b7e3c4a5ac11a7b9ebcf984666030daa1e544a /src/mesa/drivers/dri/radeon/radeon_texstate.c
parent749e842953a9ea6e1c9070af7f7211bfc48aa1fd (diff)
change GL_ARB_texture_env_crossbar implementation behaviour to OGL 1.4 core specification instead of extension specification (undefined behaviour instead of disabled blending if not enabled texture units are referenced). Fix minor signedness bug.
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_texstate.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texstate.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index 128d3153cc..e3c305ef22 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -429,7 +429,7 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
* Extract the color and alpha combine function arguments.
*/
for ( i = 0 ; i < numColorArgs ; i++ ) {
- const GLuint op = texUnit->_CurrentCombine->OperandRGB[i] - GL_SRC_COLOR;
+ const GLint op = texUnit->_CurrentCombine->OperandRGB[i] - GL_SRC_COLOR;
const GLuint srcRGBi = texUnit->_CurrentCombine->SourceRGB[i];
assert(op >= 0);
assert(op <= 3);
@@ -455,13 +455,10 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
case GL_TEXTURE0:
case GL_TEXTURE1:
case GL_TEXTURE2:
- if (ctx->Texture.Unit[srcRGBi - GL_TEXTURE0]._ReallyEnabled)
- color_arg[i] = radeon_texture_color[op][srcRGBi - GL_TEXTURE0];
- else {
- color_combine = color_combine0;
- alpha_combine = alpha_combine0;
- goto write_txblend;
- }
+ /* implement ogl 1.4/1.5 core spec here, not specification of
+ * GL_ARB_texture_env_crossbar (which would require disabling blending
+ * instead of undefined results when referencing not enabled texunit) */
+ color_arg[i] = radeon_texture_color[op][srcRGBi - GL_TEXTURE0];
break;
default:
return GL_FALSE;
@@ -469,7 +466,7 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
}
for ( i = 0 ; i < numAlphaArgs ; i++ ) {
- const GLuint op = texUnit->_CurrentCombine->OperandA[i] - GL_SRC_ALPHA;
+ const GLint op = texUnit->_CurrentCombine->OperandA[i] - GL_SRC_ALPHA;
const GLuint srcAi = texUnit->_CurrentCombine->SourceA[i];
assert(op >= 0);
assert(op <= 1);
@@ -495,13 +492,7 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
case GL_TEXTURE0:
case GL_TEXTURE1:
case GL_TEXTURE2:
- if (ctx->Texture.Unit[srcAi - GL_TEXTURE0]._ReallyEnabled)
- alpha_arg[i] = radeon_texture_alpha[op][srcAi - GL_TEXTURE0];
- else {
- color_combine = color_combine0;
- alpha_combine = alpha_combine0;
- goto write_txblend;
- }
+ alpha_arg[i] = radeon_texture_alpha[op][srcAi - GL_TEXTURE0];
break;
default:
return GL_FALSE;
@@ -699,7 +690,6 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
*/
}
-write_txblend:
if ( rmesa->hw.tex[unit].cmd[TEX_PP_TXCBLEND] != color_combine ||
rmesa->hw.tex[unit].cmd[TEX_PP_TXABLEND] != alpha_combine ) {
RADEON_STATECHANGE( rmesa, tex[unit] );