summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>2019-01-23 22:44:05 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2019-02-14 12:28:47 +0000
commit08834a3721e7c1907343e7d36cf7b481e15688b2 (patch)
treeef67064072d22948b130d5198e154a782e71f2ef
parentf04d57ff1fb6d9f79bf332acca179636843f0df9 (diff)
amd/common: Use correct writemask for shared memory stores.
The check was for 1 bit being set, which is clearly not what we want. CC: <mesa-stable@lists.freedesktop.org> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (cherry picked from commit 3c24fc64c7a4e564d84843fab7db25963d574d99)
-rw-r--r--src/amd/common/ac_nir_to_llvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index c1db8f30389..593ca7100b7 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -2072,7 +2072,7 @@ visit_store_var(struct ac_nir_context *ctx,
int writemask = instr->const_index[0];
LLVMValueRef address = get_src(ctx, instr->src[0]);
LLVMValueRef val = get_src(ctx, instr->src[1]);
- if (util_is_power_of_two_nonzero(writemask)) {
+ if (writemask == (1u << ac_get_llvm_num_components(val)) - 1) {
val = LLVMBuildBitCast(
ctx->ac.builder, val,
LLVMGetElementType(LLVMTypeOf(address)), "");