Module: vkd3d Branch: master Commit: 65ee0562f942ab16c81da9b6e5dceedbac0a132e URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=65ee0562f942ab16c81da9b6...
Author: Philip Rebohle philip.rebohle@tu-dortmund.de Date: Mon Nov 25 17:53:38 2019 +0330
vkd3d: Set VK_IMAGE_MUTABLE_FORMAT_BIT for UAV images with non-UINT formats.
Needed to support ClearUnorderedAccessViewUint() for all formats.
Signed-off-by: Philip Rebohle philip.rebohle@tu-dortmund.de Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
libs/vkd3d/resource.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 8615464..7d22ba4 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -864,13 +864,17 @@ static HRESULT vkd3d_create_image(struct d3d12_device *device, image_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; image_info.pNext = NULL; image_info.flags = 0; - if (!(desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) && format->type == VKD3D_FORMAT_TYPE_TYPELESS) + if (desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS) + { + /* Format compatibility rules are more relaxed for UAVs. */ + if (format->type != VKD3D_FORMAT_TYPE_UINT) + image_info.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; + } + else if (!(desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) && format->type == VKD3D_FORMAT_TYPE_TYPELESS) { image_info.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
- /* Format compatibility rules are more relaxed for UAVs. */ - if (!(desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS) - && (compat_list = vkd3d_get_format_compatibility_list(device, desc->Format))) + if ((compat_list = vkd3d_get_format_compatibility_list(device, desc->Format))) { format_list.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR; format_list.pNext = NULL;