Commit f9562007 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

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

parent 7a50abd8
......@@ -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;
......
......@@ -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);
......
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