Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/tests/device.c | 57 +++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 15 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index c5ec9aa736..f0acd9ff81 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -7231,10 +7231,11 @@ cleanup:
static void test_begin_end_state_block(void) { + DWORD stateblock, stateblock2; IDirect3DDevice8 *device; - DWORD stateblock; IDirect3D8 *d3d; ULONG refcount; + DWORD value; HWND window; HRESULT hr;
@@ -7249,28 +7250,54 @@ static void test_begin_end_state_block(void) return; }
- /* Should succeed. */ hr = IDirect3DDevice8_BeginStateBlock(device); - ok(SUCCEEDED(hr), "Failed to begin stateblock, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- /* Calling BeginStateBlock() while recording should return - * D3DERR_INVALIDCALL. */ - hr = IDirect3DDevice8_BeginStateBlock(device); - ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- /* Should succeed. */ stateblock = 0xdeadbeef; hr = IDirect3DDevice8_EndStateBlock(device, &stateblock); - ok(SUCCEEDED(hr), "Failed to end stateblock, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); ok(!!stateblock && stateblock != 0xdeadbeef, "Got unexpected stateblock %#x.\n", stateblock); - IDirect3DDevice8_DeleteStateBlock(device, stateblock);
- /* Calling EndStateBlock() while not recording should return - * D3DERR_INVALIDCALL. stateblock should not be touched. */ - stateblock = 0xdeadbeef; - hr = IDirect3DDevice8_EndStateBlock(device, &stateblock); + stateblock2 = 0xdeadbeef; + hr = IDirect3DDevice8_EndStateBlock(device, &stateblock2); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - ok(stateblock == 0xdeadbeef, "Got unexpected stateblock %#x.\n", stateblock); + ok(stateblock2 == 0xdeadbeef, "Got unexpected stateblock %#x.\n", stateblock2); + + hr = IDirect3DDevice8_GetRenderState(device, D3DRS_LIGHTING, &value); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(value == TRUE, "Got unexpected value %#x.\n", value); + + hr = IDirect3DDevice8_BeginStateBlock(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice8_BeginStateBlock(device); + 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); + + hr = IDirect3DDevice8_CaptureStateBlock(device, stateblock); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice8_CreateStateBlock(device, D3DSBT_ALL, &stateblock2); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice8_GetRenderState(device, D3DRS_LIGHTING, &value); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(value == TRUE, "Got unexpected value %#x.\n", value); + + hr = IDirect3DDevice8_EndStateBlock(device, &stateblock2); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice8_ApplyStateBlock(device, stateblock2); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + 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);
refcount = IDirect3DDevice8_Release(device); ok(!refcount, "Device has %u references left.\n", refcount);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- 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 5016ac4f17..381588f8ca 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 f0acd9ff81..fee73de1a6 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);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=50487
Your paranoid android.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 6 ++++++ dlls/d3d8/tests/device.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 381588f8ca..4bd7578a8f 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1964,6 +1964,12 @@ static HRESULT WINAPI d3d8_device_CaptureStateBlock(IDirect3DDevice8 *iface, DWO TRACE("iface %p, token %#x.\n", iface, token);
wined3d_mutex_lock(); + if (device->recording) + { + wined3d_mutex_unlock(); + WARN("Trying to capture 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 fee73de1a6..37f4c5c119 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -7280,7 +7280,7 @@ static void test_begin_end_state_block(void) 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); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice8_CreateStateBlock(device, D3DSBT_ALL, &stateblock2); todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=50488
Your paranoid android.
=== w1064 (32 bit report) ===
d3d8: device.c:1546: Test failed: Reset failed, hr 0x80070057. device.c:1548: Test failed: TestCooperativeLevel failed, hr 0x88760869. device.c:1560: Test failed: D3DVIEWPORT->Width = 400. device.c:1561: Test failed: D3DVIEWPORT->Height = 300. 0af4:device: unhandled exception c0000005 at 706FA86E
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 6 ++++++ dlls/d3d8/tests/device.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 4bd7578a8f..4eb44e2fed 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2027,6 +2027,12 @@ static HRESULT WINAPI d3d8_device_CreateStateBlock(IDirect3DDevice8 *iface, }
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); if (FAILED(hr)) { diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 37f4c5c119..af58789460 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -7283,7 +7283,7 @@ static void test_begin_end_state_block(void) ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
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); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=50489
Your paranoid android.
=== w1064 (32 bit report) ===
d3d8: device.c:1546: Test failed: Reset failed, hr 0x80070057. device.c:1548: Test failed: TestCooperativeLevel failed, hr 0x88760869. device.c:1560: Test failed: D3DVIEWPORT->Width = 400. device.c:1561: Test failed: D3DVIEWPORT->Height = 300. 0068:device: unhandled exception c0000005 at 706FA86E
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=50486
Your paranoid android.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)