mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 21:40:08 +01:00
nir/unsigned_upper_bound: decrement num_sources_left before recursing
Otherwise, search_phi_bcsel() will be called with a buf_size that is slightly lower than it has to be. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7748>
This commit is contained in:
parent
65fbae16e3
commit
2a1238f3a3
1 changed files with 2 additions and 1 deletions
|
|
@ -1116,11 +1116,12 @@ search_phi_bcsel(nir_ssa_scalar scalar, nir_ssa_scalar *buf, unsigned buf_size,
|
|||
if (buf_size >= num_sources_left) {
|
||||
unsigned total_added = 0;
|
||||
nir_foreach_phi_src(src, phi) {
|
||||
num_sources_left--;
|
||||
unsigned added = search_phi_bcsel(
|
||||
(nir_ssa_scalar){src->src.ssa, 0}, buf + total_added, buf_size - num_sources_left, visited);
|
||||
assert(added <= buf_size);
|
||||
buf_size -= added;
|
||||
total_added += added;
|
||||
num_sources_left--;
|
||||
}
|
||||
return total_added;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue