[PATCH] WineD3D: RENDERTARGET | AUTOGENMIPMAP are compatible=0A=
Stefan Doesinger
stefan at codeweavers.com
Tue Jul 1 10:10:28 CDT 2008
=0A=
The test used D3DPOOL_MANAGED which is mutually exclusive with =
RENDERTARGET usage, thus the call failed. The=0A=
RENDERTARGET | AUTOGENMIPMAP=0A=
---=0A=
dlls/d3d9/tests/texture.c | 12 ++++++------=0A=
dlls/wined3d/device.c | 14 +-------------=0A=
2 files changed, 7 insertions(+), 19 deletions(-)=0A=
=0A=
diff --git a/dlls/d3d9/tests/texture.c b/dlls/d3d9/tests/texture.c=0A=
index 056d80f..bbc98a7 100644=0A=
--- a/dlls/d3d9/tests/texture.c=0A=
+++ b/dlls/d3d9/tests/texture.c=0A=
@@ -136,9 +136,9 @@ static void =
test_cube_texture_mipmap_gen(IDirect3DDevice9 *device_ptr)=0A=
/* testing shows that autogenmipmap and rendertarget are mutually =
exclusive options */=0A=
hr =3D IDirect3DDevice9_CreateCubeTexture(device_ptr, 64, 0, =
(D3DUSAGE_RENDERTARGET |=0A=
D3DUSAGE_AUTOGENMIPMAP), =
D3DFMT_X8R8G8B8,=0A=
- D3DPOOL_MANAGED, =
&texture_ptr, 0);=0A=
- ok(hr =3D=3D D3DERR_INVALIDCALL, "IDirect3DDevice9_CreateTexture =
returned 0x%08x, expected 0x%08x\n",=0A=
- hr, D3DERR_INVALIDCALL);=0A=
+ D3DPOOL_DEFAULT, =
&texture_ptr, 0);=0A=
+ ok(hr =3D=3D D3D_OK, "IDirect3DDevice9_CreateTexture returned =
0x%08x, expected 0x%08x\n",=0A=
+ hr, D3D_OK);=0A=
if (texture_ptr) IDirect3DCubeTexture9_Release(texture_ptr);=0A=
texture_ptr =3D NULL;=0A=
=0A=
@@ -185,9 +185,9 @@ static void test_mipmap_gen(IDirect3DDevice9 *device)=0A=
/* testing shows that autogenmipmap and rendertarget are mutually =
exclusive options */=0A=
hr =3D IDirect3DDevice9_CreateTexture(device, 64, 64, 0, =
(D3DUSAGE_RENDERTARGET |=0A=
D3DUSAGE_AUTOGENMIPMAP), =
D3DFMT_X8R8G8B8,=0A=
- D3DPOOL_MANAGED, &texture, 0);=0A=
- ok(hr =3D=3D D3DERR_INVALIDCALL, "IDirect3DDevice9_CreateTexture =
returned 0x%08x, expected 0x%08x\n",=0A=
- hr, D3DERR_INVALIDCALL);=0A=
+ D3DPOOL_DEFAULT, &texture, 0);=0A=
+ ok(hr =3D=3D D3D_OK, "IDirect3DDevice9_CreateTexture returned =
0x%08x, expected 0x%08x\n",=0A=
+ hr, D3D_OK);=0A=
if (texture) IDirect3DTexture9_Release(texture);=0A=
texture =3D NULL;=0A=
=0A=
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c=0A=
index 4ba22b6..59bf06f 100644=0A=
--- a/dlls/wined3d/device.c=0A=
+++ b/dlls/wined3d/device.c=0A=
@@ -772,13 +772,7 @@ static HRESULT WINAPI =
IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U=0A=
TRACE("Format %#x (%s), Pool %#x, ppTexture %p, pSharedHandle %p, =
parent %p\n",=0A=
Format, debug_d3dformat(Format), Pool, ppTexture, =
pSharedHandle, parent);=0A=
=0A=
- if((Usage & (WINED3DUSAGE_AUTOGENMIPMAP | =
WINED3DUSAGE_RENDERTARGET)) =3D=3D=0A=
- (WINED3DUSAGE_AUTOGENMIPMAP | =
WINED3DUSAGE_RENDERTARGET)) {=0A=
- WARN("Application requests both D3DUSAGE_AUTOGENMIPMAP and =
D3DUSAGE_RENDERTARGET, which are mutually exclusive\n");=0A=
- return WINED3DERR_INVALIDCALL;=0A=
- }=0A=
-=0A=
- /* TODO: It should only be possible to create textures for formats =0A=
+ /* TODO: It should only be possible to create textures for formats=0A=
that are reported as supported */=0A=
if (WINED3DFMT_UNKNOWN >=3D Format) {=0A=
WARN("(%p) : Texture cannot be created with a format of =
WINED3DFMT_UNKNOWN\n", This);=0A=
@@ -1060,12 +1054,6 @@ static HRESULT WINAPI =
IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface=0A=
const GlPixelFormatDesc *glDesc;=0A=
getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc);=0A=
=0A=
- if((Usage & (WINED3DUSAGE_AUTOGENMIPMAP | =
WINED3DUSAGE_RENDERTARGET)) =3D=3D=0A=
- (WINED3DUSAGE_AUTOGENMIPMAP | =
WINED3DUSAGE_RENDERTARGET)) {=0A=
- WARN("Application requests both D3DUSAGE_AUTOGENMIPMAP and =
D3DUSAGE_RENDERTARGET, which are mutually exclusive\n");=0A=
- return WINED3DERR_INVALIDCALL;=0A=
- }=0A=
-=0A=
/* TODO: It should only be possible to create textures for formats =0A=
that are reported as supported */=0A=
if (WINED3DFMT_UNKNOWN >=3D Format) {=0A=
-- =0A=
1.5.4.5=0A=
=0A=
------=_NextPart_000_000B_01C8DB87.27B01C20--
More information about the wine-patches
mailing list