zink: handle partial writes to shader outputs
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 23 Jul 2020 13:20:36 +0000 (09:20 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 22 Dec 2020 13:46:38 +0000 (13:46 +0000)
commit6324699e67a65b7412e607878f5043e07e898091
tree0a965ff3a6f371928945f6a2778a272721a5d9ac
parent334759d8509b1ca3009edd0ad9b7caad3e12456e
zink: handle partial writes to shader outputs

this is super gross. spirv doesn't provide any facility for doing per-component
writes, which means all components of a value must be written every time

to this end, we need to manually split both the src and dst composites and
do per-component access for each store in order to accurately handle both
non-sequential wrmasks (which could be handled by nir_lower_wrmasks, yes, but
we aren't using it) as well as partial wrmasks

see also mesa/mesa#4006

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c