[Mesa-dev] [PATCH 5/6] r600/ssbo: fix multi-dword buffer loads.

Dave Airlie airlied at gmail.com
Tue Dec 5 10:35:51 UTC 2017


From: Dave Airlie <airlied at redhat.com>

This fixes loading from different channels.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/drivers/r600/r600_shader.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 11372595fb..dbc75171fa 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -7958,17 +7958,19 @@ static int tgsi_load_buffer(struct r600_shader_ctx *ctx)
 	vtx.format_comp_all = 1;
 	vtx.srf_mode_all = 0;
 
-	if (inst->Dst[0].Register.WriteMask == 0xf) {
+	if (inst->Dst[0].Register.WriteMask & 8) {
 		vtx.data_format = FMT_32_32_32_32;
 		vtx.use_const_fields = 0;
-	} else if (inst->Dst[0].Register.WriteMask == 0x7) {
+	} else if (inst->Dst[0].Register.WriteMask & 4) {
 		vtx.data_format = FMT_32_32_32;
 		vtx.use_const_fields = 0;
-	} else if (inst->Dst[0].Register.WriteMask == 0x3) {
+	} else if (inst->Dst[0].Register.WriteMask & 2) {
 		vtx.data_format = FMT_32_32;
 		vtx.use_const_fields = 0;
-	} else
-		vtx.use_const_fields = 1;
+	} else {
+		vtx.data_format = FMT_32;
+		vtx.use_const_fields = 0;
+	}
 
 	r = r600_bytecode_add_vtx_tc(ctx->bc, &vtx);
 	if (r)
-- 
2.14.3



More information about the mesa-dev mailing list