gallium: LLVM-15 contexts use non-opaque pointers

LLVM-15 enables opaque pointers by default. We temporarilly request
non-opaque pointers while we migrate our code to support non-opaque pointers.

This workaround needs to be removed before LLVM-16.

See #6615

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17514>
This commit is contained in:
Mihai Preda 2022-07-13 14:33:39 +03:00 committed by Marge Bot
parent 81d85be9a5
commit bc78b861ca
7 changed files with 27 additions and 0 deletions

View File

@ -793,6 +793,11 @@ draw_llvm_create(struct draw_context *draw, LLVMContextRef context)
llvm->context = context;
if (!llvm->context) {
llvm->context = LLVMContextCreate();
#if LLVM_VERSION_MAJOR >= 15
LLVMContextSetOpaquePointers(llvm->context, false);
#endif
llvm->context_owned = true;
}
if (!llvm->context)

View File

@ -245,6 +245,10 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
if (!llvmpipe->context)
goto fail;
#if LLVM_VERSION_MAJOR >= 15
LLVMContextSetOpaquePointers(llvmpipe->context, false);
#endif
/*
* Create drawing context and plug our rendering stage into it.
*/

View File

@ -434,6 +434,9 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
}
context = LLVMContextCreate();
#if LLVM_VERSION_MAJOR >= 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module", context, NULL);
test_func = build_unary_test_func(gallivm, test, length, test_name);

View File

@ -452,6 +452,9 @@ test_one(unsigned verbose,
dump_blend_type(stdout, blend, type);
context = LLVMContextCreate();
#if LLVM_VERSION_MAJOR >= 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module", context, NULL);
func = add_blend_test(gallivm, blend, type);

View File

@ -221,6 +221,9 @@ test_one(unsigned verbose,
}
context = LLVMContextCreate();
#if LLVM_VERSION_MAJOR >= 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module", context, NULL);
func = add_conv_test(gallivm, src_type, num_srcs, dst_type, num_dsts);

View File

@ -150,6 +150,9 @@ test_format_float(unsigned verbose, FILE *fp,
unsigned i, j, k, l;
context = LLVMContextCreate();
#if LLVM_VERSION_MAJOR >= 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module_float", context, NULL);
fetch = add_fetch_rgba_test(gallivm, verbose, desc,
@ -251,6 +254,9 @@ test_format_unorm8(unsigned verbose, FILE *fp,
unsigned i, j, k, l;
context = LLVMContextCreate();
#if LLVM_VERSION_MAJOR >= 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module_unorm8", context, NULL);
fetch = add_fetch_rgba_test(gallivm, verbose, desc,

View File

@ -96,6 +96,9 @@ test_printf(unsigned verbose, FILE *fp,
boolean success = TRUE;
context = LLVMContextCreate();
#if LLVM_VERSION_MAJOR >= 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module", context, NULL);
test = add_printf_test(gallivm);