summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-10-25 12:58:03 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2016-10-27 11:25:14 +0100
commitc29a37c44495c482e5e61330d1baf39e713b52bb (patch)
treeac2003893a64ea52f41ee3ec469514bfa01a7731 /src/mesa
parent9c5bbfcbc8a855a46f6b9707f6958206bac46cfc (diff)
downloadexternal_mesa3d-c29a37c44495c482e5e61330d1baf39e713b52bb.zip
external_mesa3d-c29a37c44495c482e5e61330d1baf39e713b52bb.tar.gz
external_mesa3d-c29a37c44495c482e5e61330d1baf39e713b52bb.tar.bz2
st/mesa: unduplicate st_check_sync code
It's the same as st_client_wait_sync. Discovered by Michel. This is needed to make the following fix simpler. Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit f240ad98bc05281ea7013d91973cb5f932ae9434)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_syncobj.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/mesa/state_tracker/st_cb_syncobj.c b/src/mesa/state_tracker/st_cb_syncobj.c
index 123925a..749c124 100644
--- a/src/mesa/state_tracker/st_cb_syncobj.c
+++ b/src/mesa/state_tracker/st_cb_syncobj.c
@@ -76,24 +76,6 @@ static void st_fence_sync(struct gl_context *ctx, struct gl_sync_object *obj,
pipe->flush(pipe, &so->fence, PIPE_FLUSH_DEFERRED);
}
-static void st_check_sync(struct gl_context *ctx, struct gl_sync_object *obj)
-{
- struct pipe_context *pipe = st_context(ctx)->pipe;
- struct pipe_screen *screen = pipe->screen;
- struct st_sync_object *so = (struct st_sync_object*)obj;
-
- /* If the fence doesn't exist, assume it's signalled. */
- if (!so->fence) {
- so->b.StatusFlag = GL_TRUE;
- return;
- }
-
- if (screen->fence_finish(screen, pipe, so->fence, 0)) {
- screen->fence_reference(screen, &so->fence, NULL);
- so->b.StatusFlag = GL_TRUE;
- }
-}
-
static void st_client_wait_sync(struct gl_context *ctx,
struct gl_sync_object *obj,
GLbitfield flags, GLuint64 timeout)
@@ -120,13 +102,17 @@ static void st_client_wait_sync(struct gl_context *ctx,
* Assume GL_SYNC_FLUSH_COMMANDS_BIT is always set, because applications
* forget to set it.
*/
- if (so->fence &&
- screen->fence_finish(screen, pipe, so->fence, timeout)) {
+ if (screen->fence_finish(screen, pipe, so->fence, timeout)) {
screen->fence_reference(screen, &so->fence, NULL);
so->b.StatusFlag = GL_TRUE;
}
}
+static void st_check_sync(struct gl_context *ctx, struct gl_sync_object *obj)
+{
+ st_client_wait_sync(ctx, obj, 0, 0);
+}
+
static void st_server_wait_sync(struct gl_context *ctx,
struct gl_sync_object *obj,
GLbitfield flags, GLuint64 timeout)