anv: Fix assert in anv_nir_compute_push_layout
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

When per-primitive padding is needed, max_push_buffers is set to 3
(instead of 4) to reserve the last slot for it.

The assert was requiring `n_push_ranges < max_push_buffers`, which
incorrectly fired when the 3 ranges were used.

Fixes: a8ba682919 ("anv: assert we haven't gone over the maximum number of push_buffers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15155
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40803>
This commit is contained in:
Caio Oliveira 2026-04-06 10:32:34 -07:00 committed by Marge Bot
parent 959ec01ac8
commit e382d82ca9

View file

@ -624,7 +624,7 @@ anv_nir_compute_push_layout(nir_shader *nir,
}
if (needs_padding_per_primitive) {
assert(n_push_ranges < max_push_buffers);
assert(n_push_ranges < ARRAY_SIZE(map->push_ranges));
struct anv_push_range push_constant_padding_range = {
.set = ANV_DESCRIPTOR_SET_PER_PRIM_PADDING,
.start = 0,