summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau/nouveau_state_cache.c
diff options
context:
space:
mode:
authorStephane Marchesin <marchesin@icps.u-strasbg.fr>2007-01-14 21:17:08 +0100
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>2007-01-14 21:17:08 +0100
commit65e3d5e45e3d14f4ff98a15af0662e6c6e589cd2 (patch)
tree3b2e6e2fd0b8a486715875cec74291ed7a15a195 /src/mesa/drivers/dri/nouveau/nouveau_state_cache.c
parent8d7e5651fba9fd62e1055c05d1814c7d2de7f43c (diff)
nouveau: Make the state cache hierarchical.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_state_cache.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_state_cache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state_cache.c b/src/mesa/drivers/dri/nouveau/nouveau_state_cache.c
index 36f0c1024b..cb4b9d3027 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_state_cache.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_state_cache.c
@@ -25,6 +25,8 @@ void nouveau_state_cache_flush(nouveauContextPtr nmesa)
do
{
// jump to a dirty state
+ while((nmesa->state_cache.hdirty[i/NOUVEAU_STATE_CACHE_HIER_SIZE]==0)&&(i<NOUVEAU_STATE_CACHE_ENTRIES))
+ i=(i&~(NOUVEAU_STATE_CACHE_HIER_SIZE-1))+NOUVEAU_STATE_CACHE_HIER_SIZE;
while((nmesa->state_cache.atoms[i].dirty==0)&&(i<NOUVEAU_STATE_CACHE_ENTRIES))
i++;
@@ -42,11 +44,14 @@ void nouveau_state_cache_flush(nouveauContextPtr nmesa)
{
OUT_RING(nmesa->state_cache.atoms[i+j].value);
nmesa->state_cache.atoms[i+j].dirty=0;
+ if ((i+j)%NOUVEAU_STATE_CACHE_HIER_SIZE==0)
+ nmesa->state_cache.hdirty[(i+j)/NOUVEAU_STATE_CACHE_HIER_SIZE-1]=0;
}
i+=run;
}
}
while(i<NOUVEAU_STATE_CACHE_ENTRIES);
+ nmesa->state_cache.hdirty[NOUVEAU_STATE_CACHE_HIER_SIZE/NOUVEAU_STATE_CACHE_HIER_SIZE-1]=0;
}