Commit a2c29deb authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3d8: Forbid creating a stateblock while recording.

parent 2e01e46a
...@@ -2027,6 +2027,12 @@ static HRESULT WINAPI d3d8_device_CreateStateBlock(IDirect3DDevice8 *iface, ...@@ -2027,6 +2027,12 @@ static HRESULT WINAPI d3d8_device_CreateStateBlock(IDirect3DDevice8 *iface,
} }
wined3d_mutex_lock(); wined3d_mutex_lock();
if (device->recording)
{
wined3d_mutex_unlock();
WARN("Trying to create a stateblock while recording, returning D3DERR_INVALIDCALL.\n");
return D3DERR_INVALIDCALL;
}
hr = wined3d_stateblock_create(device->wined3d_device, (enum wined3d_stateblock_type)type, &stateblock); hr = wined3d_stateblock_create(device->wined3d_device, (enum wined3d_stateblock_type)type, &stateblock);
if (FAILED(hr)) if (FAILED(hr))
{ {
......
...@@ -7283,7 +7283,7 @@ static void test_begin_end_state_block(void) ...@@ -7283,7 +7283,7 @@ static void test_begin_end_state_block(void)
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice8_CreateStateBlock(device, D3DSBT_ALL, &stateblock2); hr = IDirect3DDevice8_CreateStateBlock(device, D3DSBT_ALL, &stateblock2);
todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice8_GetRenderState(device, D3DRS_LIGHTING, &value); hr = IDirect3DDevice8_GetRenderState(device, D3DRS_LIGHTING, &value);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
......
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