From c835b00a361eaa22c27621c43c40816b1358def8 Mon Sep 17 00:00:00 2001 From: "H. Verbeet" Date: Thu, 19 Jun 2008 18:24:23 +0200 Subject: [PATCH] wined3d: Handle depth formats like any other format in CheckDeviceFormat. Currently depth formats are handled separately from the other formats, but depth formats can support things like filtering as well, so we should check those caps as well. --- dlls/wined3d/directx.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 61ab9d1261d..ace619964e8 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2212,7 +2212,9 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DFORMAT CheckFormat) TRACE_(d3d_caps)("[OK]\n"); return TRUE; - /* Depth/stencil is handled using checkDepthStencilCapability, return FALSE here */ + /***** + * Supported: Depth/Stencil formats + */ case WINED3DFMT_D16_LOCKABLE: case WINED3DFMT_D16: case WINED3DFMT_D15S1: @@ -2222,7 +2224,7 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DFORMAT CheckFormat) case WINED3DFMT_D24FS8: case WINED3DFMT_D32: case WINED3DFMT_D32F_LOCKABLE: - return FALSE; + return TRUE; /***** * Not supported everywhere(depends on GL_ATI_envmap_bumpmap or @@ -2669,9 +2671,15 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt return WINED3DERR_NOTAVAILABLE; } } - } else if(CheckDepthStencilCapability(Adapter, AdapterFormat, CheckFormat)) { - if(Usage & WINED3DUSAGE_DEPTHSTENCIL) - UsageCaps |= WINED3DUSAGE_DEPTHSTENCIL; + + if(Usage & WINED3DUSAGE_DEPTHSTENCIL) { + if(CheckDepthStencilCapability(Adapter, AdapterFormat, CheckFormat)) { + UsageCaps |= WINED3DUSAGE_DEPTHSTENCIL; + } else { + TRACE_(d3d_caps)("[FAILED] - No depth stencil support\n"); + return WINED3DERR_NOTAVAILABLE; + } + } } else { TRACE_(d3d_caps)("[FAILED] - Texture format not supported\n"); return WINED3DERR_NOTAVAILABLE;