Alistair Leslie-Hughes : d3d11: Support NULL RenderTargetView pointer in ClearRenderTargetView.

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


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

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

d3d11: Support NULL RenderTargetView pointer in ClearRenderTargetView.

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 | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index c59e5a9..4f24c48 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -967,6 +967,9 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearRenderTargetView(ID3D
     TRACE("iface %p, render_target_view %p, color_rgba %s.\n",
             iface, render_target_view, debug_float4(color_rgba));
 
+    if (!view)
+        return;
+
     wined3d_mutex_lock();
     if (FAILED(hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, view->wined3d_view, NULL,
             WINED3DCLEAR_TARGET, &color, 0.0f, 0)))
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index a844c11..ee7103d 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -5824,6 +5824,7 @@ static void test_clear_render_target_view(void)
 {
     static const DWORD expected_color = 0xbf4c7f19, expected_srgb_color = 0xbf95bc59;
     static const float color[] = {0.1f, 0.5f, 0.3f, 0.75f};
+    static const float green[] = {0.0f, 1.0f, 0.0f, 0.5f};
 
     ID3D11Texture2D *texture, *srgb_texture;
     struct d3d11_test_context test_context;
@@ -5870,6 +5871,9 @@ static void test_clear_render_target_view(void)
     ID3D11DeviceContext_ClearRenderTargetView(context, rtv, color);
     check_texture_color(texture, expected_color, 1);
 
+    ID3D11DeviceContext_ClearRenderTargetView(context, NULL, green);
+    check_texture_color(texture, expected_color, 1);
+
     ID3D11DeviceContext_ClearRenderTargetView(context, srgb_rtv, color);
     check_texture_color(srgb_texture, expected_srgb_color, 1);
 




More information about the wine-cvs mailing list