radeonsi: stop llvm context creation when use aco

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
This commit is contained in:
Qiang Yu 2023-09-04 14:11:31 +08:00
parent 5bae345fb7
commit 032c592619
3 changed files with 15 additions and 13 deletions

View file

@ -100,7 +100,7 @@ static void si_create_compute_state_async(void *job, void *gdata, int thread_ind
assert(thread_index < ARRAY_SIZE(sscreen->compiler));
compiler = &sscreen->compiler[thread_index];
if (!*compiler)
if (!sscreen->use_aco && !*compiler)
*compiler = si_create_llvm_compiler(sscreen);
assert(program->ir_type == PIPE_SHADER_IR_NIR);

View file

@ -1205,15 +1205,17 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws,
return NULL;
}
/* Initialize just one compiler instance to check for errors. The other compiler instances are
* initialized on demand.
*/
sscreen->compiler[0] = si_create_llvm_compiler(sscreen);
if (!sscreen->compiler[0]) {
/* The callee prints the error message. */
FREE(sscreen->nir_options);
FREE(sscreen);
return NULL;
if (!sscreen->use_aco) {
/* Initialize just one compiler instance to check for errors. The other compiler instances
* are initialized on demand.
*/
sscreen->compiler[0] = si_create_llvm_compiler(sscreen);
if (!sscreen->compiler[0]) {
/* The callee prints the error message. */
FREE(sscreen->nir_options);
FREE(sscreen);
return NULL;
}
}
util_idalloc_mt_init_tc(&sscreen->buffer_ids);

View file

@ -2482,7 +2482,7 @@ static void si_build_shader_variant(struct si_shader *shader, int thread_index,
compiler = &shader->compiler_ctx_state.compiler;
}
if (!*compiler)
if (!sscreen->use_aco && !*compiler)
*compiler = si_create_llvm_compiler(sscreen);
if (unlikely(!si_create_shader_variant(sscreen, *compiler, shader, debug))) {
@ -2698,7 +2698,7 @@ current_not_ready:
util_queue_fence_init(&shader->ready);
if (!sctx->compiler)
if (!sscreen->use_aco && !sctx->compiler)
sctx->compiler = si_create_llvm_compiler(sctx->screen);
shader->selector = sel;
@ -2908,7 +2908,7 @@ static void si_init_shader_selector_async(void *job, void *gdata, int thread_ind
assert(thread_index < (int)ARRAY_SIZE(sscreen->compiler));
compiler = &sscreen->compiler[thread_index];
if (!*compiler)
if (!sscreen->use_aco && !*compiler)
*compiler = si_create_llvm_compiler(sscreen);
/* Serialize NIR to save memory. Monolithic shader variants