From f09f79f6c984cdf0beebb033c265eada29d99735 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 19 Aug 2019 17:53:49 +0200 Subject: [PATCH] Upload "fix" for globebrowsing stuttering --- src/scene/scene.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index b753be7eb8..6b8041ccca 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -316,6 +316,15 @@ void Scene::render(const RenderData& data, RendererTasks& tasks) { if (global::callback::webBrowserPerformanceHotfix) { (*global::callback::webBrowserPerformanceHotfix)(); } + + // @TODO(abock 2019-08-19) This glGetError call is a hack to prevent the GPU + // thread and the CPU thread from diverging too much, particularly the uploading + // of a lot of textures for the globebrowsing planets can cause a hard stuttering + // effect. Asking for a glGetError after every rendering call will force the + // threads to implicitly synchronize and thus prevent the stuttering. The better + // solution would be to reduce the number of uploads per frame, use a staggered + // buffer, or something else like that preventing a large spike in uploads + glGetError(); } }