#if HAVE_LLVM
if (try_llvm && draw_get_option_use_llvm()) {
draw->llvm = draw_llvm_create(draw);
- if (!draw->llvm)
- goto err_destroy;
}
#endif
{
struct draw_llvm *llvm;
+ if (!lp_build_init())
+ return NULL;
+
llvm = CALLOC_STRUCT( draw_llvm );
if (!llvm)
return NULL;
- lp_build_init();
-
llvm->draw = draw;
llvm->nr_variants = 0;
assert(!gallivm->context);
assert(!gallivm->module);
- lp_build_init();
+ if (!lp_build_init())
+ return FALSE;
if (USE_GLOBAL_CONTEXT) {
gallivm->context = LLVMGetGlobalContext();
}
-void
+boolean
lp_build_init(void)
{
if (gallivm_initialized)
- return;
+ return TRUE;
+
+ /* XXX: Remove this once lp_bld_misc.cpp has been adapted to the removal
+ * of JITMemoryManager
+ */
+#if HAVE_LLVM >= 0x0306
+ return FALSE;
+#endif
#ifdef DEBUG
gallivm_debug = debug_get_option_gallivm_debug();
util_cpu_caps.has_avx = 0;
util_cpu_caps.has_f16c = 0;
#endif
+
+ return TRUE;
}
};
-void
+boolean
lp_build_init(void);
}
-void
+boolean
lp_jit_screen_init(struct llvmpipe_screen *screen)
{
- lp_build_init();
+ return lp_build_init();
}
lp_jit_screen_cleanup(struct llvmpipe_screen *screen);
-void
+boolean
lp_jit_screen_init(struct llvmpipe_screen *screen);
return NULL;
#endif
+ if (!lp_jit_screen_init(screen))
+ return NULL;
+
#ifdef DEBUG
LP_DEBUG = debug_get_flags_option("LP_DEBUG", lp_debug_flags, 0 );
#endif
llvmpipe_init_screen_resource_funcs(&screen->base);
- lp_jit_screen_init(screen);
-
screen->num_threads = util_cpu_caps.nr_cpus > 1 ? util_cpu_caps.nr_cpus : 0;
#ifdef PIPE_SUBSYSTEM_EMBEDDED
screen->num_threads = 0;
fpstate = util_fpstate_get();
util_fpstate_set_denorms_to_zero(fpstate);
+ if (!lp_build_init())
+ return 1;
+
for(i = 1; i < argc; ++i) {
if(strcmp(argv[i], "-v") == 0)
++verbose;
n = atoi(argv[i]);
}
- lp_build_init();
-
#ifdef DEBUG
if (verbose >= 2) {
gallivm_debug |= GALLIVM_DEBUG_IR;