Mesa (master): ac/nir: Fix ordering of parameters for image atomic cmpswap intrinsics
Bas Nieuwenhuizen
bnieuwenhuizen at kemper.freedesktop.org
Thu Jul 6 22:58:39 UTC 2017
Module: Mesa
Branch: master
Commit: c2a5cb64272da3cd8d97b0a58da6c6992b0417d3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2a5cb64272da3cd8d97b0a58da6c6992b0417d3
Author: Alex Smith <asmith at feralinteractive.com>
Date: Fri Jun 30 11:15:42 2017 +0100
ac/nir: Fix ordering of parameters for image atomic cmpswap intrinsics
The NIR parameters are ordered "compare, data", matching GLSL, but both
the image and buffer LLVM intrinsics take them the other way around.
This is already handled correctly for SSBO atomics.
Signed-off-by: Alex Smith <asmith at feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
---
src/amd/common/ac_nir_to_llvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index beafd5685f..922331090c 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3473,9 +3473,9 @@ static LLVMValueRef visit_image_atomic(struct nir_to_llvm_context *ctx,
abort();
}
- params[param_count++] = get_src(ctx, instr->src[2]);
if (instr->intrinsic == nir_intrinsic_image_atomic_comp_swap)
params[param_count++] = get_src(ctx, instr->src[3]);
+ params[param_count++] = get_src(ctx, instr->src[2]);
if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_BUF) {
params[param_count++] = get_sampler_desc(ctx, instr->variables[0], DESC_BUFFER);
More information about the mesa-commit
mailing list