feat(render): dynamic OpenGL/Vulkan backend split and backend-neutral viewer

- Extract libolive-rendercore static library to minimize backend link boundary.
- Add DynamicRenderer adapter with C ABI (oakgl/oakvulkan shared libs).
- Make OAK_ENABLE_DYNAMIC_RENDER_BACKEND default ON with OpenGL fallback.
- Implement VulkanRenderer prototype (textures, shaders, UBO blit, readback).
- Add backend-neutral viewer readback path (offscreen -> QImage -> QPainter).
- Refactor PluginRenderer to be renderer-agnostic; OFX plugins fall back to CPU
  path on non-OpenGL backends while preserving OpenGL render path.
- Add Renderer::AttachOutputTexture/DetachOutputTexture and C ABI forwards.
- Update docs/zh/render-backend-dynamic-plan.md for Phase 3/4/5.
This commit is contained in:
2026-07-13 10:19:29 +08:00
parent 5fc8232671
commit 225f8505c2
42 changed files with 3042 additions and 495 deletions
+3 -23
View File
@@ -33,8 +33,6 @@
#include "node/block/transition/transition.h"
#include "node/project.h"
#include "rendermanager.h"
#include "render/opengl/openglcontextprovider.h"
#include "render/opengl/openglrenderer.h"
#include "render/plugin/pluginrenderer.h"
#include "pluginSupport/OliveClip.h"
#include "pluginSupport/OliveHost.h"
@@ -711,26 +709,8 @@ TexturePtr RenderProcessor::ProcessPluginJob(TexturePtr texture,
return destination;
}
plugin::PluginRenderer *plugin_renderer = nullptr;
{
static QThreadStorage<std::shared_ptr<plugin::PluginRenderer>>
cached_plugin_renderers;
if (!cached_plugin_renderers.hasLocalData()) {
auto *gl = dynamic_cast<OpenGLContextProvider *>(render_ctx_);
if (gl && gl->OpenGLContext()) {
auto cached_plugin_renderer =
std::make_shared<plugin::PluginRenderer>();
cached_plugin_renderer->Init(gl->OpenGLContext());
cached_plugin_renderer->PostInit();
cached_plugin_renderers.setLocalData(cached_plugin_renderer);
}
}
if (cached_plugin_renderers.hasLocalData()) {
plugin_renderer = cached_plugin_renderers.localData().get();
}
}
if (!plugin_renderer) {
plugin::PluginRenderer plugin_renderer(render_ctx_);
if (!plugin_renderer.renderer()) {
return destination;
}
@@ -782,7 +762,7 @@ TexturePtr RenderProcessor::ProcessPluginJob(TexturePtr texture,
}
}
plugin_renderer->RenderPlugin(
plugin_renderer.RenderPlugin(
src,
*plugin_job,
destination,