diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 47de5ef3b..518a81525 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -108,8 +108,8 @@ if (OAK_ENABLE_DYNAMIC_RENDER_BACKEND) common/filefunctions.h common/qtutils.cpp common/qtutils.h - config/config.cpp - config/config.h + common/xmlutils.cpp + common/xmlutils.h node/param.cpp node/param.h node/splitvalue.h @@ -148,6 +148,7 @@ if (OAK_ENABLE_DYNAMIC_RENDER_BACKEND) render/opengl/openglrenderer.h ) target_link_libraries(oakgl PRIVATE libolive-rendercore) + target_compile_definitions(oakgl PRIVATE OAK_RENDER_BACKEND_PLUGIN) set_target_properties(oakgl PROPERTIES OUTPUT_NAME oakgl LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} diff --git a/app/render/opengl/openglrenderer.cpp b/app/render/opengl/openglrenderer.cpp index 4d1968bc8..243691881 100644 --- a/app/render/opengl/openglrenderer.cpp +++ b/app/render/opengl/openglrenderer.cpp @@ -28,7 +28,9 @@ #include #include "common/filefunctions.h" +#if !defined(OAK_RENDER_BACKEND_PLUGIN) #include "config/config.h" +#endif #include "render/job/shaderjob.h" namespace olive @@ -394,18 +396,22 @@ void OpenGLRenderer::Flush() { GL_PREAMBLE; +#if !defined(OAK_RENDER_BACKEND_PLUGIN) if (OLIVE_CONFIG("UseGLFinish").toBool()) { functions_->glFinish(); - } else { -#if defined(Q_OS_MAC) - // macOS uses Tile-Based Deferred Rendering (TBDR). glFlush() does not - // guarantee that tile memory has been written back to texture memory. - // Using glFinish() prevents partial tile corruption ("black ink" artifacts). - functions_->glFinish(); -#else - functions_->glFlush(); -#endif + return; } +#endif + +#if defined(Q_OS_MAC) + // The dynamically loaded OpenGL backend cannot depend on the editor Config + // singleton because that pulls UI/Core symbols into the plugin. This + // platform default also preserves the previous macOS-safe behavior for + // texture consumers on TBDR drivers. + functions_->glFinish(); +#else + functions_->glFlush(); +#endif } // Adapts the generic Renderer output attachment hook to OpenGL's framebuffer