From 8cb1deded60e4b8d101e4a3055078f9434aa7d8f Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Thu, 22 Sep 2022 17:32:53 +0200 Subject: [PATCH] ir3/analyze_ubo_ranges: Account for reserved consts We weren't accounting for the reserved consts when calculating how much we can upload. This led to assertion failures later if we pushed too much. Fixes: d3b7681df28 ("tu: ir3: Emit push constants directly") Part-of: --- src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c index c6d63d499a8..894d069388d 100644 --- a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c +++ b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c @@ -425,7 +425,7 @@ ir3_nir_analyze_ubo_ranges(nir_shader *nir, struct ir3_shader_variant *v) memset(state, 0, sizeof(*state)); - uint32_t upload_remaining = max_upload; + uint32_t upload_remaining = max_upload - v->num_reserved_user_consts * 16; bool push_ubos = compiler->push_ubo_with_preamble; nir_foreach_function (function, nir) { if (function->impl && (!push_ubos || !function->is_preamble)) {