[PATCH vkd3d 4/4] vkd3d: Always return render pass from d3d12_pipeline_state_get_or_create_pipeline().

Józef Kucia joseph.kucia at gmail.com
Tue May 21 03:57:22 CDT 2019


From: Józef Kucia <jkucia at codeweavers.com>

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 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 2fdd980ea5b3..a4659f701ebb 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 c5f66b699548..eb2626d1aef1 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)
     {
-- 
2.21.0




More information about the wine-devel mailing list