Paul Gofman : d3dx9: Do not fail effect creation if a shader cannot be created.

Alexandre Julliard julliard at winehq.org
Fri Sep 1 12:23:21 CDT 2017


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

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Thu Aug 31 21:56:58 2017 +0300

d3dx9: Do not fail effect creation if a shader cannot be created.

Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dx9_36/effect.c       |  4 ++--
 dlls/d3dx9_36/tests/effect.c | 11 ++++-------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index 864f0e5..2cd0c22 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -5938,7 +5938,7 @@ static HRESULT d3dx9_create_object(struct d3dx9_base_effect *base, struct d3dx_o
                     (IDirect3DVertexShader9 **)param->data)))
             {
                 WARN("Failed to create vertex shader.\n");
-                return hr;
+                return D3D_OK;
             }
             break;
         case D3DXPT_PIXELSHADER:
@@ -5946,7 +5946,7 @@ static HRESULT d3dx9_create_object(struct d3dx9_base_effect *base, struct d3dx_o
                     (IDirect3DPixelShader9 **)param->data)))
             {
                 WARN("Failed to create pixel shader.\n");
-                return hr;
+                return D3D_OK;
             }
             break;
         default:
diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c
index 66abd0a..bb26fe4 100644
--- a/dlls/d3dx9_36/tests/effect.c
+++ b/dlls/d3dx9_36/tests/effect.c
@@ -7087,17 +7087,13 @@ static void test_effect_unsupported_shader(void)
 
     hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob),
             NULL, NULL, NULL, 0, NULL, &effect, NULL);
-    todo_wine
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    if (FAILED(hr))
-    {
-        skip("Failed to create effect, skipping test.\n");
-        goto cleanup;
-    }
 
     hr = effect->lpVtbl->ValidateTechnique(effect, "missing_technique");
+    todo_wine
     ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
     hr = effect->lpVtbl->ValidateTechnique(effect, "tech0");
+    todo_wine
     ok(hr == E_FAIL, "Got result %#x.\n", hr);
 
     hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
@@ -7105,6 +7101,7 @@ static void test_effect_unsupported_shader(void)
     effect->lpVtbl->SetInt(effect, "i", 1);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
     hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
+    todo_wine
     ok(hr == E_FAIL, "Got result %#x.\n", hr);
     effect->lpVtbl->SetInt(effect, "i", 0);
     hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
@@ -7158,7 +7155,7 @@ static void test_effect_unsupported_shader(void)
     ok(!vshader, "Got non NULL vshader.\n");
 
     effect->lpVtbl->Release(effect);
-cleanup:
+
     refcount = IDirect3DDevice9_Release(device);
     ok(!refcount, "Device has %u references left.\n", refcount);
     IDirect3D9_Release(d3d);




More information about the wine-cvs mailing list