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

Author: Mihai Preda <[email protected]>
Date:   Sat Aug 20 13:50:04 2022 +0300

gallivm: fixes for LLVM-15 opaque pointers in lp_bld_format_s3tc.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_format_s3tc.c | 9 ++++-----
 src/gallium/auxiliary/gallivm/lp_bld_struct.c      | 2 ++
 src/gallium/auxiliary/gallivm/lp_bld_struct.h      | 2 ++
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c 
b/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c
index fe44841528c..4ea40d14f8c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c
@@ -1197,12 +1197,11 @@ s3tc_update_cache_access(struct gallivm_state *gallivm,
 
    assert(index == LP_BUILD_FORMAT_CACHE_MEMBER_ACCESS_TOTAL ||
           index == LP_BUILD_FORMAT_CACHE_MEMBER_ACCESS_MISS);
-
-   member_ptr = lp_build_struct_get_ptr(gallivm, ptr, index, "");
-   cache_access = LLVMBuildLoad(builder, member_ptr, "cache_access");
+   LLVMTypeRef cache_type = lp_build_format_cache_type(gallivm);
+   member_ptr = lp_build_struct_get_ptr2(gallivm, cache_type, ptr, index, "");
+   cache_access = LLVMBuildLoad2(builder, 
LLVMInt64TypeInContext(gallivm->context), member_ptr, "cache_access");
    cache_access = LLVMBuildAdd(builder, cache_access,
-                               
LLVMConstInt(LLVMInt64TypeInContext(gallivm->context),
-                                                                   count, 0), 
"");
+                               
LLVMConstInt(LLVMInt64TypeInContext(gallivm->context), count, 0), "");
    LLVMBuildStore(builder, cache_access, member_ptr);
 }
 #endif
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_struct.c 
b/src/gallium/auxiliary/gallivm/lp_bld_struct.c
index 9e3e24cd9e1..4259ecfa0d4 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_struct.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_struct.c
@@ -42,6 +42,7 @@
 #include "lp_bld_struct.h"
 
 
+/* Deprecated (used only by llvmpipe); use lp_build_struct_get_ptr2() instead. 
*/
 LLVMValueRef
 lp_build_struct_get_ptr(struct gallivm_state *gallivm,
                         LLVMValueRef ptr,
@@ -60,6 +61,7 @@ lp_build_struct_get_ptr(struct gallivm_state *gallivm,
    return member_ptr;
 }
 
+/* Deprecated (used only by llvmpipe); use lp_build_struct_get2() instead. */
 LLVMValueRef
 lp_build_struct_get(struct gallivm_state *gallivm,
                     LLVMValueRef ptr,
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_struct.h 
b/src/gallium/auxiliary/gallivm/lp_bld_struct.h
index a87519883b4..4b1cc79b2aa 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_struct.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_struct.h
@@ -55,6 +55,7 @@
 
 /**
  * Get value pointer to a structure member.
+ * Deprecated (used only by llvmpipe); use lp_build_struct_get_ptr2() instead.
  */
 LLVMValueRef
 lp_build_struct_get_ptr(struct gallivm_state *gallivm,
@@ -64,6 +65,7 @@ lp_build_struct_get_ptr(struct gallivm_state *gallivm,
 
 /**
  * Get the value of a structure member.
+ * Deprecated (used only by llvmpipe); use lp_build_struct_get2() instead.
  */
 LLVMValueRef
 lp_build_struct_get(struct gallivm_state *gallivm,

Reply via email to