From 3bac815c782a5a6be0946dc581ba49ec48c9b394 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 29 Jan 2024 14:13:31 +0100 Subject: [PATCH] pan/bi: Update the push constant count when emitting load_push_constant This is needed for panvk. Signed-off-by: Boris Brezillon Reviewed-by: Mary Guillemard Part-of: --- src/panfrost/compiler/bifrost_compile.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index e31071a37f8..11cafae342d 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -1162,6 +1162,12 @@ bi_emit_load_push_constant(bi_builder *b, nir_intrinsic_instr *instr) } bi_emit_collect_to(b, bi_def_index(&instr->def), channels, n); + + /* Update push->count to report the highest push constant word being accessed + * by this shader. + */ + b->shader->info.push->count = + MAX2((base / 4) + n, b->shader->info.push->count); } static bi_index