Merge remote-tracking branch 'public/master' into vulkan
[mesa.git] / src / gallium / drivers / r300 / r300_cs.h
index c208e672f42194876603293cecf1eadafeaa608d..7ae83a8920b8183f7f87fcafca146496c993c97d 100644 (file)
@@ -46,7 +46,7 @@
 #ifdef DEBUG
 
 #define BEGIN_CS(size) do { \
-    assert(size <= (RADEON_MAX_CMDBUF_DWORDS - cs_copy->cdw)); \
+    assert(size <= (cs_copy->max_dw - cs_copy->cdw)); \
     cs_count = size; \
 } while (0)
 
     OUT_CS(CP_PACKET3(op, count))
 
 #define OUT_CS_TABLE(values, count) do { \
-    memcpy(cs_copy->buf + cs_copy->cdw, values, count * 4); \
-    cs_copy->cdw += count; \
+    memcpy(cs_copy->buf + cs_copy->cdw, (values), (count) * 4); \
+    cs_copy->cdw += (count); \
     CS_USED_DW(count); \
 } while (0)
 
 
 /**
- * Writing relocations.
+ * Writing buffers.
  */
 
 #define OUT_CS_RELOC(r) do { \
     assert((r)); \
-    assert((r)->cs_buf); \
-    cs_winsys->cs_write_reloc(cs_copy, (r)->cs_buf); \
-    CS_USED_DW(2); \
+    assert((r)->buf); \
+    OUT_CS(0xc0001000); /* PKT3_NOP */ \
+    OUT_CS(cs_winsys->cs_lookup_buffer(cs_copy, (r)->buf) * 4); \
 } while (0)