mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
nir/opt_offsets: Also apply the max offset to top-level constant folding.
nir_to_tgsi wants this for disabling folding into shared var accesses at all. Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14309>
This commit is contained in:
parent
ec4b9909f0
commit
645ca56425
1 changed files with 1 additions and 1 deletions
|
|
@ -114,7 +114,7 @@ try_fold_load_store(nir_builder *b,
|
|||
|
||||
if (!nir_src_is_const(*off_src)) {
|
||||
replace_src = try_extract_const_addition(b, off_src->ssa->parent_instr, state, &off_const, max);
|
||||
} else if (nir_src_as_uint(*off_src)) {
|
||||
} else if (nir_src_as_uint(*off_src) && nir_src_as_uint(*off_src) < max) {
|
||||
off_const += nir_src_as_uint(*off_src);
|
||||
b->cursor = nir_before_instr(&intrin->instr);
|
||||
replace_src = nir_imm_zero(b, off_src->ssa->num_components, off_src->ssa->bit_size);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue