Alistair Leslie-Hughes : d3d11: Support NULL views in d3d10_device_ClearRenderTargetView().
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Apr 18 10:37:02 CDT 2016
Module: wine
Branch: master
Commit: 232834a572b3f3d23926c7266e719c3b31ac91b2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=232834a572b3f3d23926c7266e719c3b31ac91b2
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Sun Apr 17 19:07:56 2016 +0200
d3d11: Support NULL views in d3d10_device_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/d3d10core/tests/device.c | 9 +++++++++
dlls/d3d11/device.c | 3 +++
2 files changed, 12 insertions(+)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index ea9845c..106e4cc 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -6079,6 +6079,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};
struct d3d10core_test_context test_context;
ID3D10Texture2D *texture, *srgb_texture;
@@ -6123,6 +6124,14 @@ static void test_clear_render_target_view(void)
ID3D10Device_ClearRenderTargetView(device, rtv, color);
check_texture_color(texture, expected_color, 1);
+ if (d3d11_available)
+ {
+ ID3D10Device_ClearRenderTargetView(device, NULL, green);
+ check_texture_color(texture, expected_color, 1);
+ }
+ else
+ win_skip("D3D11 is not available, skipping test.\n");
+
ID3D10Device_ClearRenderTargetView(device, srgb_rtv, color);
check_texture_color(srgb_texture, expected_srgb_color, 1);
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 4a83882..fd88ac1 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -3445,6 +3445,9 @@ static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device1 *
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)))
More information about the wine-cvs
mailing list