summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/externalobjects.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/externalobjects.c')
-rw-r--r--src/mesa/main/externalobjects.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mesa/main/externalobjects.c b/src/mesa/main/externalobjects.c
index b72fe13d048..9ba70c8e7f8 100644
--- a/src/mesa/main/externalobjects.c
+++ b/src/mesa/main/externalobjects.c
@@ -23,6 +23,7 @@
#include "macros.h"
#include "mtypes.h"
+#include "context.h"
#include "externalobjects.h"
#include "teximage.h"
#include "texobj.h"
@@ -713,7 +714,26 @@ _mesa_WaitSemaphoreEXT(GLuint semaphore,
const GLuint *textures,
const GLenum *srcLayouts)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_semaphore_object *semObj;
+
+
+ if (!ctx->Extensions.EXT_semaphore) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glWaitSemaphoreEXT(unsupported)");
+ return;
+ }
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ semObj = _mesa_lookup_semaphore_object(ctx, semaphore);
+ if (!semObj)
+ return;
+
+ FLUSH_VERTICES(ctx, 0);
+ FLUSH_CURRENT(ctx, 0);
+ /* TODO: memory barriers and layout transitions */
+ ctx->Driver.ServerWaitSemaphoreObject(ctx, semObj);
}
void GLAPIENTRY
@@ -724,7 +744,25 @@ _mesa_SignalSemaphoreEXT(GLuint semaphore,
const GLuint *textures,
const GLenum *dstLayouts)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_semaphore_object *semObj;
+
+ if (!ctx->Extensions.EXT_semaphore) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glSignalSemaphoreEXT(unsupported)");
+ return;
+ }
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ semObj = _mesa_lookup_semaphore_object(ctx, semaphore);
+ if (!semObj)
+ return;
+
+ FLUSH_VERTICES(ctx, 0);
+ FLUSH_CURRENT(ctx, 0);
+ /* TODO: memory barriers and layout transitions */
+ ctx->Driver.ServerSignalSemaphoreObject(ctx, semObj);
}
void GLAPIENTRY