r300: fix generation of invalid swizzles in regalloc
authorPavel Ondračka <pavel.ondracka@gmail.com>
Wed, 19 Oct 2022 08:23:11 +0000 (10:23 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 19 Oct 2022 22:49:23 +0000 (22:49 +0000)
commit1e9e5618110542550b9f92dca8392f213bfd46b7
tree3d0cd60ab9c6d3d8114219d4b5c17de7736a6027
parent842a0c6ef14876d51a6dec702bdc1137b9c9545b
r300: fix generation of invalid swizzles in regalloc

rc_adjust_channels is inteded for moving the swizzles to a new channels
when rewriting the writemask of an instruction. However for readers one
needs to keep the swizzles in the old channels but rather convert to the
new values, so use the proper helper rc_rewrite_swizzle.

With the new swizzle fixed, we should properly detect that it would be
invalid and thus we can select the proper register class to prevent the
writemask rewrite in the regalloc.

Documentation was added to rc_adjust_channels to make it more clear what
it actually does.

Fixes a bunch of dEQP tests.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7521
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19158>
src/gallium/drivers/r300/ci/r300-r480-fails.txt
src/gallium/drivers/r300/compiler/radeon_compiler_util.c
src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c