Stefan Dösinger : wined3d: RENDERTARGET | AUTOGENMIPMAP are compatible.

Alexandre Julliard julliard at winehq.org
Wed Jul 2 06:03:42 CDT 2008


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue Jul  1 10:10:28 2008 -0500

wined3d: RENDERTARGET | AUTOGENMIPMAP are compatible.

The test used D3DPOOL_MANAGED which is mutually exclusive with
RENDERTARGET usage, thus the call failed.

---

 dlls/d3d9/tests/texture.c |   12 ++++++------
 dlls/wined3d/device.c     |   14 +-------------
 2 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/dlls/d3d9/tests/texture.c b/dlls/d3d9/tests/texture.c
index 056d80f..bbc98a7 100644
--- a/dlls/d3d9/tests/texture.c
+++ b/dlls/d3d9/tests/texture.c
@@ -136,9 +136,9 @@ static void test_cube_texture_mipmap_gen(IDirect3DDevice9 *device_ptr)
     /* testing shows that autogenmipmap and rendertarget are mutually exclusive options */
     hr = IDirect3DDevice9_CreateCubeTexture(device_ptr, 64, 0, (D3DUSAGE_RENDERTARGET |
                                             D3DUSAGE_AUTOGENMIPMAP), D3DFMT_X8R8G8B8,
-                                            D3DPOOL_MANAGED, &texture_ptr, 0);
-    ok(hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_CreateTexture returned 0x%08x, expected 0x%08x\n",
-       hr, D3DERR_INVALIDCALL);
+                                            D3DPOOL_DEFAULT, &texture_ptr, 0);
+    ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture returned 0x%08x, expected 0x%08x\n",
+       hr, D3D_OK);
     if (texture_ptr) IDirect3DCubeTexture9_Release(texture_ptr);
     texture_ptr = NULL;
 
@@ -185,9 +185,9 @@ static void test_mipmap_gen(IDirect3DDevice9 *device)
     /* testing shows that autogenmipmap and rendertarget are mutually exclusive options */
     hr = IDirect3DDevice9_CreateTexture(device, 64, 64, 0, (D3DUSAGE_RENDERTARGET |
                                         D3DUSAGE_AUTOGENMIPMAP), D3DFMT_X8R8G8B8,
-                                        D3DPOOL_MANAGED, &texture, 0);
-    ok(hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_CreateTexture returned 0x%08x, expected 0x%08x\n",
-       hr, D3DERR_INVALIDCALL);
+                                        D3DPOOL_DEFAULT, &texture, 0);
+    ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture returned 0x%08x, expected 0x%08x\n",
+       hr, D3D_OK);
     if (texture) IDirect3DTexture9_Release(texture);
     texture = NULL;
 
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 45dc25c..416e828 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -772,13 +772,7 @@ static HRESULT  WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
     TRACE("Format %#x (%s), Pool %#x, ppTexture %p, pSharedHandle %p, parent %p\n",
             Format, debug_d3dformat(Format), Pool, ppTexture, pSharedHandle, parent);
 
-    if((Usage & (WINED3DUSAGE_AUTOGENMIPMAP | WINED3DUSAGE_RENDERTARGET)) ==
-                (WINED3DUSAGE_AUTOGENMIPMAP | WINED3DUSAGE_RENDERTARGET)) {
-        WARN("Application requests both D3DUSAGE_AUTOGENMIPMAP and D3DUSAGE_RENDERTARGET, which are mutually exclusive\n");
-        return WINED3DERR_INVALIDCALL;
-    }
-
-    /* TODO: It should only be possible to create textures for formats 
+    /* TODO: It should only be possible to create textures for formats
              that are reported as supported */
     if (WINED3DFMT_UNKNOWN >= Format) {
         WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN\n", This);
@@ -1060,12 +1054,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
     const GlPixelFormatDesc *glDesc;
     getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc);
 
-    if((Usage & (WINED3DUSAGE_AUTOGENMIPMAP | WINED3DUSAGE_RENDERTARGET)) ==
-                (WINED3DUSAGE_AUTOGENMIPMAP | WINED3DUSAGE_RENDERTARGET)) {
-        WARN("Application requests both D3DUSAGE_AUTOGENMIPMAP and D3DUSAGE_RENDERTARGET, which are mutually exclusive\n");
-        return WINED3DERR_INVALIDCALL;
-    }
-
     /* TODO: It should only be possible to create textures for formats 
              that are reported as supported */
     if (WINED3DFMT_UNKNOWN >= Format) {




More information about the wine-cvs mailing list