[PATCH] d3d11: Support NULL DepthStecilView pointer in ClearDepthStencilView

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Sun Apr 10 05:15:33 CDT 2016


---
 dlls/d3d11/device.c      | 3 +++
 dlls/d3d11/tests/d3d11.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 4d93d49..cb9c9bd 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -999,6 +999,9 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearDepthStencilView(ID3D
     TRACE("iface %p, depth_stencil_view %p, flags %#x, depth %.8e, stencil %u.\n",
             iface, depth_stencil_view, flags, depth, stencil);
 
+    if (!view)
+        return;
+
     wined3d_flags = wined3d_clear_flags_from_d3d11_clear_flags(flags);
 
     wined3d_mutex_lock();
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 8ba6a77..a844c11 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -5955,6 +5955,9 @@ static void test_clear_depth_stencil_view(void)
     ID3D11DeviceContext_ClearDepthStencilView(context, dsv, D3D11_CLEAR_DEPTH, 0.25f, 0);
     check_texture_float(depth_texture, 0.25f, 0);
 
+    ID3D11DeviceContext_ClearDepthStencilView(context, NULL, D3D11_CLEAR_DEPTH, 1.0f, 0);
+    check_texture_float(depth_texture, 0.25f, 0);
+
     ID3D11Texture2D_Release(depth_texture);
     ID3D11DepthStencilView_Release(dsv);
 
-- 
2.8.0.rc3




More information about the wine-patches mailing list