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>
image->desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
}
+ if (image->vk.create_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT)
+ image->desc.Format = dzn_get_typeless_dxgi_format(image->desc.Format);
+
if (image->desc.SampleDesc.Count > 1)
image->desc.Alignment = D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT;
else