Commit b6062279 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3dx9: Return D3DERR_INVALIDCALL from ID3DXEffect::BeginPass() if the effect is not started.

parent e5041acf
......@@ -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;
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment