[PATCH 02/10] dxgi: Always use user images instead of using Vulkan swapchain directly.

Józef Kucia jkucia at codeweavers.com
Wed Feb 27 09:04:55 CST 2019


Some Vulkan drivers require that swapchain dimensions and window dimensions match exactly.
Additionally, we want to have ability to change the presentation mode, and the only way to change
the presentation mode in Vulkan is to recreate the swapchain.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/dxgi/swapchain.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
index 07438f3e0376..89bcf5d95638 100644
--- a/dlls/dxgi/swapchain.c
+++ b/dlls/dxgi/swapchain.c
@@ -1293,18 +1293,19 @@ static HRESULT d3d12_swapchain_create_buffers(struct d3d12_swapchain *swapchain,
     resource_info.desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
     resource_info.flags = VKD3D_RESOURCE_INITIAL_STATE_TRANSITION | VKD3D_RESOURCE_PRESENT_STATE_TRANSITION;
 
-    if (vk_swapchain_format != vk_format)
+    queue_desc = ID3D12CommandQueue_GetDesc(queue);
+    if (queue_desc.Type != D3D12_COMMAND_LIST_TYPE_DIRECT)
     {
-        queue_desc = ID3D12CommandQueue_GetDesc(queue);
-        if (queue_desc.Type != D3D12_COMMAND_LIST_TYPE_DIRECT)
-        {
-            /* vkCmdBlitImage() is only supported for Graphics queues. */
-            FIXME("Format conversion not implemented for command queue type %#x.\n", queue_desc.Type);
+        /* vkCmdBlitImage() is only supported for graphics queues. */
+        FIXME("Swapchain blit not implemented for command queue type %#x.\n", queue_desc.Type);
+        if (vk_swapchain_format != vk_format)
             return E_NOTIMPL;
-        }
-        queue_family_index = vkd3d_get_vk_queue_family_index(queue);
+    }
+    queue_family_index = vkd3d_get_vk_queue_family_index(queue);
 
-        TRACE("Creating user swapchain buffers for format conversion.\n");
+    if (queue_desc.Type == D3D12_COMMAND_LIST_TYPE_DIRECT)
+    {
+        TRACE("Creating user swapchain buffers.\n");
 
         if (FAILED(hr = d3d12_swapchain_create_user_buffers(swapchain, vk_format)))
             return hr;
-- 
2.19.2




More information about the wine-devel mailing list