Zebediah Figura : d3d8: Forbid applying a stateblock while recording.
Module: wine Branch: master Commit: d63e1bc9ab5aa60a952ad7b06101e37c48f4cde7 URL: https://source.winehq.org/git/wine.git/?a=commit;h=d63e1bc9ab5aa60a952ad7b06... Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Apr 3 21:18:42 2019 -0500 d3d8: Forbid applying a stateblock while recording. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d8/device.c | 6 ++++++ dlls/d3d8/tests/device.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 5016ac4..381588f 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1924,6 +1924,12 @@ static HRESULT WINAPI d3d8_device_ApplyStateBlock(IDirect3DDevice8 *iface, DWORD return D3D_OK; wined3d_mutex_lock(); + if (device->recording) + { + wined3d_mutex_unlock(); + WARN("Trying to apply stateblock while recording, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } stateblock = d3d8_get_object(&device->handle_table, token - 1, D3D8_HANDLE_SB); if (!stateblock) { diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index f0acd9f..fee73de 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -7277,7 +7277,7 @@ static void test_begin_end_state_block(void) ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice8_ApplyStateBlock(device, stateblock); - todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice8_CaptureStateBlock(device, stateblock); todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); @@ -7297,7 +7297,7 @@ static void test_begin_end_state_block(void) hr = IDirect3DDevice8_GetRenderState(device, D3DRS_LIGHTING, &value); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - todo_wine ok(value == TRUE, "Got unexpected value %#x.\n", value); + ok(value == TRUE, "Got unexpected value %#x.\n", value); refcount = IDirect3DDevice8_Release(device); ok(!refcount, "Device has %u references left.\n", refcount);
participants (1)
-
Alexandre Julliard