vkd3d: Always return render pass from d3d12_pipeline_state_get_or_create_pipeline().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2019-05-21 10:57:22 +02:00 committed by Alexandre Julliard
parent 725c4eb809
commit 3e99853297
2 changed files with 6 additions and 10 deletions

View File

@ -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)

View File

@ -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)
{