From 0117ad6039cd7b02c1b2e462e7f1e102dc0ea29a Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 13 Nov 2019 21:47:49 -0600 Subject: [PATCH] d3d8: Handle stateblocks in d3d8_device_SetLight(). Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d8/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 00539fdd07f..a7a08b3f809 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1750,7 +1750,9 @@ static HRESULT WINAPI d3d8_device_SetLight(IDirect3DDevice8 *iface, DWORD index, /* Note: D3DLIGHT8 is compatible with struct wined3d_light. */ wined3d_mutex_lock(); - hr = wined3d_device_set_light(device->wined3d_device, index, (const struct wined3d_light *)light); + hr = wined3d_stateblock_set_light(device->update_state, index, (const struct wined3d_light *)light); + if (SUCCEEDED(hr) && !device->recording) + hr = wined3d_device_set_light(device->wined3d_device, index, (const struct wined3d_light *)light); wined3d_mutex_unlock(); return hr;