[06/17] u_threaded_context: add support for semaphore wait/signal

Submitted by Andres Rodriguez on Nov. 2, 2017, 3:57 a.m.

Details

Message ID 20171102035720.6839-7-andresx7@gmail.com
State New
Headers show
Series "Add support for GL_EXT_semaphore" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Andres Rodriguez Nov. 2, 2017, 3:57 a.m.
Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
---
 src/gallium/auxiliary/util/u_threaded_context.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index 7e28b87..272d846 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -1636,6 +1636,29 @@  tc_texture_subdata(struct pipe_context *_pipe,
    }
 }
 
+/********************************************************************
+ * Semaphores
+ */
+
+static void
+tc_semobj_wait(struct pipe_context *_pipe,
+               struct pipe_semaphore_object *semobj)
+{
+   struct threaded_context *tc = threaded_context(_pipe);
+   struct pipe_context *pipe = tc->pipe;
+
+   pipe->semobj_wait(pipe, semobj);
+}
+
+static void
+tc_semobj_signal(struct pipe_context *_pipe,
+                 struct pipe_semaphore_object *semobj)
+{
+   struct threaded_context *tc = threaded_context(_pipe);
+   struct pipe_context *pipe = tc->pipe;
+
+   pipe->semobj_signal(pipe, semobj);
+}
 
 /********************************************************************
  * miscellaneous
@@ -2451,6 +2474,8 @@  threaded_context_create(struct pipe_context *pipe,
    CTX_INIT(create_image_handle);
    CTX_INIT(delete_image_handle);
    CTX_INIT(make_image_handle_resident);
+   CTX_INIT(semobj_wait);
+   CTX_INIT(semobj_signal);
 #undef CTX_INIT
 
    if (out)