d3dx9: Allow passes argument to Begin() to be NULL.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2018-04-18 01:32:14 +02:00 committed by Alexandre Julliard
parent 7a50abd894
commit f956200775
2 changed files with 4 additions and 3 deletions

View File

@ -4202,7 +4202,7 @@ static HRESULT WINAPI ID3DXEffectImpl_Begin(ID3DXEffect *iface, UINT *passes, DW
TRACE("iface %p, passes %p, flags %#x.\n", iface, passes, flags);
if (passes && technique)
if (technique)
{
if (flags & ~(D3DXFX_DONOTSAVESTATE | D3DXFX_DONOTSAVESAMPLERSTATE | D3DXFX_DONOTSAVESHADERSTATE))
WARN("Invalid flags (%#x) specified.\n", flags);
@ -4234,7 +4234,8 @@ static HRESULT WINAPI ID3DXEffectImpl_Begin(ID3DXEffect *iface, UINT *passes, DW
ERR("StateBlock Capture failed, hr %#x.\n", hr);
}
*passes = technique->pass_count;
if (passes)
*passes = technique->pass_count;
effect->started = TRUE;
effect->begin_flags = flags;

View File

@ -3081,7 +3081,7 @@ static void test_effect_states(IDirect3DDevice9 *device)
ok(!bval, "Got result %u, expected 0.\n", bval);
hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(1), &test_mat);
hr = effect->lpVtbl->Begin(effect, &npasses, 0);
hr = effect->lpVtbl->Begin(effect, NULL, 0);
ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);