anv: Allow storage on all formats that support typed writes
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 4 May 2021 15:40:55 +0000 (10:40 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 5 May 2021 12:20:09 +0000 (12:20 +0000)
commitb13d0eea127e390f083dac13ae33d6d1e3de0531
tree13cb787192a3dbc85c2e3ea3620327fe55865fb0
parentdf0580312a1f94f2347fea14e0e7b1585b96de71
anv: Allow storage on all formats that support typed writes

In particular, this gives us B8G8R8A8_UNORM storage support which is
useful for writing WSI images from compute shaders.  These formats can
only be accessed in a spec-compliant way by decorating the variable
NonReadable in the SPIR-V (writeonly in GLSL).  If the client doesn't so
decorate the variable, it'll get the null surface state where reads
return 0 and writes are ignored.

Tested-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10624>
src/intel/vulkan/anv_formats.c
src/intel/vulkan/anv_image.c
src/intel/vulkan/genX_cmd_buffer.c