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

Author: Mihai Preda <[email protected]>
Date:   Mon Aug 22 16:34:30 2022 +0300

gallivm: fixes for LLVM-15 opaque pointers in lp_bld_struct.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_struct.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_struct.c 
b/src/gallium/auxiliary/gallivm/lp_bld_struct.c
index 4259ecfa0d4..fa25b4ac312 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_struct.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_struct.c
@@ -109,7 +109,8 @@ lp_build_struct_get2(struct gallivm_state *gallivm,
    assert(LLVMGetTypeKind(LLVMTypeOf(ptr)) == LLVMPointerTypeKind);
    assert(LLVM_VERSION_MAJOR >= 15 || 
LLVMGetTypeKind(LLVMGetElementType(LLVMTypeOf(ptr))) == LLVMStructTypeKind);
    member_ptr = lp_build_struct_get_ptr2(gallivm, ptr_type, ptr, member, name);
-   res = LLVMBuildLoad(gallivm->builder, member_ptr, "");
+   LLVMTypeRef member_type = LLVMStructGetTypeAtIndex(ptr_type, member);
+   res = LLVMBuildLoad2(gallivm->builder, member_type, member_ptr, "");
    lp_build_name(res, "%s.%s", LLVMGetValueName(ptr), name);
    return res;
 }

Reply via email to