Merge branch 'gallium-polygon-stipple'
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_init.c
index 7504cb5cf2fae17468568d30dc26401ec67809e6..45addee8fabb0db31334287ee8b4a3037ca6f396 100644 (file)
@@ -222,11 +222,12 @@ free_gallivm_state(struct gallivm_state *gallivm)
 static boolean
 init_gallivm_state(struct gallivm_state *gallivm)
 {
-   assert(gallivm_initialized);
    assert(!gallivm->context);
    assert(!gallivm->module);
    assert(!gallivm->provider);
 
+   lp_build_init();
+
    gallivm->context = LLVMContextCreate();
    if (!gallivm->context)
       goto fail;
@@ -387,6 +388,9 @@ gallivm_garbage_collect(struct gallivm_state *gallivm)
 void
 lp_build_init(void)
 {
+   if (gallivm_initialized)
+      return;
+
 #ifdef DEBUG
    gallivm_debug = debug_get_option_gallivm_debug();
 #endif