anv: allow simple shader spilling for complex ones

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
This commit is contained in:
Lionel Landwerlin 2026-03-24 12:34:48 +02:00 committed by Marge Bot
parent 068351f848
commit 5c3deebd6f
2 changed files with 10 additions and 6 deletions

View file

@ -51,8 +51,8 @@ lower_base_workgroup_id(nir_builder *b, nir_intrinsic_instr *intrin,
static void
check_sends(struct genisa_stats *stats, unsigned send_count)
{
assert(stats->spills == 0);
assert(stats->fills == 0);
assert(send_count == 0 || stats->spills == 0);
assert(send_count == 0 || stats->fills == 0);
assert(send_count == 0 || stats->sends == send_count);
}
@ -213,7 +213,8 @@ compile_shader(struct anv_device *device,
}
}
assert(prog_data.base.total_scratch == 0);
/* Complex shaders are allowed to spill */
assert(sends_count_expectation == 0 || prog_data.base.total_scratch == 0);
assert(program != NULL);
struct anv_shader_internal *kernel = NULL;
if (program == NULL)

View file

@ -397,11 +397,14 @@ genX(emit_simpler_shader_init_compute)(struct anv_simple_shader *state)
struct anv_shader_internal *cs_bin = state->kernel;
const struct brw_cs_prog_data *prog_data =
(const struct brw_cs_prog_data *) cs_bin->prog_data;
/* Currently our simple shaders are simple enough that they never spill. */
assert(prog_data->base.total_scratch == 0);
if (state->cmd_buffer != NULL) {
genX(cmd_buffer_ensure_cfe_state)(state->cmd_buffer, 0);
genX(cmd_buffer_ensure_cfe_state)(state->cmd_buffer,
prog_data->base.total_scratch);
} else {
/* Currently our simple shaders not in the command buffers are simple
* enough that they never spill.
*/
assert(prog_data->base.total_scratch == 0);
anv_batch_emit(state->batch, GENX(CFE_STATE), cfe) {
cfe.MaximumNumberofThreads =
state->device->info->max_cs_threads *