vkd3d: Disable unncessary depth tests.

Allows us to create the render pass while creating the pipeline state.

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-17 10:39:12 +02:00
committed by Alexandre Julliard
parent 26e6957875
commit f629cdecc1
2 changed files with 43 additions and 3 deletions

View File

@@ -2228,8 +2228,17 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
graphics->rtv_formats[i] = VK_FORMAT_UNDEFINED;
graphics->rt_count = rt_count;
ds_desc_from_d3d12(&graphics->ds_desc, &desc->DepthStencilState);
if (desc->DSVFormat == DXGI_FORMAT_UNKNOWN
&& graphics->ds_desc.depthTestEnable && !graphics->ds_desc.depthWriteEnable
&& graphics->ds_desc.depthCompareOp == VK_COMPARE_OP_ALWAYS && !graphics->ds_desc.stencilTestEnable)
{
TRACE("Disabling depth test.\n");
graphics->ds_desc.depthTestEnable = VK_FALSE;
}
graphics->dsv_format = VK_FORMAT_UNDEFINED;
if (desc->DepthStencilState.DepthEnable || desc->DepthStencilState.StencilEnable)
if (graphics->ds_desc.depthTestEnable || graphics->ds_desc.stencilTestEnable)
{
if (desc->DSVFormat == DXGI_FORMAT_UNKNOWN)
{
@@ -2545,8 +2554,6 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
graphics->ms_desc.alphaToCoverageEnable = desc->BlendState.AlphaToCoverageEnable;
graphics->ms_desc.alphaToOneEnable = VK_FALSE;
ds_desc_from_d3d12(&graphics->ds_desc, &desc->DepthStencilState);
if (graphics->dsv_format == VK_FORMAT_UNDEFINED)
graphics->render_pass = VK_NULL_HANDLE;
else if (FAILED(hr = d3d12_graphics_pipeline_state_create_render_pass(graphics,