ac/llvm: fix load_const for vectors with more than 4 elements
authorKarol Herbst <kherbst@redhat.com>
Tue, 27 Sep 2022 14:45:05 +0000 (16:45 +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 8c456c2..08140c1 100644 (file)
@@ -1367,7 +1367,7 @@ static bool visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
 
 static bool visit_load_const(struct ac_nir_context *ctx, const nir_load_const_instr *instr)
 {
-   LLVMValueRef values[4], value = NULL;
+   LLVMValueRef values[16], value = NULL;
    LLVMTypeRef element_type = LLVMIntTypeInContext(ctx->ac.context, instr->def.bit_size);
 
    for (unsigned i = 0; i < instr->def.num_components; ++i) {