Alistair Leslie-Hughes : d3d11: Support NULL views in d3d10_device_ClearDepthStencilView().
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Apr 18 10:37:02 CDT 2016
Module: wine
Branch: master
Commit: 75ef613e82afdc4a11b0318efe5769b4865a9792
URL: http://source.winehq.org/git/wine.git/?a=commit;h=75ef613e82afdc4a11b0318efe5769b4865a9792
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Sun Apr 17 19:07:55 2016 +0200
d3d11: Support NULL views in d3d10_device_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/d3d10core/tests/device.c | 12 ++++++++++++
dlls/d3d11/device.c | 3 +++
2 files changed, 15 insertions(+)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index 6978c26..ea9845c 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -22,6 +22,8 @@
#include "wine/test.h"
#include <limits.h>
+static BOOL d3d11_available;
+
struct vec2
{
float x, y;
@@ -478,6 +480,8 @@ static void test_feature_level(void)
return;
}
+ d3d11_available = TRUE;
+
/* Device was created by D3D10CreateDevice. */
feature_level = ID3D11Device_GetFeatureLevel(device11);
ok(feature_level == D3D_FEATURE_LEVEL_10_0, "Got unexpected feature level %#x.\n", feature_level);
@@ -6222,6 +6226,14 @@ static void test_clear_depth_stencil_view(void)
ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH | D3D10_CLEAR_STENCIL, 0.0f, 0);
check_texture_color(depth_texture, 0x00000000, 0);
+ if (d3d11_available)
+ {
+ ID3D10Device_ClearDepthStencilView(device, NULL, D3D10_CLEAR_DEPTH | D3D10_CLEAR_STENCIL, 1.0f, 0xff);
+ check_texture_color(depth_texture, 0x00000000, 0);
+ }
+ else
+ win_skip("D3D11 is not available, skipping test.\n");
+
ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 1.0f, 0xff);
todo_wine check_texture_color(depth_texture, 0x00ffffff, 0);
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 9144438..4a83882 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -3463,6 +3463,9 @@ static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device1 *
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();
More information about the wine-cvs
mailing list