[Mesa-dev] [PATCH] radeonsi: fix the coordinate overloading of llvm.amdgcn.image.atomic.cmpswap.*
Nicolai Hähnle
nhaehnle at gmail.com
Wed Oct 12 17:42:49 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
Fixes GL45-CTS.shader_image_load_store.basic-allTargets-atomic*
---
src/gallium/drivers/radeonsi/si_shader.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 8b77fd1..25146e8 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -4188,24 +4188,29 @@ static void atomic_emit(
if (inst->Src[0].Register.File == TGSI_FILE_MEMORY) {
atomic_emit_memory(ctx, emit_data);
return;
}
if (inst->Src[0].Register.File == TGSI_FILE_BUFFER ||
inst->Memory.Texture == TGSI_TEXTURE_BUFFER) {
snprintf(intrinsic_name, sizeof(intrinsic_name),
"llvm.amdgcn.buffer.atomic.%s", action->intr_name);
} else {
+ LLVMValueRef coords;
char coords_type[8];
- build_type_name_for_intr(LLVMTypeOf(emit_data->args[1]),
- coords_type, sizeof(coords_type));
+ if (inst->Instruction.Opcode == TGSI_OPCODE_ATOMCAS)
+ coords = emit_data->args[2];
+ else
+ coords = emit_data->args[1];
+
+ build_type_name_for_intr(coords, coords_type, sizeof(coords_type));
snprintf(intrinsic_name, sizeof(intrinsic_name),
"llvm.amdgcn.image.atomic.%s.%s",
action->intr_name, coords_type);
}
tmp = lp_build_intrinsic(
builder, intrinsic_name, bld_base->uint_bld.elem_type,
emit_data->args, emit_data->arg_count, 0);
emit_data->output[emit_data->chan] =
LLVMBuildBitCast(builder, tmp, bld_base->base.elem_type, "");
--
2.7.4
More information about the mesa-dev
mailing list