[PATCH 2/3] d3dx9: Do not fail effect creation if a shader cannot be created.
Paul Gofman
gofmanp at gmail.com
Thu Aug 31 12:40:42 CDT 2017
Signed-off-by: Paul Gofman <gofmanp at gmail.com>
---
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 864f0e5a30..2cd0c22f64 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 3e8df11d24..072ee61447 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);
--
2.13.5
More information about the wine-patches
mailing list