=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d: Disable depth/ stencil tests for DXGI_FORMAT_UNKNOWN.

Alexandre Julliard julliard at winehq.org
Thu Nov 29 15:06:29 CST 2018


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Nov 28 18:51:18 2018 +0100

vkd3d: Disable depth/stencil tests for DXGI_FORMAT_UNKNOWN.

Needs more tests.

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/state.c |  7 ++++++-
 tests/d3d12.c      | 11 +++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c
index 6f7373e..66da08a 100644
--- a/libs/vkd3d/state.c
+++ b/libs/vkd3d/state.c
@@ -1948,8 +1948,13 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
         rt_count = ARRAY_SIZE(graphics->attachments) - 1;
     }
 
+    if (desc->DSVFormat == DXGI_FORMAT_UNKNOWN
+            && (desc->DepthStencilState.DepthEnable || desc->DepthStencilState.StencilEnable))
+        FIXME("DSV format is DXGI_FORMAT_UNKNOWN, disabling depth/stencil tests.\n");
+
     graphics->rt_idx = 0;
-    if (desc->DepthStencilState.DepthEnable || desc->DepthStencilState.StencilEnable)
+    if (desc->DSVFormat != DXGI_FORMAT_UNKNOWN
+            && (desc->DepthStencilState.DepthEnable || desc->DepthStencilState.StencilEnable))
     {
         const D3D12_DEPTH_STENCIL_DESC *ds_desc = &desc->DepthStencilState;
         VkImageLayout depth_layout;
diff --git a/tests/d3d12.c b/tests/d3d12.c
index d037245..42fb24c 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -2734,6 +2734,17 @@ static void test_create_graphics_pipeline_state(void)
             &IID_ID3D12PipelineState, (void **)&pipeline_state);
     ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
 
+    /* DSVFormat = DXGI_FORMAT_UNKNOWN */
+    memset(blend, 0, sizeof(*blend));
+    pso_desc.DSVFormat = DXGI_FORMAT_UNKNOWN;
+    pso_desc.DepthStencilState.DepthEnable = TRUE;
+    pso_desc.DepthStencilState.DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL;
+    pso_desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_LESS;
+    hr = ID3D12Device_CreateGraphicsPipelineState(device, &pso_desc,
+            &IID_ID3D12PipelineState, (void **)&pipeline_state);
+    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ID3D12PipelineState_Release(pipeline_state);
+
     refcount = ID3D12RootSignature_Release(root_signature);
     ok(!refcount, "ID3D12RootSignature has %u references left.\n", (unsigned int)refcount);
     refcount = ID3D12Device_Release(device);




More information about the wine-cvs mailing list