diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 6978c263649..ea9845c3d71 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -22,6 +22,8 @@ #include "wine/test.h" #include +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 91444384b0d..4a83882a541 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();