- Pass through input texture when the LUT processor is not ready yet,
preventing black frames while the processor is being generated.
- Serialize processor generation with a single in-flight task to avoid
concurrent OCIO lock contention that could freeze the UI.
- Invalidate cached frames after the async processor is set so the viewer
refreshes automatically without requiring the playhead to be moved.
- Add OAK_DISABLE_HWACCEL environment variable to force software decoding.
- Add FFmpegDecoderHW regression test for H.264 4:2:2 10-bit decoding.
- Document that Vulkan now passes an end-to-end upload/blit/download test
on real hardware.
- List recently landed fixes: shared vertex/fragment UBO, descriptor set
layout, render pass dependencies, image layout transitions, framebuffer
and sampler caching, grayscale swizzle, texture-enable uniforms.
- Add remaining gaps: iterative/pin-pong multi-pass Blit, 1/3-channel
upload/download alignment, and full viewer/proxy/export smoke tests.
- Cache a VkFramebuffer per texture to avoid creating/destroying one for
every Blit() call.
- Create and cache both linear and nearest samplers; honor
Texture::Interpolation in descriptor writes.
- Add single-channel image-view component swizzle (R -> RGB, A = 1) to
match OpenGL grayscale behavior.
- Set texture-enable uniforms (NAME_enabled) when shaders declare them.
- Guard Blit() with null destination and emit a clear warning instead of
recording an invalid render pass.
ctest passes 4/4 in both dynamic-backend ON and OFF builds.
- Add shared UBO layout across vertex + fragment stages so vertex
uniforms like ove_mvpmat compile and bind correctly.
- Rewrite uniform extraction/injection to avoid corrupting the UBO
block and to keep explicit sampler bindings stable.
- Make the UBO and sampler descriptor bindings visible to both vertex
and fragment stages.
- Add layout locations for vertex varyings (ove_texcoord) and fragment
inputs so SPIR-V generation succeeds.
- Extend TransitionImageLayout() to cover all layout pairs used by
upload/download/clear/blit.
- Add subpass dependencies to the cached render pass and leave
destinations in SHADER_READ_ONLY_OPTIMAL after Blit().
- Move descriptor allocation before command recording and abort cleanly
if allocation fails; switch Blit() to the persistent linear sampler.
- Add a gtest that creates a Vulkan backend, uploads a red U8 RGBA
texture, blits through the default pass-through shader, and verifies
the downloaded pixel is red. This test passes on the current system.
ctest passes 4/4; DynamicRenderBackend.* passes 3/1 (Vulkan fallback
skipped because Vulkan is available).
- Remove unconditional VK_KHR_swapchain request; offscreen renderer needs
no device extensions, fixing failures on headless/CI setups.
- Enumerate physical devices properly and pick the first one with a
graphics queue family instead of blindly choosing device 0.
- Check vkEnumeratePhysicalDevices/vkBindImageMemory/vkBindBufferMemory
results.
- Validate FindMemoryType() result before allocation and log clear errors.
- Add a persistent linear sampler created in PostInit and destroy it in
DestroyInternal.
- Fix DestroyInternal() early-return leak: now tears down the instance
even if device creation failed.
ctest passes 4/4.
- dynamic plan: mark that RenderManager::backend() now syncs with
DynamicRenderer's actual loaded backend after internal fallback.
- manual test plan: add checks in 10.2/10.3 that RenderManager reports
the actual runtime backend (OpenGL after Vulkan fallback).
No code changes; ctest passes 4/4.
DynamicRenderer::Load() can internally fall back from Vulkan to
OpenGL when the Vulkan library is missing or is_available() fails.
Previously RenderManager::backend_ stayed at kVulkan, so callers
asking RenderManager::backend() got the wrong answer. After a
successful dynamic load, sync backend_ from
DynamicRenderer::backend_name() and log any fallback.
ctest still passes 4/4 in build-default-on.
- Add PickRenderableFormat / IsColorAttachmentSupported so 3-channel
Vulkan formats fall back to 4-channel when unsupported.
- Make oakvulkan target and C ABI check conditional on Vulkan_FOUND;
skip liboakvulkan build/dependencies when Vulkan headers/libs are
absent.
- Update Preferences tooltip to reflect Vulkan is an experimental
prototype that may fall back to OpenGL.
- Revise dynamic backend plan doc: phase 3/4/5 described as prototype
frameworks with runtime validation pending, and list recent Vulkan
fixes (init idempotency, descriptor/sampler lifetime, dynamic
viewport/scissor, render pass clear, format probing).
Both OAK_ENABLE_DYNAMIC_RENDER_BACKEND=ON and OFF configurations
build and pass ctest (4/4).
- 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 fixes crashes (SIGSEGV in CImg blur_bilateral) and black-frame
corruption artifacts during playback and scrubbing on macOS Apple Silicon.
Root cause analysis:
1. macOS uses Tile-Based Deferred Rendering (TBDR). glFlush() does not
guarantee tile memory writeback, causing glReadPixels to read incomplete
tiles (black/corrupted frames) and cache them to disk.
2. Olive uses multiple shared OpenGL contexts (RenderProcessor contexts vs.
thread-local PluginRenderer context). glFinish() only waits for the
current context, not the shared context that produced the texture. CPU
readback in PluginRenderer could read partially-rendered tiles.
3. OlivePluginInstance and OliveClipInstance are not thread-safe. Concurrent
RenderProcessors could corrupt internal QMap/images_ and params_ via
setInputTexture/renderAction races.
Fixes:
- OpenGLRenderer::Flush() on macOS now uses glFinish() unconditionally.
- OpenGLRenderer::DownloadFromTexture() and OpenGLRenderer::Blit() insert
glFinish() before readback/detach to ensure tile writeback completes.
- PluginRenderer::RenderPlugin() now acquires a per-instance mutex to
serialize concurrent OFX render calls.
- Before CPU readback in PluginRenderer, flush the renderer that originally
produced each input texture, ensuring cross-context synchronization.
- RenderProcessor::ProcessVideoFootage() flushes after BlitColorManaged.
- Add black-frame detection in ProcessVideoCacheJob() to auto-purge TBDR-
corrupted cache files.
- Add diagnostic qDebug() logging in viewer, decoder, renderer, and plugin
paths to aid future debugging.
Fix three performance traps in the OFX plugin preview pipeline that
caused slideshow-like performance when any plugin was active.
1. Eliminate per-frame PluginRenderer creation (GL FBO alloc/free)
RenderProcessor is stack-allocated per ticket, so its
plugin_renderer_ member was constructed and destroyed every frame.
PluginRenderer inherits OpenGLRenderer, whose PostInit() calls
glGenFramebuffers() and whose destructor calls glDeleteFramebuffers().
On Apple Silicon's TBDR this is pathologically expensive.
Fix: use a thread_local cached PluginRenderer so each render thread
creates it only once and reuses it forever.
2. Call getClipPreferences() conditionally
The code unconditionally called instance->getClipPreferences() on
every single frame. This dispatches kOfxImageEffectActionGetClipPreferences
into the plugin even when no inputs or parameters have changed.
Fix: check areClipPrefsDirty() first. The OpenFX Host Support library
already tracks this flag and sets it to true when slave params or clip
connections change.
3. Call ApplyParamOverrides() before renderAction
ApplyParamOverrides() was defined but never invoked, so animated
plugin parameters were never pushed into the OFX instance before
rendering.
Fix: call it after beginRenderAction() and before renderAction(),
injecting the current NodeValueRow values at the correct OfxTime.
This commit removes redundant readbacks and uploads in the OpenFX
plugin pipeline, achieving zero-copy rendering for GL-capable
plugins and reducing CPU path overhead.
PluginRenderer (OpenGL path):
- Skip ReadbackTextureToFrame + ConvertFrameIfNeeded + Upload after
plugin render. The destination texture is already valid on GPU.
- Pass readback_cpu=false to setInputTexture() so input textures are
provided via loadTexture() (GL texture IDs) instead of being
downloaded to CPU Image buffers.
- Remove duplicate ReadbackTextureToFrame block between
getClipPreferences and the second setInputTexture call.
OliveClipInstance:
- Add optional bool readback_cpu=true to setInputTexture(). When
false, only params and input_textures_ are updated; CPU readback
and memcpy into Image are skipped.
- Add pruneImagesCache() to prevent unbounded growth of images_.
Input clips are limited to 8 cached frames; output clips are
left untouched.
Micro-optimizations:
- Replace per-row memcpy loops with single block memcpy when
src/dst strides are contiguous (common case in Olive pipeline).
- Remove dead GL_PREAMBLE macro definition.
fix(viewer): resolve playback head lag, frozen frames, and pause delay
Three playback pipeline behavioral issues are fixed:
1. Prequeue blocked playhead start:
Reduce kVideoPlaybackInterval from 0.5s to 0.1s. This lowers
prequeue length from 15–30 frames to 3–6 frames, so the
playback timer starts much sooner after pressing Play.
2. Frozen display during playback:
Relax the hard frame-drop logic in RendererGeneratedFrameForQueue.
When the queue has fewer than 2 frames, keep late frames instead
of dropping them, preventing the viewer from freezing entirely
when rendering cannot keep up with playback speed.
3. Delayed frame update after pause:
Cancel in-flight render tickets in PauseInternal() before
deleting queue watchers. Previously the render thread continued
processing stale playback frames, blocking the single-frame
render requested by UpdateTextureFromNode().
This commit resolves several categories of OFX plugin failures that
manifested as magenta (pink) render output or crashes:
1. Param default-value initialization
- IntegerInstance, DoubleInstance, BooleanInstance, ChoiceInstance,
and StringInstance now read kOfxParamPropDefault from the descriptor
at construction time. Previously, when no PluginNode was attached
(integration-test mode), get() returned 0/0.0/false, causing
generator plugins to receive invalid extent/format/PAR values and
crash in coordinate assertions.
- IntegerInstance also fixed uninitialized `id` that caused
kOfxStatErrBadHandle in CImg plugins.
2. Clip property initialization
- newClipInstance() now seeds pixelDepth and components from the
host VideoParams instead of leaving them as None. This prevents
Transform3x3Plugin and similar plugins from asserting on
getPixelComponentCount() during fetchClip inside createInstance.
- getAspectRatio() and getProjectPixelAspectRatio() now fall back
to 1.0 when the project's PAR is not yet set, avoiding division-
by-zero in coordinate conversion.
3. Frame-rate and time-base preservation
- setInputTexture() no longer overwrites the clip's frame_rate or
time_base with the input texture's values. Multi-input plugins
were crashing because setupClipPreferencesArgs throws when inputs
have mismatched rates.
4. Render loop hardening
- getClipPreferences() is now wrapped in try/catch so that frame-
rate mismatch exceptions mark render failure instead of aborting
the render thread.
- getRegionOfInterestAction() treats kOfxStatErrBadHandle as non-
fatal and falls back to default RoI.
- RenderPlugin syncs all clip instances after setVideoParam so that
getAspectRatio/getFrameRate return valid values before
createInstanceAction queries them.
5. Test suite updates
- All PluginMisc tests now use F32 input to match the host pipeline
default.
- CreateGradientTexture fixed to support F32 pixel format.
- Added CImgBilateral and CImgGuided_MultiInput tests.
- Secret parameters are now registered as hidden Node inputs so that
getClipPreferences can read them (fixes generator pink screen).
6. Debug logging in HostSupport
- clipGetImage and clipGetRegionOfDefinition now catch exceptions
and log the failing clip name for easier debugging.
- Fix SIGSEGV in PluginMisc.Keyer by linking Param::SetInstance to instances.
Olive's custom param instances (IntegerInstance, DoubleInstance, etc.) were
not passing the SetInstance pointer to the OpenFX HostSupport base class,
leaving _paramSetInstance as nullptr. When Keyer called paramSetValue during
createInstanceAction, the suite function dereferenced the null pointer in
paramChangedByPlugin(). Now newParam() passes 'this' to every constructor.
- Fix render-thread crash when OFX plugins set params during rendering.
MinOFX calls paramSetValue inside createInstanceAction from the render
thread. SubmitUndoCommand() used to push undo commands directly to
UndoStack, which modifies QAction state (GUI-only). Added IsGuiThread()
check: non-GUI threads execute redo_now() and discard the command without
touching the undo stack.
- Enable PluginMisc.MergeOver and PluginMisc.Keyer integration tests.
MergeOver now supplies both Source and Bg textures; Keyer uses U16 format.
Both pass in the full test suite.
- Make ViewerQueue thread-safe with QMutex around AppendTimewise/PurgeBefore.
Adds copy ctor and assignment to support mutex-per-instance semantics.
Hide non-texture OFX params from node graph
--------------------------------------------
OFX plugins like ColorCorrect expose dozens of scalar parameters as
node inputs, making nodes extremely tall and pushing Source/Mask far
down. Previously attempted via kInputFlagHidden, but that also hid
them from the parameter panel.
Fix: move the filter to NodeViewItem::IsInputValid() instead.
For OFX plugin nodes (getPluginInstance() != nullptr), only
kTexture inputs are rendered as ports. Scalar parameters remain
fully visible in the parameter panel.
Files: app/widget/nodeview/nodeviewitem.cpp
app/node/plugins/Plugin.cpp
Standardize OFX host coordinate system
--------------------------------------
Olive's OFX host had partial and inconsistent coordinate handling.
1. Fix Project coordinate methods
- getProjectSize() / getProjectExtent() / getProjectOffset()
now multiply X by pixel_aspect_ratio(), returning canonical
coordinates per the OFX spec.
2. Fix Clip default RoD
- OliveClipInstance::getRegionOfDefinition() default now returns
{0, 0, width*PAR, height} instead of raw pixel coords.
3. Add parameter coordinate system conversion
- DoubleInstance / Double2DInstance / Double3DInstance now check
_descriptor.getDefaultCoordinateSystem().
- For kOfxParamCoordinatesNormalised:
get: internal pixel value -> normalised (divide by extent)
set: normalised plugin value -> pixel (multiply by extent)
- DefaultValueForParam() also converts normalised defaults to
canonical before storing in Node, keeping Olive internal/UI
values consistently in pixel space.
Files: app/pluginSupport/OlivePluginInstance.cpp
app/pluginSupport/OliveClip.cpp
app/pluginSupport/paraminstance.h
app/node/plugins/Plugin.cpp
All OpenFX plugins were previously hardcoded to return kCategoryUnknown,
causing them to pile up under "Uncategorized" in the node creation menu.
This commit introduces a two-level grouping system for OFX plugins:
1. Add new kCategoryOpenFX top-level category
- Node::CategoryID enum extended with kCategoryOpenFX
- PluginNode::Category() now returns {kCategoryOpenFX}
- Node::GetCategoryName() returns "OpenFX"
2. Add secondary sub-grouping support
- Node base class gains virtual SubCategory() method
- PluginNode implements SubCategory() backed by sub_category_ member
- sub_category_ is set in the constructor from the plugin's OFX context:
Filter → "Filter"
Generator → "Generator"
Transition → "Transition"
others → "General"
3. Update NodeFactory::CreateMenu()
- When a node belongs to kCategoryOpenFX and provides a non-empty
SubCategory(), creates a second-level submenu under "OpenFX"
- Nodes without a sub-category are placed directly in the top menu
Expected menu layout:
OpenFX
├── Filter
│ ├── ColorCorrect
│ └── ...
├── Generator
├── Transition
└── General
All 4 test suites pass.
ColorCorrectOFX and similar plugins declare per-channel controls
(Gamma, Contrast, Saturation, Gain, Offset) as kOfxParamTypeRGBA.
Olive previously mapped every RGBA param to NodeValue::kColor and
rendered it as a ColorButton, which is semantically wrong for
adjustment sliders.
This commit adds heuristic semantic detection to distinguish
"true color" inputs (color pickers) from "per-channel scalar"
inputs (float sliders):
- label/hint/name keywords ("gamma", "contrast", "gain", ...)
- display range outside [0, 1]
- uniform default values across all channels
The detected semantic ("color" or "scalar") is stored as the
node input property "color_semantic". The display range and hint
are also persisted as "min" / "max" / "tooltip".
NodeParamViewWidgetBridge now branches on "color_semantic":
- "scalar" → 4× FloatSlider (reuses existing ProcessSlider /
keyframe-track logic, since kColor already splits into 4 tracks)
- otherwise → ColorButton (unchanged)
All 4 test suites pass.