Upload "fix" for globebrowsing stuttering

This commit is contained in:
Alexander Bock
2019-08-19 17:53:49 +02:00
parent 194db41b81
commit f09f79f6c9

View File

@@ -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();
}
}