From 6c7c511a277d1413bab0d805756f7bf2782a0150 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 31 Aug 2017 21:56:58 +0300 Subject: [PATCH] d3dx9: Do not fail effect creation if a shader cannot be created. Signed-off-by: Paul Gofman Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- 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 864f0e5a30a..2cd0c22f646 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 66abd0a5f8d..bb26fe4e515 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);