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

Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2017-08-31 21:56:58 +03:00 committed by Alexandre Julliard
parent c3677ecfc8
commit 6c7c511a27
2 changed files with 6 additions and 9 deletions

View File

@ -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:

View File

@ -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);