if (!sscreen->b.ws->unref(sscreen->b.ws))
return;
- if (util_queue_is_initialized(&sscreen->shader_compiler_queue))
- util_queue_destroy(&sscreen->shader_compiler_queue);
+ util_queue_destroy(&sscreen->shader_compiler_queue);
for (i = 0; i < ARRAY_SIZE(sscreen->tm); i++)
if (sscreen->tm[i])
return NULL;
}
+ /* Only enable as many threads as we have target machines and CPUs. */
+ num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
+ num_compiler_threads = MIN2(num_cpus, ARRAY_SIZE(sscreen->tm));
+
+ if (!util_queue_init(&sscreen->shader_compiler_queue, "si_shader",
+ 32, num_compiler_threads)) {
+ si_destroy_shader_cache(sscreen);
+ FREE(sscreen);
+ return NULL;
+ }
+
si_handle_env_var_force_family(sscreen);
if (!debug_get_bool_option("RADEON_DISABLE_PERFCOUNTERS", false))
if (debug_get_bool_option("RADEON_DUMP_SHADERS", false))
sscreen->b.debug_flags |= DBG_FS | DBG_VS | DBG_GS | DBG_PS | DBG_CS;
- /* Only enable as many threads as we have target machines and CPUs. */
- num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
- num_compiler_threads = MIN2(num_cpus, ARRAY_SIZE(sscreen->tm));
-
for (i = 0; i < num_compiler_threads; i++)
sscreen->tm[i] = si_create_llvm_target_machine(sscreen);
- util_queue_init(&sscreen->shader_compiler_queue, "si_shader",
- 32, num_compiler_threads);
-
/* Create the auxiliary context. This must be done last. */
sscreen->b.aux_context = sscreen->b.b.context_create(&sscreen->b.b, NULL, 0);
if ((sctx->b.debug.debug_message && !sctx->b.debug.async) ||
sctx->is_debug ||
- r600_can_dump_shader(&sscreen->b, sel->info.processor) ||
- !util_queue_is_initialized(&sscreen->shader_compiler_queue))
+ r600_can_dump_shader(&sscreen->b, sel->info.processor))
si_init_shader_selector_async(sel, -1);
else
util_queue_add_job(&sscreen->shader_compiler_queue, sel,