zink: fix/improve handling for multi-component bitfield ops
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 20 Sep 2022 15:42:41 +0000 (11:42 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 30 Sep 2022 01:52:47 +0000 (01:52 +0000)
commitaf775f842cad7eff4deaff9a476a3702970b5645
treed6c4d78779c76e3c9634a9dacdf5461a996f1c18
parent111bf8bfee280683a4c2d14ec08f65675204138c
zink: fix/improve handling for multi-component bitfield ops

the original improvement for this correctly handled cases where
the offset/count values were swizzled with .xxxx, but it was broken
for any other swizzling

this adds a nir pass to more easily manipulate the swizzles and rewrite
the multi-component ops as multiple ops with the swizzled params

fixes #6697

Fixes: 8e97f51c676 ("zink: handle swizzled offset/count values for shader bitfield ops")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18706>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/gallium/drivers/zink/zink_compiler.c