Mesa (master): radeonsi: fix the coordinate overloading of llvm.amdgcn.image.atomic.cmpswap.*
Nicolai Hähnle
nh at kemper.freedesktop.org
Thu Oct 13 08:18:51 UTC 2016
Module: Mesa
Branch: master
Commit: 76a940893de634a50b9149a5f3f37c33fbf4f484
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=76a940893de634a50b9149a5f3f37c33fbf4f484
Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date: Mon Oct 10 15:09:40 2016 +0200
radeonsi: fix the coordinate overloading of llvm.amdgcn.image.atomic.cmpswap.*
Fixes GL45-CTS.shader_image_load_store.basic-allTargets-atomic*
Reviewed-by: Dave Airlie <airlied at redhat.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
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
@@ -4195,10 +4195,15 @@ static void atomic_emit(
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);
More information about the mesa-commit
mailing list