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:
@@ -19,6 +19,8 @@ public:
|
||||
using olive::OpenGLRenderer::CreateNativeTexture;
|
||||
using olive::OpenGLRenderer::DestroyInternal;
|
||||
using olive::OpenGLRenderer::DestroyNativeTexture;
|
||||
using olive::OpenGLRenderer::AttachTextureAsDestination;
|
||||
using olive::OpenGLRenderer::DetachTextureAsDestination;
|
||||
};
|
||||
|
||||
BackendOpenGLRenderer *Renderer(OakRenderBackendHandle handle)
|
||||
@@ -176,3 +178,15 @@ OAK_RENDER_BACKEND_EXPORT void *oak_renderer_opengl_context(
|
||||
{
|
||||
return Renderer(handle)->context();
|
||||
}
|
||||
|
||||
OAK_RENDER_BACKEND_EXPORT void oak_renderer_attach_output_texture(
|
||||
OakRenderBackendHandle handle, const void *texture_id)
|
||||
{
|
||||
Renderer(handle)->AttachTextureAsDestination(VariantRef(texture_id));
|
||||
}
|
||||
|
||||
OAK_RENDER_BACKEND_EXPORT void oak_renderer_detach_output_texture(
|
||||
OakRenderBackendHandle handle)
|
||||
{
|
||||
Renderer(handle)->DetachTextureAsDestination();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
#include <QOpenGLExtraFunctions>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "common/filefunctions.h"
|
||||
#include "config/config.h"
|
||||
#include "render/job/shaderjob.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -406,6 +408,18 @@ void OpenGLRenderer::Flush()
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLRenderer::AttachOutputTexture(olive::Texture *texture)
|
||||
{
|
||||
if (texture) {
|
||||
AttachTextureAsDestination(texture->id());
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLRenderer::DetachOutputTexture()
|
||||
{
|
||||
DetachTextureAsDestination();
|
||||
}
|
||||
|
||||
Color OpenGLRenderer::GetPixelFromTexture(Texture *texture, const QPointF &pt)
|
||||
{
|
||||
AttachTextureAsDestination(texture->id());
|
||||
|
||||
@@ -82,6 +82,15 @@ public:
|
||||
return context();
|
||||
}
|
||||
|
||||
virtual bool IsOpenGL() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void AttachOutputTexture(olive::Texture *texture) override;
|
||||
|
||||
virtual void DetachOutputTexture() override;
|
||||
|
||||
bool EnsureContextCurrent(const char *caller);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user