Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/d3dx9_36/effect.c | 6 ++++++ dlls/d3dx9_36/tests/effect.c | 6 ++++++ 2 files changed, 12 insertions(+)
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 22afa649db3..e623c10035a 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -4001,6 +4001,12 @@ static HRESULT WINAPI d3dx_effect_BeginPass(ID3DXEffect *iface, UINT pass)
TRACE("iface %p, pass %u\n", effect, pass);
+ if (!effect->started) + { + WARN("Effect is not started, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } + if (technique && pass < technique->pass_count && !effect->active_pass) { HRESULT hr; diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index ea90299f936..d4efc1101d9 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -3081,6 +3081,12 @@ static void test_effect_states(IDirect3DDevice9 *device) NULL, NULL, 0, NULL, &effect, NULL); ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
+ hr = effect->lpVtbl->End(effect); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->BeginPass(effect, 0); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr); + /* State affected in passes saved/restored even if no pass was performed. States not present in passes are not saved & restored */