diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 6d85d37ddc2..a9a733a0750 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -66,6 +66,7 @@ static const struct debug_named_value radeonsi_debug_options[] = { {"mono", DBG(MONOLITHIC_SHADERS), "Use old-style monolithic shaders compiled on demand"}, {"nooptvariant", DBG(NO_OPT_VARIANT), "Disable compiling optimized shader variants."}, {"useaco", DBG(USE_ACO), "Use ACO as shader compiler when possible"}, + {"usellvm", DBG(USE_LLVM), "Use LLVM as shader compiler when possible"}, /* Information logging options: */ {"info", DBG(INFO), "Print driver information"}, @@ -1189,19 +1190,23 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws, if (sscreen->debug_flags & DBG(SHADOW_REGS)) sscreen->info.register_shadowing_required = true; + bool support_aco = aco_is_gpu_supported(&sscreen->info); + #if AMD_LLVM_AVAILABLE /* For GFX11.5, LLVM < 19 is missing a workaround that can cause GPU hangs. ACO is the only * alternative that has the workaround and is always available. */ if (sscreen->info.gfx_level == GFX11_5 && LLVM_VERSION_MAJOR < 19) sscreen->use_aco = true; - else + else if (sscreen->info.gfx_level >= GFX10) sscreen->use_aco = (sscreen->debug_flags & DBG(USE_ACO)); + else + sscreen->use_aco = support_aco && sscreen->info.has_image_opcodes && + !(sscreen->debug_flags & DBG(USE_LLVM)); #else sscreen->use_aco = true; #endif - bool support_aco = aco_is_gpu_supported(&sscreen->info); if (sscreen->use_aco && !support_aco) { fprintf(stderr, "radeonsi: ACO does not support this chip yet\n"); FREE(sscreen); diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index e8b4a3e3f84..91a473d8411 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -239,6 +239,7 @@ enum DBG_TMZ, DBG_SQTT, DBG_USE_ACO, + DBG_USE_LLVM, DBG_COUNT };