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>
This commit is contained in:
Connor Abbott
2022-09-22 17:32:53 +02:00
committed by Marge Bot
parent 750ecb0aa9
commit 8cb1deded6

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