[PATCH 2/4] d3d9: Handle stateblocks in d3d9_device_SetLight().

Zebediah Figura z.figura12 at gmail.com
Wed Nov 13 21:47:48 CST 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/d3d9/device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index df1996bf850..4c865f30568 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -2191,7 +2191,9 @@ static HRESULT WINAPI d3d9_device_SetLight(IDirect3DDevice9Ex *iface, DWORD inde
 
     /* Note: D3DLIGHT9 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;
-- 
2.23.0




More information about the wine-devel mailing list