summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-04-23 17:14:26 -0700
committerEric Anholt <[email protected]>2014-04-30 14:33:20 -0700
commitff9c3e8e5a22597c83505479e918981377f8fdf4 (patch)
treedd21df42cde090b65d94cda00de32d4db6c18d89 /src/mesa/drivers/dri/r200
parent62d46332d8ed7a6270bc4e0520cf52668efd33b5 (diff)
mesa: Replace use of _ReallyEnabled as a boolean with use of _Current.
I'm probably not the only person that has tried to kill _ReallyEnabled. This does the mechanical part of the work, and cleans _ReallyEnabled from i965. I think that using _Current makes texture management clearer: You can't have multiple targets in use in the same texture image unit at the same time, because there's just that one pointer. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_tcl.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_texstate.c14
3 files changed, 7 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index 7c46d11e0c9..2c7b652952a 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -2167,7 +2167,7 @@ static void update_texturematrix( struct gl_context *ctx )
rmesa->TexMatCompSel = 0;
for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
- if (!ctx->Texture.Unit[unit]._ReallyEnabled)
+ if (!ctx->Texture.Unit[unit]._Current)
continue;
if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) {
@@ -2239,7 +2239,7 @@ static GLboolean r200ValidateBuffers(struct gl_context *ctx)
for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; ++i) {
radeonTexObj *t;
- if (!ctx->Texture.Unit[i]._ReallyEnabled)
+ if (!ctx->Texture.Unit[i]._Current)
continue;
t = radeon_tex_obj(ctx->Texture.Unit[i]._Current);
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c
index 5a724141da0..ccc8f429033 100644
--- a/src/mesa/drivers/dri/r200/r200_tcl.c
+++ b/src/mesa/drivers/dri/r200/r200_tcl.c
@@ -412,7 +412,7 @@ static GLboolean r200_run_tcl_render( struct gl_context *ctx,
}
for (i = 0 ; i < ctx->Const.MaxTextureUnits; i++) {
- if (ctx->Texture.Unit[i]._ReallyEnabled) {
+ if (ctx->Texture.Unit[i]._Current) {
if (rmesa->TexGenNeedNormals[i]) {
map_rev_fixed[2] = VERT_ATTRIB_NORMAL;
}
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index c3c92cbca25..9ec12078a47 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -296,12 +296,6 @@ static GLboolean r200UpdateTextureEnv( struct gl_context *ctx, int unit, int slo
~(R200_TXA_DOT_ALPHA | R200_TXA_SCALE_MASK | R200_TXA_OUTPUT_REG_MASK |
R200_TXA_TFACTOR_SEL_MASK | R200_TXA_TFACTOR1_SEL_MASK);
- /* texUnit->_Current can be NULL if and only if the texture unit is
- * not actually enabled.
- */
- assert( (texUnit->_ReallyEnabled == 0)
- || (texUnit->_Current != NULL) );
-
if ( R200_DEBUG & RADEON_TEXTURE ) {
fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit );
}
@@ -320,7 +314,7 @@ static GLboolean r200UpdateTextureEnv( struct gl_context *ctx, int unit, int slo
(unit << R200_TXA_TFACTOR_SEL_SHIFT) |
(replaceargs << R200_TXA_TFACTOR1_SEL_SHIFT);
- if ( !texUnit->_ReallyEnabled ) {
+ if ( !texUnit->_Current ) {
assert( unit == 0);
color_combine = R200_TXC_ARG_A_ZERO | R200_TXC_ARG_B_ZERO
| R200_TXC_ARG_C_DIFFUSE_COLOR | R200_TXC_OP_MADD;
@@ -840,7 +834,7 @@ static GLboolean r200UpdateAllTexEnv( struct gl_context *ctx )
/* find highest used unit */
for ( j = 0; j < R200_MAX_TEXTURE_UNITS; j++) {
- if (ctx->Texture.Unit[j]._ReallyEnabled) {
+ if (ctx->Texture.Unit[j]._Current) {
maxunitused = j;
}
}
@@ -869,7 +863,7 @@ static GLboolean r200UpdateAllTexEnv( struct gl_context *ctx )
nextunit[j] = currentnext;
- if (!texUnit->_ReallyEnabled) {
+ if (!texUnit->_Current) {
/* the not enabled stages are referenced "indirectly",
must not cut off the lower stages */
stageref[j] = REF_COLOR | REF_ALPHA;
@@ -953,7 +947,7 @@ static GLboolean r200UpdateAllTexEnv( struct gl_context *ctx )
i = 0;
while ((i <= maxunitused) && (i >= 0)) {
/* only output instruction if the results are referenced */
- if (ctx->Texture.Unit[i]._ReallyEnabled && stageref[i+1]) {
+ if (ctx->Texture.Unit[i]._Current && stageref[i+1]) {
GLuint replaceunit = i;
/* try to optimize GL_REPLACE away (only one level deep though) */
if ( (ctx->Texture.Unit[i]._CurrentCombine->ModeRGB == GL_REPLACE) &&