summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_cs.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-06-13 00:31:04 +0200
committerMarek Olšák <[email protected]>2010-06-13 17:43:38 +0200
commita062156bb27d604abb19b4ad6a3668c42b1334ab (patch)
tree3fbe00aa905a4294157f18f883240088f2d91d9e /src/gallium/drivers/r300/r300_cs.h
parent7ca24dfa6daead4722d03d9a947f1e049b9c7d38 (diff)
r300g: add API for building command buffers
The idea is to build a hardware command buffer for every CSO and memcpy the buffer to a command stream at bind time (or dirty-state-emission time, to be precise).
Diffstat (limited to 'src/gallium/drivers/r300/r300_cs.h')
-rw-r--r--src/gallium/drivers/r300/r300_cs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h
index 1cdd4b82caa..1649766989d 100644
--- a/src/gallium/drivers/r300/r300_cs.h
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -56,6 +56,7 @@
if (cs_count != 0) \
debug_printf("r300: Warning: cs_count off by %d\n", cs_count); \
cs_winsys->end_cs(cs_winsys, __FILE__, __FUNCTION__, __LINE__); \
+ cs_count = 0; \
} while (0)
@@ -137,4 +138,15 @@
cs_count -= 4; \
} while (0)
+
+/**
+ * Command buffer emission.
+ */
+
+/* It's recommended not to call begin_cs/end_cs before/after this macro. */
+#define WRITE_CS_TABLE(values, count) do { \
+ assert(cs_count == 0); \
+ cs_winsys->write_cs_table(cs_winsys, values, count); \
+} while (0)
+
#endif /* R300_CS_H */