llvmpipe/tests: port to new pointer interfaces.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18947>
This commit is contained in:
Dave Airlie
2022-10-04 09:41:00 +10:00
parent 0066e60fc4
commit 3d242c0447
3 changed files with 14 additions and 12 deletions
+3 -3
View File
@@ -362,11 +362,11 @@ build_unary_test_func(struct gallivm_state *gallivm,
LLVMSetFunctionCallConv(func, LLVMCCallConv);
LLVMPositionBuilderAtEnd(builder, block);
arg1 = LLVMBuildLoad(builder, arg1, "");
arg1 = LLVMBuildLoad2(builder, vf32t, arg1, "");
ret = test->builder(&bld, arg1);
LLVMBuildStore(builder, ret, arg0);
LLVMBuildRetVoid(builder);
+4 -4
View File
@@ -172,10 +172,10 @@ add_blend_test(struct gallivm_state *gallivm,
builder = gallivm->builder;
LLVMPositionBuilderAtEnd(builder, block);
src = LLVMBuildLoad(builder, src_ptr, "src");
src1 = LLVMBuildLoad(builder, src1_ptr, "src1");
dst = LLVMBuildLoad(builder, dst_ptr, "dst");
con = LLVMBuildLoad(builder, const_ptr, "const");
src = LLVMBuildLoad2(builder, vec_type, src_ptr, "src");
src1 = LLVMBuildLoad2(builder, vec_type, src1_ptr, "src1");
dst = LLVMBuildLoad2(builder, vec_type, dst_ptr, "dst");
con = LLVMBuildLoad2(builder, vec_type, const_ptr, "const");
res = lp_build_blend_aos(gallivm, blend, format, type, rt, src, NULL,
src1, NULL, dst, NULL, con, NULL, swizzle, 4);
+7 -5
View File
@@ -112,9 +112,11 @@ add_conv_test(struct gallivm_state *gallivm,
LLVMValueRef src[LP_MAX_VECTOR_LENGTH];
LLVMValueRef dst[LP_MAX_VECTOR_LENGTH];
unsigned i;
LLVMTypeRef src_vec_type = lp_build_vec_type(gallivm, src_type);
LLVMTypeRef dst_vec_type = lp_build_vec_type(gallivm, dst_type);
args[0] = LLVMPointerType(lp_build_vec_type(gallivm, src_type), 0);
args[1] = LLVMPointerType(lp_build_vec_type(gallivm, dst_type), 0);
args[0] = LLVMPointerType(src_vec_type, 0);
args[1] = LLVMPointerType(dst_vec_type, 0);
func = LLVMAddFunction(module, "test",
LLVMFunctionType(LLVMVoidTypeInContext(context),
@@ -128,15 +130,15 @@ add_conv_test(struct gallivm_state *gallivm,
for(i = 0; i < num_srcs; ++i) {
LLVMValueRef index = LLVMConstInt(LLVMInt32TypeInContext(context), i, 0);
LLVMValueRef ptr = LLVMBuildGEP(builder, src_ptr, &index, 1, "");
src[i] = LLVMBuildLoad(builder, ptr, "");
LLVMValueRef ptr = LLVMBuildGEP2(builder, src_vec_type, src_ptr, &index, 1, "");
src[i] = LLVMBuildLoad2(builder, src_vec_type, ptr, "");
}
lp_build_conv(gallivm, src_type, dst_type, src, num_srcs, dst, num_dsts);
for(i = 0; i < num_dsts; ++i) {
LLVMValueRef index = LLVMConstInt(LLVMInt32TypeInContext(context), i, 0);
LLVMValueRef ptr = LLVMBuildGEP(builder, dst_ptr, &index, 1, "");
LLVMValueRef ptr = LLVMBuildGEP2(builder, dst_vec_type, dst_ptr, &index, 1, "");
LLVMBuildStore(builder, dst[i], ptr);
}