summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Castet <castet.matthieu@free.fr>2007-09-19 23:20:13 +0200
committerMatthieu Castet <castet.matthieu@free.fr>2007-09-19 23:20:13 +0200
commit3b582dff8c72870fb4d0b3641015365ea9026022 (patch)
tree18a1b50b4062b190f6e0584524cde50720883a2b
parent1310f02dee336048a0d3f94a9b34575c3f6e00a6 (diff)
nouveau : add OUT_RING_CACHE_FORCE* to add stuff in the cache even if the value didn't change
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fifo.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
index 0805882025..3ca1560e3a 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
@@ -145,6 +145,9 @@ extern void nouveau_state_cache_init(nouveauContextPtr nmesa);
#define OUT_RING_CACHE(n) OUT_RING((n))
#define OUT_RING_CACHEf(n) OUT_RINGf((n))
#define OUT_RING_CACHEp(ptr, sz) OUT_RINGp((ptr), (sz))
+#define OUT_RING_CACHE_FORCE(n) OUT_RING((n))
+#define OUT_RING_CACHE_FORCEf(n) OUT_RINGf((n))
+#define OUT_RING_CACHE_FORCEp(ptr, sz) OUT_RINGp((ptr), (sz))
#else
#define BEGIN_RING_CACHE(subchannel,tag,size) do { \
nmesa->state_cache.dirty=1; \
@@ -162,17 +165,40 @@ extern void nouveau_state_cache_init(nouveauContextPtr nmesa);
}while(0)
#define OUT_RING_CACHEf(n) do { \
- if ((*(float*)(&nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value))!=(n)){ \
+ if ((*(GLfloat*)(&nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value))!=(n)){ \
nmesa->state_cache.atoms[nmesa->state_cache.current_pos].dirty=1; \
nmesa->state_cache.hdirty[nmesa->state_cache.current_pos/NOUVEAU_STATE_CACHE_HIER_SIZE]=1; \
- (*(float*)(&nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value))=(n);\
+ (*(GLfloat*)(&nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value))=(n);\
} \
nmesa->state_cache.current_pos++; \
}while(0)
#define OUT_RING_CACHEp(ptr,sz) do { \
-uint32_t* p=(uint32_t*)(ptr); \
-int i; for(i=0;i<sz;i++) OUT_RING_CACHE(*(p+i)); \
+ GLuint* p=(GLuint*)(ptr); \
+ int i; \
+ for(i=0;i<sz;i++) \
+ OUT_RING_CACHE(*(p+i)); \
+}while(0)
+
+#define OUT_RING_CACHE_FORCE(n) do { \
+ nmesa->state_cache.atoms[nmesa->state_cache.current_pos].dirty=1; \
+ nmesa->state_cache.hdirty[nmesa->state_cache.current_pos/NOUVEAU_STATE_CACHE_HIER_SIZE]=1; \
+ nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value=(n); \
+ nmesa->state_cache.current_pos++; \
+}while(0)
+
+#define OUT_RING_CACHE_FORCEf(n) do { \
+ nmesa->state_cache.atoms[nmesa->state_cache.current_pos].dirty=1; \
+ nmesa->state_cache.hdirty[nmesa->state_cache.current_pos/NOUVEAU_STATE_CACHE_HIER_SIZE]=1; \
+ (*(GLfloat*)(&nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value))=(n);\
+ nmesa->state_cache.current_pos++; \
+}while(0)
+
+#define OUT_RING_CACHE_FORCEp(ptr,sz) do { \
+ GLuint* p=(GLuint*)(ptr); \
+ int i; \
+ for(i=0;i<sz;i++) \
+ OUT_RING_CACHE_FORCE(*(p+i)); \
}while(0)
#endif