Alistair Leslie-Hughes : d3d11: Support NULL DepthStecilView pointer in ClearDepthStencilView.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Apr 12 10:20:48 CDT 2016


Module: wine
Branch: master
Commit: da5cc1ec928873a4e91e969130e4c671e4c3e77d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=da5cc1ec928873a4e91e969130e4c671e4c3e77d

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Tue Apr 12 10:22:17 2016 +0000

d3d11: Support NULL DepthStecilView pointer in ClearDepthStencilView.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 569d397..c59e5a9 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);
 




More information about the wine-cvs mailing list