From 1c4149a0fdae80a39d0799aaa7d9eef16737a225 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Sat, 5 Nov 2022 12:49:30 -0700 Subject: [PATCH] preferences: add option to use glFinish i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl i hate opengl --- app/config/config.cpp | 1 + app/dialog/preferences/tabs/preferencesbehaviortab.cpp | 5 +++++ app/render/opengl/openglrenderer.cpp | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/config/config.cpp b/app/config/config.cpp index 56ea47a74..192fcdb74 100644 --- a/app/config/config.cpp +++ b/app/config/config.cpp @@ -104,6 +104,7 @@ void Config::SetDefaults() SetEntryInternal(QStringLiteral("UseLegacyColorInInputTab"), NodeValue::kBoolean, false); SetEntryInternal(QStringLiteral("ReassocLinToNonLin"), NodeValue::kBoolean, false); SetEntryInternal(QStringLiteral("PreviewNonFloatDontAskAgain"), NodeValue::kBoolean, false); + SetEntryInternal(QStringLiteral("UseGLFinish"), NodeValue::kBoolean, false); SetEntryInternal(QStringLiteral("TimelineThumbnailMode"), NodeValue::kInt, Timeline::kThumbnailInOut); SetEntryInternal(QStringLiteral("TimelineWaveformMode"), NodeValue::kInt, Timeline::kWaveformsEnabled); diff --git a/app/dialog/preferences/tabs/preferencesbehaviortab.cpp b/app/dialog/preferences/tabs/preferencesbehaviortab.cpp index 6db150edc..ad184c7d1 100644 --- a/app/dialog/preferences/tabs/preferencesbehaviortab.cpp +++ b/app/dialog/preferences/tabs/preferencesbehaviortab.cpp @@ -107,6 +107,11 @@ PreferencesBehaviorTab::PreferencesBehaviorTab() tr("Multiple clips can share the same nodes. Disable this to automatically share node " "dependencies among clips when copying or splitting them."), node_group); + + QTreeWidgetItem* opengl_group = AddParent(tr("OpenGL")); + AddItem(tr("Use glFinish"), + QStringLiteral("UseGLFinish"), + opengl_group); } void PreferencesBehaviorTab::Accept(MultiUndoCommand *command) diff --git a/app/render/opengl/openglrenderer.cpp b/app/render/opengl/openglrenderer.cpp index b0c91d7ab..3340c64d4 100644 --- a/app/render/opengl/openglrenderer.cpp +++ b/app/render/opengl/openglrenderer.cpp @@ -25,6 +25,8 @@ #include #include +#include "config/config.h" + namespace olive { const int OpenGLRenderer::kTextureCacheMaxSize = 5000; @@ -364,7 +366,11 @@ void OpenGLRenderer::Flush() { GL_PREAMBLE; - functions_->glFlush(); + if (OLIVE_CONFIG("UseGLFinish").toBool()) { + functions_->glFinish(); + } else { + functions_->glFlush(); + } } Color OpenGLRenderer::GetPixelFromTexture(Texture *texture, const QPointF &pt)