Roderick Colenbrander : wined3d: Don' t continue with CheckDeviceFormat when the texture format isn't around.

Alexandre Julliard julliard at winehq.org
Sat Mar 22 08:18:36 CDT 2008


Module: wine
Branch: master
Commit: 5d151c0ffc60627b1d54ae397a83ef1770491d1b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5d151c0ffc60627b1d54ae397a83ef1770491d1b

Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date:   Fri Mar 21 21:11:12 2008 +0000

wined3d: Don't continue with CheckDeviceFormat when the texture format isn't around.

It is legal to pass Usage=0 to CheckDeviceFormat and in both this case
and in the case a format isn't available UsageCaps would be 0 and a
format would be reported available.

---

 dlls/wined3d/directx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 103e8f1..1c7d9e3 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2311,6 +2311,9 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
                         return WINED3DERR_NOTAVAILABLE;
                     }
                 }
+            } else {
+                TRACE_(d3d_caps)("[FAILED] - Cube texture format not supported\n");
+                return WINED3DERR_NOTAVAILABLE;
             }
         } else {
             TRACE_(d3d_caps)("[FAILED] - No cube texture support\n");
@@ -2423,6 +2426,9 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
         } else if(CheckDepthStencilCapability(Adapter, AdapterFormat, CheckFormat)) {
             if(Usage & WINED3DUSAGE_DEPTHSTENCIL)
                 UsageCaps |= WINED3DUSAGE_DEPTHSTENCIL;
+        } else {
+            TRACE_(d3d_caps)("[FAILED] - Texture format not supported\n");
+            return WINED3DERR_NOTAVAILABLE;
         }
     } else if((RType == WINED3DRTYPE_VOLUME) || (RType == WINED3DRTYPE_VOLUMETEXTURE)) {
         /* Volume is to VolumeTexture what Surface is to Texture but its usage caps are not documented.




More information about the wine-cvs mailing list