From db9e40c742908413e76c9cdc3f94ea3957b1cfcc Mon Sep 17 00:00:00 2001 From: winesync Date: Tue, 12 Sep 2023 10:37:08 -0700 Subject: [PATCH] [WINESYNC] d3d9: Handle stateblocks in d3d9_device_SetRenderState(). Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard wine commit id c9ee1b0b88043c390634eb266126854afaec6c0a by Zebediah Figura --- dll/directx/wine/d3d9/device.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dll/directx/wine/d3d9/device.c b/dll/directx/wine/d3d9/device.c index 977cf43adacfc..9bfd810f2bae1 100644 --- a/dll/directx/wine/d3d9/device.c +++ b/dll/directx/wine/d3d9/device.c @@ -2272,14 +2272,18 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState(IDirect3DDevi { wined3d_color_from_d3dcolor(&factor, value); wined3d_mutex_lock(); - wined3d_device_set_blend_state(device->wined3d_device, NULL, &factor); + wined3d_stateblock_set_blend_factor(device->update_state, &factor); + if (!device->recording) + wined3d_device_set_blend_state(device->wined3d_device, NULL, &factor); wined3d_mutex_unlock(); return D3D_OK; } wined3d_mutex_lock(); - wined3d_device_set_render_state(device->wined3d_device, state, value); + wined3d_stateblock_set_render_state(device->update_state, state, value); + if (!device->recording) + wined3d_device_set_render_state(device->wined3d_device, state, value); wined3d_mutex_unlock(); return D3D_OK;