Module: Mesa
Branch: main
Commit: 8289ac87a404ff95759ec2a12012c1eae20419e6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8289ac87a404ff95759ec2a12012c1eae20419e6

Author: Mihai Preda <[email protected]>
Date:   Tue Jul 26 15:43:30 2022 +0300

gallivm: fixes for LLVM-15 opaque pointers in lp_bld_nir_aos.c

Reviewed-by: Marek Olšák <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

---

 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 c449b5de46c..226bb5e75cf 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]);
 

Reply via email to