r300: allow copy propagate of RC_FILE_NONE reads to TEX instructions
authorPavel Ondračka <pavel.ondracka@gmail.com>
Mon, 2 Jan 2023 16:17:17 +0000 (17:17 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 3 Jan 2023 23:23:26 +0000 (23:23 +0000)
commit7decc7efbacf9382a150733679d638d56e878e26
tree74de99b40f17958ed7d26e814f6e879d1a116635
parentd869f0f7ca51fb8767ea4dfd457b713b6c875a26
r300: allow copy propagate of RC_FILE_NONE reads to TEX instructions

Texturing instructions can't read from constant sources, however this
can work when the constant was transformed to constant swizzles and
hence RC_FILE_NONE.

Prevents a regression in single Unigine Tropics shader that uses
constant (0.5,0.5) as a TEX coordinate in a next patch. We now
convert to constant swizzles twice, first when translating from TGSI
and than in constant folding. If we disable the first conversion
rc_transform_tex will emit a mov from constant to temporary. With this
patch, copy propagate will clean it up later.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20484>
src/gallium/drivers/r300/compiler/radeon_optimize.c