From 25ead8ec5c84028d4c58eff0b203b49f0425d812 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 26 Sep 2022 12:16:48 +1000 Subject: [PATCH] gallivm: fix buffer_type for LLVM 15 Fixes deqp-vk: /home/airlied/devel/llvm-project/llvm/include/llvm/IR/Instructions.h:961: static llvm::GetElementPtrInst* llvm::GetElementPtrInst::Create(llvm::Type*, llvm::Value*, llvm::ArrayRef, const llvm::Twine&, llvm::Instruction*): Assertion `cast(Ptr->getType()->getScalarType()) ->isOpaqueOrPointeeTypeMatches(PointeeType)' failed. Fixes: 1b8c4931df9d ("gallivm: fixes for LLVM-15 opaque pointers in lp_bld_jit_types.c") Acked-by: Mike Blumenkrantz Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_jit_types.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_jit_types.c b/src/gallium/auxiliary/gallivm/lp_bld_jit_types.c index 7af92824a5a..2a4ecf72e71 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_jit_types.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_jit_types.c @@ -71,7 +71,7 @@ lp_llvm_buffer_member(struct gallivm_state *gallivm, indices[2] = lp_build_const_int32(gallivm, member_index); LLVMTypeRef buffer_type = lp_build_create_jit_buffer_type(gallivm); - LLVMTypeRef buffers_type = LLVMArrayType(buffer_type, LP_MAX_TGSI_CONST_BUFFERS); + LLVMTypeRef buffers_type = LLVMArrayType(buffer_type, buffers_limit); LLVMValueRef ptr = LLVMBuildGEP2(builder, buffers_type, buffers_ptr, indices, ARRAY_SIZE(indices), ""); LLVMTypeRef res_type = LLVMStructGetTypeAtIndex(buffer_type, member_index);