From 8289ac87a404ff95759ec2a12012c1eae20419e6 Mon Sep 17 00:00:00 2001 From: Mihai Preda Date: Tue, 26 Jul 2022 15:43:30 +0300 Subject: [PATCH] gallivm: fixes for LLVM-15 opaque pointers in lp_bld_nir_aos.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_nir_aos.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_nir_aos.c index c449b5d..226bb5e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir_aos.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir_aos.c @@ -172,7 +172,7 @@ emit_load_reg(struct lp_build_nir_context *bld_base, LLVMValueRef reg_storage) { struct gallivm_state *gallivm = bld_base->base.gallivm; - return LLVMBuildLoad(gallivm->builder, reg_storage, ""); + return LLVMBuildLoad2(gallivm->builder, reg_bld->vec_type, reg_storage, ""); } @@ -195,7 +195,7 @@ emit_store_reg(struct lp_build_nir_context *bld_base, return; } - LLVMValueRef cur = LLVMBuildLoad(gallivm->builder, reg_storage, ""); + LLVMValueRef cur = LLVMBuildLoad2(gallivm->builder, reg_bld->vec_type, reg_storage, ""); LLVMTypeRef i32t = LLVMInt32TypeInContext(gallivm->context); LLVMValueRef shuffles[LP_MAX_VECTOR_LENGTH]; for (unsigned j = 0; j < 16; j++) { @@ -238,10 +238,9 @@ emit_load_ubo(struct lp_build_nir_context *bld_base, LLVMValueRef this_offset = lp_build_const_int32(gallivm, offset_val + chan); - LLVMValueRef scalar_ptr = LLVMBuildGEP(builder, bld->consts_ptr, - &this_offset, 1, ""); - - LLVMValueRef scalar = LLVMBuildLoad(builder, scalar_ptr, ""); + LLVMTypeRef scalar_type = LLVMInt8TypeInContext(gallivm->context); + LLVMValueRef scalar_ptr = LLVMBuildGEP2(builder, scalar_type, bld->consts_ptr, &this_offset, 1, ""); + LLVMValueRef scalar = LLVMBuildLoad2(builder, scalar_type, scalar_ptr, ""); lp_build_name(scalar, "const[%u].%c", offset_val, "xyzw"[chan]); -- 2.7.4