Module: wine Branch: master Commit: 6f5b8265abb42f963fefaa5c3f5326ad6d047ebc URL: https://source.winehq.org/git/wine.git/?a=commit;h=6f5b8265abb42f963fefaa5c3...
Author: Andrew Wesie awesie@gmail.com Date: Sun Oct 14 13:18:09 2018 -0500
wined3d: Add sync object after query buffer issue.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45932 Signed-off-by: Andrew Wesie awesie@gmail.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/query.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 26c32b1..4239fc0 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; }