nir, ir3: Add option to use unscaled FragCoord for input attachments
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 13 Dec 2022 17:09:28 +0000 (18:09 +0100)
committerMarge Bot <emma+marge@anholt.net>
Mon, 8 May 2023 19:59:26 +0000 (19:59 +0000)
commitb474ed1f3a237156f46393f7852d605c3e876790
treea49903d3bf8db637dcdd81822e1ecc077d6d1d7d
parent715327ff857c39911005ae429a12f80aba1fd44d
nir, ir3: Add option to use unscaled FragCoord for input attachments

When rendering a scaled tile, we need to use the original, hardware
FragCoord when accessing input attachments that are on-tile (i.e. were
rendered to in a previous subpass) because they are also scaled in the
same way that FragCoord is scaled. For input attachments that aren't
already on-tile, however, we need to use the fixed gl_FragCoord. Add a
new intrinsic and a bitfield of input attachments which should use it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
src/compiler/nir/nir.h
src/compiler/nir/nir_intrinsics.py
src/compiler/nir/nir_lower_input_attachments.c
src/freedreno/ir3/ir3_compiler_nir.c