nir/opt_preamble: Treat *size as an input
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 29 Dec 2022 02:56:00 +0000 (21:56 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 31 Jan 2023 17:02:34 +0000 (17:02 +0000)
commit05d3238692b3144acdcd9bfcf515cccebe79fb9c
tree6037a25209094cdab93d8a86b08a96fba1b9c52f
parentd745e3b0ab4614136f1c8d93feb54b612fd58d3f
nir/opt_preamble: Treat *size as an input

Some backends may wish to reserve early uniforms for internal system values, and
use the remaining space for preamble storage. In this case, it's convenient to
teach nir_opt_preamble about a reserved offset. It's logical to treat the output
*size instead of an in/out variable that nir_opt_preamble adds to. This requires
a slight change to the consumers to zero the input.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by-(with-sparkles): Asahi Lina <lina@asahilina.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20562>
src/compiler/nir/nir_opt_preamble.c
src/freedreno/ir3/ir3_nir_opt_preamble.c