From a062156bb27d604abb19b4ad6a3668c42b1334ab Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 13 Jun 2010 00:31:04 +0200 Subject: 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). --- src/gallium/drivers/r300/r300_cs.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gallium/drivers/r300/r300_cs.h') diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 1cdd4b82ca..1649766989 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 */ -- cgit v1.2.3