nir: track if var copies lowering was called
authorAlejandro Piñeiro <apinheiro@igalia.com>
Sat, 25 Jun 2022 23:18:09 +0000 (01:18 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 6 Feb 2023 22:11:34 +0000 (22:11 +0000)
commit3685528c1ea1fb8b68a421a96a888f2b7ba914f5
tree0d3a148d98a9e360bdeaeebe79259f07a9157aca
parent27a89a0903f2c541541846e8d909bb67af242d5e
nir: track if var copies lowering was called

In general we should only call it once, and then we should avoid to
call any lowering that introduce back copies. So far we were tracking
that manually out of the nir shader on several places.

Ideally we would like to add a nir_validate rule, but right now there
are some exceptions to this rule. For example right now the Intel
compiler calls nir_lower_io_to_temporaries as part of linking
tess_ctrl/mesh/task sahders.

One option would be to allow drivers to reset the value, but for now
let's not add that validation rule.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
src/compiler/nir/nir_lower_var_copies.c
src/compiler/nir/nir_validate.c
src/compiler/shader_info.h