ac/llvm: fix load/store_shared for vectors with more than 4 elements
authorKarol Herbst <kherbst@redhat.com>
Tue, 27 Sep 2022 18:10:37 +0000 (20:10 +0200)
committerMarge Bot <emma+marge@anholt.net>
Sat, 1 Oct 2022 13:36:46 +0000 (13:36 +0000)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18802>

src/amd/llvm/ac_nir_to_llvm.c

index 08140c1..cdb758c 100644 (file)
@@ -3068,7 +3068,7 @@ static LLVMValueRef visit_first_invocation(struct ac_nir_context *ctx)
 
 static LLVMValueRef visit_load_shared(struct ac_nir_context *ctx, const nir_intrinsic_instr *instr)
 {
-   LLVMValueRef values[4], derived_ptr, index, ret;
+   LLVMValueRef values[16], derived_ptr, index, ret;
    unsigned const_off = nir_intrinsic_base(instr);
 
    LLVMTypeRef elem_type = LLVMIntTypeInContext(ctx->ac.context, instr->dest.ssa.bit_size);
@@ -3096,7 +3096,7 @@ static void visit_store_shared(struct ac_nir_context *ctx, const nir_intrinsic_i
    LLVMValueRef src = get_src(ctx, instr->src[0]);
 
    int writemask = nir_intrinsic_write_mask(instr);
-   for (int chan = 0; chan < 4; chan++) {
+   for (int chan = 0; chan < 16; chan++) {
       if (!(writemask & (1 << chan))) {
          continue;
       }