summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-05-19 21:39:58 +0200
committerMichael Lutz <michi@icosahedron.de>2021-05-23 12:22:59 +0200
commit97722931a976dc3e6603611b8ec48f10920960e4 (patch)
tree7f7bcc6b7b62ff203e67869ecfa540993830363e /src/video
parent4f7d6cf1baae8536c1d3a32a83f2291e04aec239 (diff)
downloadopenttd-97722931a976dc3e6603611b8ec48f10920960e4.tar.xz
Fix: [OpenGL] Increase timeout when waiting for the GPU to be done with the drawing buffer.
The old timeout could be too short if v-sync was on on lower refresh rates.
Diffstat (limited to 'src/video')
-rw-r--r--src/video/opengl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/video/opengl.cpp b/src/video/opengl.cpp
index ecafeb613..df0d12d07 100644
--- a/src/video/opengl.cpp
+++ b/src/video/opengl.cpp
@@ -1150,7 +1150,7 @@ void OpenGLBackend::ClearCursorCache()
void *OpenGLBackend::GetVideoBuffer()
{
#ifndef NO_GL_BUFFER_SYNC
- if (this->sync_vid_mapping != nullptr) _glClientWaitSync(this->sync_vid_mapping, GL_SYNC_FLUSH_COMMANDS_BIT, 10000000);
+ if (this->sync_vid_mapping != nullptr) _glClientWaitSync(this->sync_vid_mapping, GL_SYNC_FLUSH_COMMANDS_BIT, 100000000); // 100ms timeout.
#endif
if (!this->persistent_mapping_supported) {
@@ -1174,7 +1174,7 @@ uint8 *OpenGLBackend::GetAnimBuffer()
if (this->anim_pbo == 0) return nullptr;
#ifndef NO_GL_BUFFER_SYNC
- if (this->sync_anim_mapping != nullptr) _glClientWaitSync(this->sync_anim_mapping, GL_SYNC_FLUSH_COMMANDS_BIT, 10000000);
+ if (this->sync_anim_mapping != nullptr) _glClientWaitSync(this->sync_anim_mapping, GL_SYNC_FLUSH_COMMANDS_BIT, 100000000); // 100ms timeout.
#endif
if (!this->persistent_mapping_supported) {