d3d11: Support NULL views in d3d10_device_ClearDepthStencilView().

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2016-04-17 19:07:55 +02:00 committed by Alexandre Julliard
parent d3f8efe546
commit 75ef613e82
2 changed files with 15 additions and 0 deletions

View File

@ -22,6 +22,8 @@
#include "wine/test.h" #include "wine/test.h"
#include <limits.h> #include <limits.h>
static BOOL d3d11_available;
struct vec2 struct vec2
{ {
float x, y; float x, y;
@ -478,6 +480,8 @@ static void test_feature_level(void)
return; return;
} }
d3d11_available = TRUE;
/* Device was created by D3D10CreateDevice. */ /* Device was created by D3D10CreateDevice. */
feature_level = ID3D11Device_GetFeatureLevel(device11); feature_level = ID3D11Device_GetFeatureLevel(device11);
ok(feature_level == D3D_FEATURE_LEVEL_10_0, "Got unexpected feature level %#x.\n", feature_level); 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); ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH | D3D10_CLEAR_STENCIL, 0.0f, 0);
check_texture_color(depth_texture, 0x00000000, 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); ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 1.0f, 0xff);
todo_wine check_texture_color(depth_texture, 0x00ffffff, 0); todo_wine check_texture_color(depth_texture, 0x00ffffff, 0);

View File

@ -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", TRACE("iface %p, depth_stencil_view %p, flags %#x, depth %.8e, stencil %u.\n",
iface, depth_stencil_view, flags, depth, stencil); iface, depth_stencil_view, flags, depth, stencil);
if (!view)
return;
wined3d_flags = wined3d_clear_flags_from_d3d11_clear_flags(flags); wined3d_flags = wined3d_clear_flags_from_d3d11_clear_flags(flags);
wined3d_mutex_lock(); wined3d_mutex_lock();