gallium: enable GL_AMD_depth_clamp_separate on r600, radeonsi
[mesa.git] / src / gallium / drivers / r300 / r300_cs.h
index 2e52dfa43c6a17e36e1c6ec040f712f2407b141c..560b77533cf6be6540be17db5ba8888eedd0a2de 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "r300_reg.h"
 #include "r300_context.h"
-#include "r300_winsys.h"
 
 /* Yes, I know macros are ugly. However, they are much prettier than the code
  * that they neatly hide away, and don't have the cost of function setup,so
  */
 
 #define CS_LOCALS(context) \
-    struct r300_winsys_cs *cs_copy = (context)->cs; \
-    struct r300_winsys_screen *cs_winsys = (context)->rws; \
+    struct radeon_cmdbuf *cs_copy = (context)->cs; \
+    struct radeon_winsys *cs_winsys = (context)->rws; \
     int cs_count = 0; (void) cs_count; (void) cs_winsys;
 
 #ifdef DEBUG
 
 #define BEGIN_CS(size) do { \
-    assert(size <= (R300_MAX_CMDBUF_DWORDS - cs_copy->cdw)); \
+    assert(size <= (cs_copy->current.max_dw - cs_copy->current.cdw)); \
     cs_count = size; \
 } while (0)
 
@@ -73,7 +72,7 @@
  */
 
 #define OUT_CS(value) do { \
-    cs_copy->buf[cs_copy->cdw++] = (value); \
+    cs_copy->current.buf[cs_copy->current.cdw++] = (value); \
     CS_USED_DW(1); \
 } 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->current.buf + cs_copy->current.cdw, (values), (count) * 4); \
+    cs_copy->current.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)
 
 
 
 #define WRITE_CS_TABLE(values, count) do { \
     assert(cs_count == 0); \
-    memcpy(cs_copy->buf + cs_copy->cdw, (values), (count) * 4); \
-    cs_copy->cdw += (count); \
+    memcpy(cs_copy->current.buf + cs_copy->current.cdw, (values), (count) * 4); \
+    cs_copy->current.cdw += (count); \
 } while (0)
 
 #endif /* R300_CS_H */