=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3dx9/tests: Add more tests for D3DXFilterTexture.

Alexandre Julliard julliard at winehq.org
Mon May 21 15:31:07 CDT 2012


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

Author: Józef Kucia <joseph.kucia at gmail.com>
Date:   Fri May 18 15:50:13 2012 +0200

d3dx9/tests: Add more tests for D3DXFilterTexture.

---

 dlls/d3dx9_36/tests/texture.c |   47 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c
index a595671..ff7c811 100644
--- a/dlls/d3dx9_36/tests/texture.c
+++ b/dlls/d3dx9_36/tests/texture.c
@@ -797,6 +797,26 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device)
     else
         skip("Failed to create texture\n");
 
+    hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex, NULL);
+    if (SUCCEEDED(hr))
+    {
+        hr = D3DXFilterTexture((IDirect3DBaseTexture9*) tex, NULL, 0, D3DX_FILTER_POINT);
+        ok(hr == D3D_OK, "D3DXFilterTexture returned %#x, expected %#x\n", hr, D3D_OK);
+        IDirect3DTexture9_Release(tex);
+    }
+    else
+        skip("Failed to create texture\n");
+
+    hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 0, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex, NULL);
+    if (SUCCEEDED(hr))
+    {
+        hr = D3DXFilterTexture((IDirect3DBaseTexture9*) tex, NULL, 0, D3DX_FILTER_POINT);
+        ok(hr == D3D_OK, "D3DXFilterTexture returned %#x, expected %#x\n", hr, D3D_OK);
+        IDirect3DTexture9_Release(tex);
+    }
+    else
+        skip("Failed to create texture\n");
+
     /* Cube texture test */
     hr = IDirect3DDevice9_CreateCubeTexture(device, 256, 5, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &cubetex, NULL);
 
@@ -814,6 +834,33 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device)
     }
     else
         skip("Failed to create texture\n");
+
+    /* Test textures with D3DUSAGE_AUTOGENMIPMAP usage */
+    if (!is_autogenmipmap_supported(device, D3DRTYPE_TEXTURE))
+    {
+        skip("No D3DUSAGE_AUTOGENMIPMAP supported for textures\n");
+        return;
+    }
+
+    hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 0, D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex, NULL);
+    if (SUCCEEDED(hr))
+    {
+        hr = D3DXFilterTexture((IDirect3DBaseTexture9*) tex, NULL, 0, D3DX_FILTER_NONE);
+        ok(hr == D3D_OK, "D3dXFilteTexture returned %#x, expected %#x\n", hr, D3D_OK);
+        IDirect3DTexture9_Release(tex);
+    }
+    else
+        skip("Failed to create texture\n");
+
+    hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 1, D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex, NULL);
+    if (SUCCEEDED(hr))
+    {
+        hr = D3DXFilterTexture((IDirect3DBaseTexture9*) tex, NULL, 0, D3DX_FILTER_NONE);
+        ok(hr == D3D_OK, "D3dXFilteTexture returned %#x, expected %#x\n", hr, D3D_OK);
+        IDirect3DTexture9_Release(tex);
+    }
+    else
+        skip("Failed to create texture\n");
 }
 
 static BOOL color_match(const DWORD *value, const DWORD *expected)




More information about the wine-cvs mailing list