summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJose Fonseca <[email protected]>2016-04-19 12:07:16 +0100
committerJose Fonseca <[email protected]>2016-04-19 12:10:02 +0100
commit524042fa35d3182227e81baeb295f4cb2ee73530 (patch)
tree79af764c4cf68adfb5005e7b880a765aa236fed0 /src/gallium
parentbb9e8c5090f0826dcf24368f3017c784f45cfac8 (diff)
llvmpipe: Avoid LLVMGetGlobalContext in tests.
Trivial.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_arit.c5
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_blend.c5
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_conv.c5
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_format.c10
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_printf.c5
5 files changed, 24 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_arit.c b/src/gallium/drivers/llvmpipe/lp_test_arit.c
index f0582ff83e1..875d51c5a38 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_arit.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_arit.c
@@ -400,6 +400,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
{
char test_name[128];
util_snprintf(test_name, sizeof test_name, "%s.v%u", test->name, length);
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef test_func;
unary_func_t test_func_jit;
@@ -415,7 +416,8 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
in[i] = 1.0;
}
- gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module", context);
test_func = build_unary_test_func(gallivm, test, length, test_name);
@@ -486,6 +488,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
}
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
align_free(in);
align_free(out);
diff --git a/src/gallium/drivers/llvmpipe/lp_test_blend.c b/src/gallium/drivers/llvmpipe/lp_test_blend.c
index 9139b83f05a..13bed088bc5 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_blend.c
@@ -437,6 +437,7 @@ test_one(unsigned verbose,
const struct pipe_blend_state *blend,
struct lp_type type)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef func = NULL;
blend_test_ptr_t blend_test_ptr;
@@ -450,7 +451,8 @@ test_one(unsigned verbose,
if(verbose >= 1)
dump_blend_type(stdout, blend, type);
- gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module", context);
func = add_blend_test(gallivm, blend, type);
@@ -579,6 +581,7 @@ test_one(unsigned verbose,
write_tsv_row(fp, blend, type, cycles_avg, success);
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
return success;
}
diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c
index 02a63193af5..6e58a031515 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_conv.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c
@@ -155,6 +155,7 @@ test_one(unsigned verbose,
struct lp_type src_type,
struct lp_type dst_type)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef func = NULL;
conv_test_ptr_t conv_test_ptr;
@@ -211,7 +212,8 @@ test_one(unsigned verbose,
eps = MAX2(lp_const_eps(src_type), lp_const_eps(dst_type));
- gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module", context);
func = add_conv_test(gallivm, src_type, num_srcs, dst_type, num_dsts);
@@ -322,6 +324,7 @@ test_one(unsigned verbose,
write_tsv_row(fp, src_type, dst_type, cycles_avg, success);
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
return success;
}
diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c
index 3f2ed8458a3..ae4c3f8e2e2 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_format.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_format.c
@@ -139,6 +139,7 @@ static boolean
test_format_float(unsigned verbose, FILE *fp,
const struct util_format_description *desc)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef fetch = NULL;
fetch_ptr_t fetch_ptr;
@@ -148,7 +149,8 @@ test_format_float(unsigned verbose, FILE *fp,
boolean success = TRUE;
unsigned i, j, k, l;
- gallivm = gallivm_create("test_module_float", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module_float", context);
fetch = add_fetch_rgba_test(gallivm, verbose, desc, lp_float32_vec4_type());
@@ -222,6 +224,7 @@ test_format_float(unsigned verbose, FILE *fp,
}
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
if(fp)
write_tsv_row(fp, desc, success);
@@ -235,6 +238,7 @@ static boolean
test_format_unorm8(unsigned verbose, FILE *fp,
const struct util_format_description *desc)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef fetch = NULL;
fetch_ptr_t fetch_ptr;
@@ -244,7 +248,8 @@ test_format_unorm8(unsigned verbose, FILE *fp,
boolean success = TRUE;
unsigned i, j, k, l;
- gallivm = gallivm_create("test_module_unorm8", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module_unorm8", context);
fetch = add_fetch_rgba_test(gallivm, verbose, desc, lp_unorm8_vec4_type());
@@ -317,6 +322,7 @@ test_format_unorm8(unsigned verbose, FILE *fp,
}
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
if(fp)
write_tsv_row(fp, desc, success);
diff --git a/src/gallium/drivers/llvmpipe/lp_test_printf.c b/src/gallium/drivers/llvmpipe/lp_test_printf.c
index fe4ce0fc5d7..3d3dc5838dc 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_printf.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_printf.c
@@ -89,12 +89,14 @@ static boolean
test_printf(unsigned verbose, FILE *fp,
const struct printf_test_case *testcase)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef test;
test_printf_t test_printf_func;
boolean success = TRUE;
- gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module", context);
test = add_printf_test(gallivm);
@@ -107,6 +109,7 @@ test_printf(unsigned verbose, FILE *fp,
test_printf_func(0);
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
return success;
}