r600/ssbo: fix multi-dword buffer loads.
authorDave Airlie <airlied@redhat.com>
Tue, 5 Dec 2017 08:38:26 +0000 (08:38 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 5 Dec 2017 20:07:08 +0000 (20:07 +0000)
This fixes loading from different channels.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_shader.c

index 93b86eae263f4a70c7815db30283bbb6cdb28986..02e8354baa29c06a8b7cb917236a0da071fa624d 100644 (file)
@@ -8005,17 +8005,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)