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: d3b7681df2 ("tu: ir3: Emit push constants directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18757>
(cherry picked from commit 8cb1deded6)
This commit is contained in:
Connor Abbott 2022-09-22 17:32:53 +02:00 committed by Dylan Baker
parent 7b1f40a3db
commit 90001a78d1
2 changed files with 2 additions and 2 deletions

View file

@ -1381,7 +1381,7 @@
"description": "ir3/analyze_ubo_ranges: Account for reserved consts",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "d3b7681df28e89311c4149708311de546e0a58cc"
},

View file

@ -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)) {