From a75ddfd55d24363046f11b2fd2de25563698fa39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 8 Jan 2013 14:32:41 +0100 Subject: [PATCH] r300g: fix assertion failure in emit_dsa_state Broken by 8ed6b1400bc8a78f46340f41aaf2e88b24c23267. --- src/gallium/drivers/r300/r300_cs.h | 4 ++-- src/gallium/drivers/r300/r300_emit.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index c208e672f42..744e19e44e2 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -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) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 3f61444abea..4163d2d1430 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -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( -- 2.30.2