break;
}
imesa->LcsCullMode = cullMode;
+ imesa->new_state |= SAVAGE_NEW_CULL;
}
#endif /* end #if HW_CULL */
else
{
imesa->LcsCullMode = BCM_None;
+ imesa->new_state |= SAVAGE_NEW_CULL;
}
#endif
break;
void savageDDUpdateHwState( GLcontext *ctx )
{
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- /*FLUSH_BATCH(imesa);*/
- if(imesa->driDrawable)
- {
- LOCK_HARDWARE(imesa);
- }
-
- if (imesa->new_state & SAVAGE_NEW_TEXTURE) {
- savageUpdateTextureState( ctx );
- }
- if((imesa->dirty!=0)|| (imesa->new_state!=0))
- {
- savageEmitHwStateLocked(imesa);
- imesa->new_state = 0;
- }
- if(imesa->driDrawable)
- {
- UNLOCK_HARDWARE(imesa);
+ if (imesa->new_state) {
+ FLUSH_BATCH(imesa);
+
+ if (imesa->new_state & SAVAGE_NEW_TEXTURE) {
+ savageUpdateTextureState( ctx );
+ }
+ if ((imesa->new_state & SAVAGE_NEW_CULL)) {
+ savageUpdateCull(ctx);
+ }
+ imesa->new_state = 0;
}
}
if (imesa->dirty & ~SAVAGE_UPLOAD_CLIPRECTS)
{
- savageUpdateCull(imesa->glCtx);
if (imesa->dirty & (SAVAGE_UPLOAD_CTX | SAVAGE_UPLOAD_TEX0 | \
SAVAGE_UPLOAD_TEX1 | SAVAGE_UPLOAD_BUFFERS))
{
/* set scissor to the first clip box*/
savageDDScissor(ctx,pbox->x1,pbox->y1,pbox->x2,pbox->y2);
- savageDDUpdateHwState(ctx); /* update to hardware register*/
+ /*savageDDUpdateHwState(ctx);*/ /* update to hardware register*/
}
else /* need not render at all*/
{
static void savageDDInvalidateState( GLcontext *ctx, GLuint new_state )
{
- FLUSH_BATCH(SAVAGE_CONTEXT(ctx));
-
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
_ac_InvalidateState( ctx, new_state );
savageUpdateTexLRU( imesa, t );
if (t->dirty_images) {
+ LOCK_HARDWARE(imesa);
savageFlushVerticesLocked (imesa);
savageDmaFinish (imesa);
if (SAVAGE_DEBUG & DEBUG_VERBOSE_LRU)
for (i = t->min_level ; i <= t->max_level ; i++)
if (t->dirty_images & (1<<i))
savageUploadTexLevel( t, i );
+ UNLOCK_HARDWARE(imesa);
}
{
savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
- FLUSH_BATCH(imesa);
-
/* Update culling */
- if (imesa->raster_primitive != prim)
- imesa->dirty |= SAVAGE_UPLOAD_CTX;
+ if (imesa->raster_primitive != prim) {
+ imesa->raster_primitive = prim;
+ imesa->new_state |= SAVAGE_NEW_CULL;
+ savageDDUpdateHwState (ctx);
+ }
- imesa->raster_primitive = prim;
#if 0
if (ctx->Polygon.StippleFlag && mmesa->haveHwStipple)
{