Stefan Dösinger : d3d8: Only test pixel shaders for refcounting if they are supported.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 30 08:55:37 CDT 2007


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue Jul 24 15:33:37 2007 +0200

d3d8: Only test pixel shaders for refcounting if they are supported.

---

 dlls/d3d8/tests/device.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 84b5f29..bc9c804 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -292,6 +292,7 @@ static void test_refcount(void)
     IDirect3DSurface8           *pBackBuffer        = NULL;
     DWORD                       dStateBlock         = -1;
     IDirect3DSwapChain8         *pSwapChain         = NULL;
+    D3DCAPS8                    caps;
 
     D3DPRESENT_PARAMETERS        d3dpp;
     D3DDISPLAYMODE               d3ddm;
@@ -326,6 +327,7 @@ static void test_refcount(void)
         trace("could not create device, IDirect3D8_CreateDevice returned %#x\n", hr);
         goto cleanup;
     }
+    IDirect3DDevice8_GetDeviceCaps(pDevice, &caps);
 
     refcount = get_refcount( (IUnknown *)pDevice );
     ok(refcount == 1, "Invalid device RefCount %d\n", refcount);
@@ -435,8 +437,11 @@ static void test_refcount(void)
     /* Shaders */
     hr = IDirect3DDevice8_CreateVertexShader( pDevice, decl, simple_vs, &dVertexShader, 0 );
     CHECK_CALL( hr, "CreateVertexShader", pDevice, refcount );
-    hr = IDirect3DDevice8_CreatePixelShader( pDevice, simple_ps, &dPixelShader );
-    CHECK_CALL( hr, "CreatePixelShader", pDevice, refcount );
+    if (caps.PixelShaderVersion >= D3DPS_VERSION(1, 0))
+    {
+        hr = IDirect3DDevice8_CreatePixelShader( pDevice, simple_ps, &dPixelShader );
+        CHECK_CALL( hr, "CreatePixelShader", pDevice, refcount );
+    }
     /* Textures */
     hr = IDirect3DDevice8_CreateTexture( pDevice, 32, 32, 3, 0, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &pTexture );
     CHECK_CALL( hr, "CreateTexture", pDevice, ++refcount );




More information about the wine-cvs mailing list