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

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-02-07 17:24:32 -06:00 committed by Alexandre Julliard
parent e5041acfa2
commit b6062279b8
2 changed files with 12 additions and 0 deletions

View File

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

View File

@ -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 */