Unlike textures and other objects that are shared between contexts, sync objects are not bound to the context. As a result, the reference counting and delete behavior of sync objects is slightly different. References to sync objects are added:
glFencSynce
. This sets the initial reference count to 1.glClientWaitSync
. The reference is held for the duration of the wait call.References are removed:
glDeleteSync
.glClientWaitSync
.
Additionally, drivers may call _mesa_ref_sync_object
and _mesa_unref_sync_object
as needed to implement ServerWaitSync
.
As with shader objects, sync object names become invalid as soon as glDeleteSync
is called. For this reason glDeleteSync
sets the DeletePending
flag. All functions validate object handles by testing this flag.
GL_ARB_sync
objects are shared between contexts. If support is ever added for either GL_NV_fence
or GL_APPLE_fence
different semantics will need to be implemented.
#include "glheader.h"
#include "imports.h"
#include "context.h"
#include "macros.h"