mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
GLES: Only use GPU sync if necessary and available.
If there are complaints of reduced performance, or visual artefacts compared to 4.6.1, it may be worth increasing HW_MAX_PIPELINE_BUFFERS to 4 again.
This commit is contained in:
parent
24aa497e4f
commit
4de6b769d3
1 changed files with 18 additions and 12 deletions
|
@ -235,28 +235,34 @@ void GLBuffer::Resize(size_t newsize)
|
|||
void GLBuffer::GPUDropSync()
|
||||
{
|
||||
#if !(USE_GLES2) // Only applicable when running on desktop for now
|
||||
if (mGLSync != NULL)
|
||||
if (gles.useMappedBuffers && glFenceSync && glClientWaitSync)
|
||||
{
|
||||
glDeleteSync(mGLSync);
|
||||
}
|
||||
if (mGLSync != NULL)
|
||||
{
|
||||
glDeleteSync(mGLSync);
|
||||
}
|
||||
|
||||
mGLSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
mGLSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void GLBuffer::GPUWaitSync()
|
||||
{
|
||||
#if !(USE_GLES2) // Only applicable when running on desktop for now
|
||||
GLenum status = glClientWaitSync(mGLSync, GL_SYNC_FLUSH_COMMANDS_BIT, 1000 * 1000 * 50); // Wait for a max of 50ms...
|
||||
|
||||
if (status != GL_ALREADY_SIGNALED && status != GL_CONDITION_SATISFIED)
|
||||
if (gles.useMappedBuffers && glFenceSync && glClientWaitSync)
|
||||
{
|
||||
//Printf("Error on glClientWaitSync: %d\n", status);
|
||||
GLenum status = glClientWaitSync(mGLSync, GL_SYNC_FLUSH_COMMANDS_BIT, 1000 * 1000 * 50); // Wait for a max of 50ms...
|
||||
|
||||
if (status != GL_ALREADY_SIGNALED && status != GL_CONDITION_SATISFIED)
|
||||
{
|
||||
//Printf("Error on glClientWaitSync: %d\n", status);
|
||||
}
|
||||
|
||||
glDeleteSync(mGLSync);
|
||||
|
||||
mGLSync = NULL;
|
||||
}
|
||||
|
||||
glDeleteSync(mGLSync);
|
||||
|
||||
mGLSync = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue