diff options
author | Dave Airlie <[email protected]> | 2017-12-05 08:28:13 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-12-05 20:07:07 +0000 |
commit | df21cd5248d20ced6aa31837511afdf61da213d0 (patch) | |
tree | 194c9a6dace66cb465c7f2400f75f59b36a7c95d /src/gallium | |
parent | 4ee2b7c45231b392d2a6abfe1b64d328c4041ae7 (diff) |
r600/shader: fix ssbo atomic operations formats.
Don't try and use the image format for ssbo, just 32-bit uint.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index df5a7b3cc08..93b86eae263 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -8360,10 +8360,19 @@ static int tgsi_atomic_op_rat(struct r600_shader_ctx *ctx) cf->barrier = 1; cf->cf_addr = 1; - desc = util_format_description(inst->Memory.Format); - r600_vertex_data_type(inst->Memory.Format, - &format, &num_format, &format_comp, &endian); memset(&vtx, 0, sizeof(struct r600_bytecode_vtx)); + if (inst->Src[0].Register.File == TGSI_FILE_IMAGE) { + desc = util_format_description(inst->Memory.Format); + r600_vertex_data_type(inst->Memory.Format, + &format, &num_format, &format_comp, &endian); + vtx.dst_sel_x = desc->swizzle[0]; + } else { + format = FMT_32; + num_format = 1; + format_comp = 0; + endian = 0; + vtx.dst_sel_x = 0; + } vtx.op = FETCH_OP_VFETCH; vtx.buffer_id = immed_base + inst->Src[0].Register.Index; vtx.buffer_index_mode = rat_index_mode; @@ -8371,7 +8380,6 @@ static int tgsi_atomic_op_rat(struct r600_shader_ctx *ctx) vtx.src_gpr = ctx->thread_id_gpr; vtx.src_sel_x = 1; vtx.dst_gpr = ctx->file_offset[inst->Dst[0].Register.File] + inst->Dst[0].Register.Index; - vtx.dst_sel_x = desc->swizzle[0]; vtx.dst_sel_y = 7; vtx.dst_sel_z = 7; vtx.dst_sel_w = 7; |