Stefan Dösinger : wined3d: Refuse to create a mipmapped conditional np2 texture.

Alexandre Julliard julliard at winehq.org
Thu Nov 29 10:31:22 CST 2007


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed Nov 28 20:21:00 2007 +0100

wined3d: Refuse to create a mipmapped conditional np2 texture.

---

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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d4d6e56..33c7628 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -876,6 +876,17 @@ static HRESULT  WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
         pow2Width = pow2Height = 1;
         while (pow2Width < Width) pow2Width <<= 1;
         while (pow2Height < Height) pow2Height <<= 1;
+
+        if(pow2Width != Width || pow2Height != Height) {
+            if(Levels > 1) {
+                WARN("Attempted to create a mipmapped np2 texture without unconditional np2 support\n");
+                HeapFree(GetProcessHeap(), 0, object);
+                *ppTexture = NULL;
+                return WINED3DERR_INVALIDCALL;
+            } else {
+                Levels = 1;
+            }
+        }
     }
 
     /** FIXME: add support for real non-power-two if it's provided by the video card **/




More information about the wine-cvs mailing list