From 41a18a27b005cebffc2164671ca2b1f827881321 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Fri, 16 May 2025 16:25:08 +0200 Subject: [PATCH] radeonsi: fix variable_shared_size assert in si_switch_compute_shader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit shader->selector->stage is always set to COMPUTE even for OpenCL. Remove the assert as it doesn't really protect against anything and patch the shared size only when variable_shared_size is set. Fixes: e4784104665 ("radeonsi: inline shader_info in si_shader_info, keep only what's used") Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_compute.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 26b611f3746..f397fd7dba2 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -334,11 +334,9 @@ static bool si_switch_compute_shader(struct si_context *sctx, struct si_compute struct radeon_cmdbuf *cs = &sctx->gfx_cs; const struct ac_shader_config *config = &shader->config; unsigned rsrc2; - unsigned stage = shader->selector->stage; *prefetch = false; - assert(variable_shared_size == 0 || stage == MESA_SHADER_KERNEL); if (sctx->cs_shader_state.emitted_program == program && sctx->cs_shader_state.variable_shared_size == variable_shared_size) return true; @@ -347,7 +345,7 @@ static bool si_switch_compute_shader(struct si_context *sctx, struct si_compute rsrc2 = config->rsrc2; /* only do this for OpenCL */ - if (stage == MESA_SHADER_KERNEL) { + if (variable_shared_size) { unsigned shared_size = program->sel.info.base.shared_size + variable_shared_size; unsigned lds_blocks = 0;