dzn: Take VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT into account
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 30 Jun 2022 13:55:23 +0000 (06:55 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 6 Jul 2022 06:15:46 +0000 (06:15 +0000)
commit99352b87dce99c469aad81f3ae63fe761d0611a5
tree0ec733f75453898a078cef106f63b0f4b7b6bb6f
parentd132ec924d462a4f1a4cb2ba317d4d29c60931aa
dzn: Take VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT into account

Use a typeless format when VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT is
set, so we can cast to compatible types at least. Still doesn't
work when formats are of the same size but from incompatible
types (like R32_FLOAT and RGBA8_UNORM), which Vulkan considers
as compatible while D3D12 doesn't, but it gets us closer to what
the Vulkan API wants.

D3D12_FEATURE_DATA_D3D12_OPTIONS12::RelaxedFormatCastingSupported
should address the remaining limitations.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17368>
src/microsoft/vulkan/dzn_image.c