diff options
Diffstat (limited to 'src/mesa/drivers/dri/r128')
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_context.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_lock.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_tris.c | 25 |
4 files changed, 17 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index 6194d128f4..2f30bd253b 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -190,7 +190,7 @@ GLboolean r128CreateContext( const __GLcontextModes *glVisual, rmesa->RenderIndex = -1; /* Impossible value */ rmesa->vert_buf = NULL; rmesa->num_verts = 0; - rmesa->tnl_state = ~0; + RENDERINPUTS_ONES( rmesa->tnl_state_bitset ); /* Set the maximum texture size small enough that we can guarentee that * all texture units can bind a maximal texture and have them both in diff --git a/src/mesa/drivers/dri/r128/r128_context.h b/src/mesa/drivers/dri/r128/r128_context.h index b3552ac763..c51dd7fa58 100644 --- a/src/mesa/drivers/dri/r128/r128_context.h +++ b/src/mesa/drivers/dri/r128/r128_context.h @@ -130,7 +130,7 @@ struct r128_context { char *verts; /* points to tnl->clipspace.vertex_buf */ GLuint num_verts; int coloroffset, specoffset; - int tnl_state; /* tnl->render_inputs for this _tnl_install_attrs */ + DECLARE_RENDERINPUTS(tnl_state_bitset); /* tnl->render_inputs for this _tnl_install_attrs */ GLuint NewGLState; GLuint Fallback; diff --git a/src/mesa/drivers/dri/r128/r128_lock.c b/src/mesa/drivers/dri/r128/r128_lock.c index ef67bc6a43..393dd1ed74 100644 --- a/src/mesa/drivers/dri/r128/r128_lock.c +++ b/src/mesa/drivers/dri/r128/r128_lock.c @@ -89,7 +89,7 @@ void r128GetLock( r128ContextPtr rmesa, GLuint flags ) driUpdateFramebufferSize(rmesa->glCtx, dPriv); rmesa->lastStamp = dPriv->lastStamp; rmesa->new_state |= R128_NEW_CLIP; - rmesa->tnl_state = ~0; + RENDERINPUTS_ONES( rmesa->tnl_state_bitset ); } rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_CLIPRECTS; diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c index 64f54682b6..4631522516 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.c +++ b/src/mesa/drivers/dri/r128/r128_tris.c @@ -564,11 +564,13 @@ static void r128RenderStart( GLcontext *ctx ) r128ContextPtr rmesa = R128_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - GLuint index = tnl->render_inputs; + DECLARE_RENDERINPUTS(index_bitset); GLuint vc_frmt = 0; GLboolean fallback_projtex = GL_FALSE; GLuint offset = 0; + RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); + /* Important: */ VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; rmesa->vertex_attr_count = 0; @@ -577,7 +579,7 @@ static void r128RenderStart( GLcontext *ctx ) /* EMIT_ATTR's must be in order as they tell t_vertex.c how to * build up a hardware vertex. */ - if ( index & _TNL_BITS_TEX_ANY ) + if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, R128_CCE_VC_FRMT_RHW, 16 ); else EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, 0, 12 ); @@ -591,28 +593,29 @@ static void r128RenderStart( GLcontext *ctx ) R128_CCE_VC_FRMT_DIFFUSE_ARGB, 4 ); #endif - if ( index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG) ) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 ) || + RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { #if MESA_LITTLE_ENDIAN - if ( index & _TNL_BIT_COLOR1) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->specoffset = offset; EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, R128_CCE_VC_FRMT_SPEC_FRGB, 3 ); } else EMIT_PAD( 3 ); - if (index & _TNL_BIT_FOG) + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, R128_CCE_VC_FRMT_SPEC_FRGB, 1 ); else EMIT_PAD( 1 ); #else - if (index & _TNL_BIT_FOG) + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, R128_CCE_VC_FRMT_SPEC_FRGB, 1 ); else EMIT_PAD( 1 ); - if ( index & _TNL_BIT_COLOR1) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->specoffset = offset; EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB, R128_CCE_VC_FRMT_SPEC_FRGB, 3 ); @@ -621,12 +624,12 @@ static void r128RenderStart( GLcontext *ctx ) #endif } - if ( index & _TNL_BIT_TEX(rmesa->tmu_source[0]) ) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(rmesa->tmu_source[0]) )) { if ( VB->TexCoordPtr[rmesa->tmu_source[0]]->size > 2 ) fallback_projtex = GL_TRUE; EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, R128_CCE_VC_FRMT_S_T, 8 ); } - if ( index & _TNL_BIT_TEX(rmesa->tmu_source[1]) ) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(rmesa->tmu_source[1]) )) { if ( VB->TexCoordPtr[rmesa->tmu_source[1]]->size > 2 ) fallback_projtex = GL_TRUE; EMIT_ATTR( _TNL_ATTRIB_TEX1, EMIT_2F, R128_CCE_VC_FRMT_S2_T2, 8 ); @@ -638,7 +641,7 @@ static void r128RenderStart( GLcontext *ctx ) /* Only need to change the vertex emit code if there has been a * statechange to a TNL index. */ - if ( index != rmesa->tnl_state ) { + if (!RENDERINPUTS_EQUAL( index_bitset, rmesa->tnl_state_bitset )) { FLUSH_BATCH( rmesa ); rmesa->dirty |= R128_UPLOAD_CONTEXT; @@ -763,7 +766,7 @@ void r128InitTriFuncs( GLcontext *ctx ) _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, (6 + 2 * ctx->Const.MaxTextureUnits) * sizeof(GLfloat) ); rmesa->verts = (char *)tnl->clipspace.vertex_buf; - rmesa->tnl_state = -1; + RENDERINPUTS_ONES( rmesa->tnl_state_bitset ); rmesa->NewGLState |= _R128_NEW_RENDER_STATE; } |