radeonsi: fix variable_shared_size assert in si_switch_compute_shader
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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: e478410466 ("radeonsi: inline shader_info in si_shader_info, keep only what's used")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35003>
This commit is contained in:
Karol Herbst 2025-05-16 16:25:08 +02:00 committed by Marek Olšák
parent 0e57c236c4
commit 41a18a27b0

View file

@ -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;