#include "imports.h"
#include "context.h"
#include "macros.h"
+#include "get.h"
+#include "dispatch.h"
#if FEATURE_ARB_sync
#include "syncobj.h"
static struct gl_sync_object *
-_mesa_new_sync_object(GLcontext *ctx, GLenum type)
+_mesa_new_sync_object(struct gl_context *ctx, GLenum type)
{
struct gl_sync_object *s = MALLOC_STRUCT(gl_sync_object);
(void) ctx;
static void
-_mesa_delete_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj)
+_mesa_delete_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
{
(void) ctx;
- _mesa_free(syncObj);
+ free(syncObj);
}
static void
-_mesa_fence_sync(GLcontext *ctx, struct gl_sync_object *syncObj,
+_mesa_fence_sync(struct gl_context *ctx, struct gl_sync_object *syncObj,
GLenum condition, GLbitfield flags)
{
(void) ctx;
(void) condition;
(void) flags;
- syncObj->Status = 1;
+ syncObj->StatusFlag = 1;
}
static void
-_mesa_check_sync(GLcontext *ctx, struct gl_sync_object *syncObj)
+_mesa_check_sync(struct gl_context *ctx, struct gl_sync_object *syncObj)
{
(void) ctx;
(void) syncObj;
static void
-_mesa_wait_sync(GLcontext *ctx, struct gl_sync_object *syncObj,
+_mesa_wait_sync(struct gl_context *ctx, struct gl_sync_object *syncObj,
GLbitfield flags, GLuint64 timeout)
{
(void) ctx;
}
+void
+_mesa_init_sync_dispatch(struct _glapi_table *disp)
+{
+ SET_IsSync(disp, _mesa_IsSync);
+ SET_DeleteSync(disp, _mesa_DeleteSync);
+ SET_FenceSync(disp, _mesa_FenceSync);
+ SET_ClientWaitSync(disp, _mesa_ClientWaitSync);
+ SET_WaitSync(disp, _mesa_WaitSync);
+ SET_GetInteger64v(disp, _mesa_GetInteger64v);
+ SET_GetSynciv(disp, _mesa_GetSynciv);
+}
+
+
/**
* Allocate/init the context state related to sync objects.
*/
void
-_mesa_init_sync(GLcontext *ctx)
+_mesa_init_sync(struct gl_context *ctx)
{
(void) ctx;
}
* Free the context state related to sync objects.
*/
void
-_mesa_free_sync_data(GLcontext *ctx)
+_mesa_free_sync_data(struct gl_context *ctx)
{
(void) ctx;
}
void
-_mesa_ref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj)
+_mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
{
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
syncObj->RefCount++;
void
-_mesa_unref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj)
+_mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
{
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
syncObj->RefCount--;
}
-GLboolean
+GLboolean GLAPIENTRY
_mesa_IsSync(GLsync sync)
{
GET_CURRENT_CONTEXT(ctx);
}
-void
+void GLAPIENTRY
_mesa_DeleteSync(GLsync sync)
{
GET_CURRENT_CONTEXT(ctx);
}
-GLsync
+GLsync GLAPIENTRY
_mesa_FenceSync(GLenum condition, GLbitfield flags)
{
GET_CURRENT_CONTEXT(ctx);
syncObj->DeletePending = GL_FALSE;
syncObj->SyncCondition = condition;
syncObj->Flags = flags;
- syncObj->Status = 0;
+ syncObj->StatusFlag = 0;
ctx->Driver.FenceSync(ctx, syncObj, condition, flags);
}
-GLenum
+GLenum GLAPIENTRY
_mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
{
GET_CURRENT_CONTEXT(ctx);
* if <sync> was signaled, even if the value of <timeout> is zero.
*/
ctx->Driver.CheckSync(ctx, syncObj);
- if (syncObj->Status) {
+ if (syncObj->StatusFlag) {
ret = GL_ALREADY_SIGNALED;
} else {
ctx->Driver.ClientWaitSync(ctx, syncObj, flags, timeout);
- ret = syncObj->Status ? GL_CONDITION_SATISFIED : GL_TIMEOUT_EXPIRED;
+ ret = syncObj->StatusFlag ? GL_CONDITION_SATISFIED : GL_TIMEOUT_EXPIRED;
}
_mesa_unref_sync_object(ctx, syncObj);
}
-void
+void GLAPIENTRY
_mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
{
GET_CURRENT_CONTEXT(ctx);
}
-void
+void GLAPIENTRY
_mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,
GLint *values)
{
*/
ctx->Driver.CheckSync(ctx, syncObj);
- v[0] = (syncObj->Status) ? GL_SIGNALED : GL_UNSIGNALED;
+ v[0] = (syncObj->StatusFlag) ? GL_SIGNALED : GL_UNSIGNALED;
size = 1;
break;
if (size > 0) {
const GLsizei copy_count = MIN2(size, bufSize);
- _mesa_memcpy(values, v, sizeof(GLint) * copy_count);
+ memcpy(values, v, sizeof(GLint) * copy_count);
}
if (length != NULL) {