Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45932 Signed-off-by: Andrew Wesie awesie@gmail.com ---
Notes: As a side effect, fixes a NVIDIA driver bug with many in-flight query buffer objects.
dlls/wined3d/query.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 26c32b1f13..4239fc08b3 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -76,6 +76,7 @@ static void wined3d_query_destroy_buffer_object(struct wined3d_context *context, static BOOL wined3d_query_buffer_queue_result(struct wined3d_context *context, struct wined3d_query *query, GLuint id) { const struct wined3d_gl_info *gl_info = context->gl_info; + GLsync tmp_sync;
if (!gl_info->supported[ARB_QUERY_BUFFER_OBJECT] || !gl_info->supported[ARB_BUFFER_STORAGE]) return FALSE; @@ -104,6 +105,14 @@ static BOOL wined3d_query_buffer_queue_result(struct wined3d_context *context, s GL_EXTCALL(glBindBuffer(GL_QUERY_BUFFER, 0)); checkGLcall("queue query result");
+ /* ARB_buffer_storage requires the client to call FenceSync with + * SYNC_GPU_COMMANDS_COMPLETE after the server does a write. This behavior + * is not enforced by Mesa. + */ + tmp_sync = GL_EXTCALL(glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0)); + GL_EXTCALL(glDeleteSync(tmp_sync)); + checkGLcall("query buffer sync"); + return TRUE; }
Minimal test case for the GPU hang in bug 45932.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45932 Signed-off-by: Andrew Wesie awesie@gmail.com --- dlls/d3d9/tests/device.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 66bf5b00c5..3e7663622f 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -5948,6 +5948,32 @@ static void test_occlusion_query(void) || broken(data.dword[0] < 0xffffffff && !data.dword[1]), "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]);
+ hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + for (i = 0; i < 50000; ++i) + { + hr = IDirect3DQuery9_Issue(query, D3DISSUE_BEGIN); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_Issue(query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + } + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + for (i = 0; i < 500; ++i) + { + if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) == S_OK) + break; + Sleep(10); + } + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + memset(&data, 0xff, sizeof(data)); + hr = IDirect3DQuery9_GetData(query, &data, sizeof(data), D3DGETDATA_FLUSH); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(data.dword[0] == 0 && data.dword[1] == 0, + "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]); + IDirect3DSurface9_Release(rt);
done:
Hi,
While running your changed tests on Windows, 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=43125
Your paranoid android.
=== build (build log) ===
error: corrupt patch at line 40 Task: Patch failed to apply
=== debian9 (build log) ===
error: corrupt patch at line 40 Task: Patch failed to apply
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com