=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d: Use vkCmdResolveImage() to resolve typeless resources if possible.

Alexandre Julliard julliard at winehq.org
Thu Feb 28 14:41:18 CST 2019


Module: vkd3d
Branch: master
Commit: 02ca005ada09abd40dafe05de1ed74ef99d3633b
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=02ca005ada09abd40dafe05de1ed74ef99d3633b

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Feb 27 18:03:20 2019 +0100

vkd3d: Use vkCmdResolveImage() to resolve typeless resources if possible.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d/command.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index 5b11c3c..4999280 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -2855,8 +2855,8 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12Graphi
         ID3D12Resource *src, UINT src_sub_resource_idx, DXGI_FORMAT format)
 {
     struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList(iface);
+    const struct vkd3d_format *src_format, *dst_format, *vk_format;
     struct d3d12_resource *dst_resource, *src_resource;
-    const struct vkd3d_format *src_format, *dst_format;
     const struct vkd3d_vk_device_procs *vk_procs;
     VkImageResolve vk_image_resolve;
 
@@ -2876,13 +2876,6 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12Graphi
 
     d3d12_command_list_end_current_render_pass(list);
 
-    if (dxgi_format_is_typeless(dst_resource->desc.Format)
-            || dxgi_format_is_typeless(src_resource->desc.Format))
-    {
-        FIXME("Not implemented for typeless resources.\n");
-        return;
-    }
-
     if (!(dst_format = vkd3d_format_from_d3d12_resource_desc(&dst_resource->desc, DXGI_FORMAT_UNKNOWN)))
     {
         WARN("Invalid format %#x.\n", dst_resource->desc.Format);
@@ -2894,6 +2887,20 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12Graphi
         return;
     }
 
+    if (dxgi_format_is_typeless(dst_resource->desc.Format) || dxgi_format_is_typeless(src_resource->desc.Format))
+    {
+        if (!(vk_format = vkd3d_format_from_d3d12_resource_desc(&dst_resource->desc, format)))
+        {
+            WARN("Invalid format %#x.\n", format);
+            return;
+        }
+        if (dst_format->vk_format != src_format->vk_format || dst_format->vk_format != vk_format->vk_format)
+        {
+            FIXME("Not implemented for typeless resources.\n");
+            return;
+        }
+    }
+
     /* Resolve of depth/stencil images is not supported in Vulkan. */
     if ((dst_format->vk_aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT))
             || (src_format->vk_aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)))




More information about the wine-cvs mailing list