=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d: Always return render pass from d3d12_pipeline_state_get_or_create_pipeline ().

Alexandre Julliard julliard at winehq.org
Tue May 21 16:43:32 CDT 2019


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue May 21 10:57:22 2019 +0200

vkd3d: Always return render pass from d3d12_pipeline_state_get_or_create_pipeline().

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 |  3 ---
 libs/vkd3d/state.c   | 13 ++++++-------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index 2fdd980..a4659f7 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -2431,9 +2431,6 @@ static bool d3d12_command_list_update_current_pipeline(struct d3d12_command_list
             list->primitive_topology, list->strides, list->dsv_format, &vk_render_pass)))
         return false;
 
-    if (!vk_render_pass)
-        vk_render_pass = list->state->u.graphics.render_pass;
-
     /* The render pass cache ensures that we use the same Vulkan render pass
      * object for compatible render passes. */
     if (list->pso_render_pass != vk_render_pass)
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c
index c5f66b6..eb2626d 100644
--- a/libs/vkd3d/state.c
+++ b/libs/vkd3d/state.c
@@ -2761,8 +2761,6 @@ VkPipeline d3d12_pipeline_state_get_or_create_pipeline(struct d3d12_pipeline_sta
 
     assert(d3d12_pipeline_state_is_graphics(state));
 
-    *vk_render_pass = VK_NULL_HANDLE;
-
     memset(&pipeline_key, 0, sizeof(pipeline_key));
     pipeline_key.topology = topology;
 
@@ -2853,22 +2851,23 @@ VkPipeline d3d12_pipeline_state_get_or_create_pipeline(struct d3d12_pipeline_sta
     pipeline_desc.pColorBlendState = &blend_desc;
     pipeline_desc.pDynamicState = &dynamic_desc;
     pipeline_desc.layout = graphics->root_signature->vk_pipeline_layout;
-    pipeline_desc.renderPass = graphics->render_pass;
     pipeline_desc.subpass = 0;
     pipeline_desc.basePipelineHandle = VK_NULL_HANDLE;
     pipeline_desc.basePipelineIndex = -1;
 
     /* Create a render pass for pipelines with DXGI_FORMAT_UNKNOWN. */
-    if (!pipeline_desc.renderPass)
+    if (!(pipeline_desc.renderPass = graphics->render_pass))
     {
-        TRACE("Compiling %p with DSV format %#x.\n", state, dsv_format);
+        if (graphics->null_attachment_mask & (1u << graphics->rt_count))
+            TRACE("Compiling %p with DSV format %#x.\n", state, dsv_format);
+
         if (FAILED(hr = d3d12_graphics_pipeline_state_create_render_pass(graphics, device, dsv_format,
                 &pipeline_desc.renderPass)))
             return VK_NULL_HANDLE;
-
-        *vk_render_pass = pipeline_desc.renderPass;
     }
 
+    *vk_render_pass = pipeline_desc.renderPass;
+
     if ((vr = VK_CALL(vkCreateGraphicsPipelines(device->vk_device, device->vk_pipeline_cache,
             1, &pipeline_desc, NULL, &vk_pipeline))) < 0)
     {




More information about the wine-cvs mailing list