mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +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,18 +235,23 @@ void GLBuffer::Resize(size_t newsize)
|
|||
void GLBuffer::GPUDropSync()
|
||||
{
|
||||
#if !(USE_GLES2) // Only applicable when running on desktop for now
|
||||
if (gles.useMappedBuffers && glFenceSync && glClientWaitSync)
|
||||
{
|
||||
if (mGLSync != NULL)
|
||||
{
|
||||
glDeleteSync(mGLSync);
|
||||
}
|
||||
|
||||
mGLSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void GLBuffer::GPUWaitSync()
|
||||
{
|
||||
#if !(USE_GLES2) // Only applicable when running on desktop for now
|
||||
if (gles.useMappedBuffers && glFenceSync && glClientWaitSync)
|
||||
{
|
||||
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)
|
||||
|
@ -257,6 +262,7 @@ void GLBuffer::GPUWaitSync()
|
|||
glDeleteSync(mGLSync);
|
||||
|
||||
mGLSync = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue