r300g: fix assertion failure in emit_dsa_state
authorMarek Olšák <maraeo@gmail.com>
Tue, 8 Jan 2013 13:32:41 +0000 (14:32 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 8 Jan 2013 13:33:18 +0000 (14:33 +0100)
Broken by 8ed6b1400bc8a78f46340f41aaf2e88b24c23267.

src/gallium/drivers/r300/r300_cs.h
src/gallium/drivers/r300/r300_emit.c

index c208e672f42194876603293cecf1eadafeaa608d..744e19e44e2bed450d4a029f943f96d7c258dbd8 100644 (file)
@@ -96,8 +96,8 @@
     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)
 
index 3f61444abead4a625eea90741395ee80cad8ec3d..4163d2d1430fcc3a92fdecb59269df4976d1d4b6 100644 (file)
@@ -100,8 +100,10 @@ void r300_emit_dsa_state(struct r300_context* r300, unsigned size, void* state)
                       R300_FG_ALPHA_FUNC_CFG_3_OF_6;
     }
 
+    BEGIN_CS(size);
     OUT_CS_REG(R300_FG_ALPHA_FUNC, alpha_func);
-    WRITE_CS_TABLE(fb->zsbuf ? &dsa->cb_begin : dsa->cb_zb_no_readwrite, size-2);
+    OUT_CS_TABLE(fb->zsbuf ? &dsa->cb_begin : dsa->cb_zb_no_readwrite, 8);
+    END_CS;
 }
 
 static void get_rc_constant_state(