Sync & queriesGL 3.2
glDeleteSync
Frees a fence created by glFenceSync.
Part of the family glDelete*
Signature
void glDeleteSync(GLsync sync);
How it works
Fences are small but not free; creating one per frame without deleting it leaks driver memory. Delete a fence once you have waited for it. Deleting one that has not signalled yet is allowed: it is freed when the GPU reaches it.
Parameters
syncGLsync
The fence (0 is silently ignored).
Errors
When the call is invalid it does nothing and sets an error, which glGetError returns:
- GL_INVALID_VALUE
- sync is neither 0 nor a fence.
Example
example.cpp
1glDeleteSync(fence[k]);
2fence[k] = nullptr;