Robert Xiao : wined3d: Reduce timeout to avoid GL_TIMEOUT_EXPIRED on macOS.
Alexandre Julliard
julliard at winehq.org
Wed Aug 16 09:06:25 CDT 2017
Module: wine
Branch: master
Commit: b2303d90af34da3427d27302f40055c548cc657a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b2303d90af34da3427d27302f40055c548cc657a
Author: Robert Xiao <brx at cs.cmu.edu>
Date: Sat Aug 12 12:09:06 2017 -0400
wined3d: Reduce timeout to avoid GL_TIMEOUT_EXPIRED on macOS.
Signed-off-by: Robert Xiao <brx at cs.cmu.edu>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/query.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index f1e7803..88f64bd 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -198,11 +198,12 @@ enum wined3d_fence_result wined3d_fence_wait(const struct wined3d_fence *fence,
if (gl_info->supported[ARB_SYNC])
{
- /* Apple seems to be into arbitrary limits, and timeouts larger than
- * 0xfffffffffffffbff immediately return GL_TIMEOUT_EXPIRED. We don't
- * really care and can live with waiting a few μs less. (OS X 10.7.4). */
+ /* Timeouts near 0xffffffffffffffff may immediately return GL_TIMEOUT_EXPIRED,
+ * possibly because macOS internally adds some slop to the timer. To avoid this,
+ * we use a large number that isn't near the point of overflow (macOS 10.12.5).
+ */
GLenum gl_ret = GL_EXTCALL(glClientWaitSync(fence->object.sync,
- GL_SYNC_FLUSH_COMMANDS_BIT, ~(GLuint64)0xffff));
+ GL_SYNC_FLUSH_COMMANDS_BIT, ~(GLuint64)0 >> 1));
checkGLcall("glClientWaitSync");
switch (gl_ret)
@@ -212,7 +213,7 @@ enum wined3d_fence_result wined3d_fence_wait(const struct wined3d_fence *fence,
ret = WINED3D_FENCE_OK;
break;
- /* We don't expect a timeout for a ~584 year wait */
+ /* We don't expect a timeout for a ~292 year wait */
default:
ERR("glClientWaitSync returned %#x.\n", gl_ret);
ret = WINED3D_FENCE_ERROR;
More information about the wine-cvs
mailing list