You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Port the IPCore renderer from OpenGL to Qt's QRhi (Qt 6.11), so UTV renders natively on Metal (macOS), Vulkan (Linux/Windows) and Direct3D 12 (Windows). OpenGL would remain only as a fallback. This is a long-term, multi-phase effort.
Why
Everything still renders with OpenGL. The Metal and Vulkan code in UTV today are presenters only. IPCore renders every frame with OpenGL, then hands it across with IOSurface or external-memory interop. That interop is fragile: vendor quirks, AMD Windows caveats, CPU fallbacks.
HDR needs a non-GL swapchain. Qt's HDR swapchain formats (HDR10, HDRExtendedSrgbLinear, HDRExtendedDisplayP3Linear) only exist on the Metal/Vulkan/D3D backends; the QRhi GL backend is SDR-only. A native renderer gets HDR on every platform without cross-API handoffs. feat(macos): EDR and HDR PQ/HLG presentation modes for the Metal view #69 does macOS EDR/HDR natively in the meantime.
One backend-neutral code path instead of GL rendering plus per-platform presenters (MetalView, VulkanView, GLView).
Headless machines could use software Vulkan (Mesa lavapipe, SwiftShader) instead of software OpenGL.
Scope (measured)
Area
Size
Direct GL calls in IPCore / TwkGLF / RvCommon
~840 (304 / 305 / 171)
GL calls in output plugins (AJA, BMD, NDI readback)
The biggest compatibility risk is third-party RV packages that draw with the Mu/Python gl module. A Metal/Vulkan backend can't run their immediate-mode GL directly.
Proposed approach (no regressions)
Golden-image regression suite first. Render reference scenes through utvio and compare with the bundled rmsImageDiff against checked-in references, using per-case tolerances. Cover:
every IPCore color node / GLSL snippet, CDL, LUTs, OCIO views, linearize / log / PQ / HLG;
Abstraction layer. Introduce a thin render-API boundary in TwkGLF / IPCore (textures, FBOs / render targets, uploads, fences, shader programs). The first implementation wraps today's GL calls unchanged, verified against the goldens.
Shaders. Move the GLSL snippets to QRhi's Vulkan-style GLSL, and bake them to SPIR-V / MSL / HLSL with QShaderBaker (QtShaderTools). IPCore composes shaders at runtime, so decide between runtime baking with a cache and pre-baking the finite set of shader combinations.
QRhi on its OpenGL backend first. Output should match the goldens bit for bit (or within tolerance) while the API is still GL underneath.
Switch backends per platform behind a flag: Metal (macOS), Vulkan (Linux), D3D12 (Windows). Keep GL as a selectable fallback. Compare against the goldens on each.
Package compatibility. Keep a GL context for Mu/Python gl overlay drawing: packages draw into a GL texture that's shared/imported into QRhi and composited. Document the deprecation path for immediate-mode GL in packages.
Presentation. Replace MetalView, VulkanView and GLView with one QRhi swapchain presenter (QWindow + QRhiSwapChain via createWindowContainer), including HDR formats and hdrInfo() headroom.
Output devices. Port AJA / BMD / NDI readback from GL PBOs to QRhi readbacks.
Headless.utvio and other offscreen rendering on QRhi with software Vulkan (lavapipe) or the GL fallback on GPU-less machines.
Summary
Port the IPCore renderer from OpenGL to Qt's QRhi (Qt 6.11), so UTV renders natively on Metal (macOS), Vulkan (Linux/Windows) and Direct3D 12 (Windows). OpenGL would remain only as a fallback. This is a long-term, multi-phase effort.
Why
HDR10,HDRExtendedSrgbLinear,HDRExtendedDisplayP3Linear) only exist on the Metal/Vulkan/D3D backends; the QRhi GL backend is SDR-only. A native renderer gets HDR on every platform without cross-API handoffs. feat(macos): EDR and HDR PQ/HLG presentation modes for the Metal view #69 does macOS EDR/HDR natively in the meantime.MetalView,VulkanView,GLView).Scope (measured)
src/lib/ip/IPCore/glsl)ShaderCommon.cpp+ImageRenderer.cppglBegin)The biggest compatibility risk is third-party RV packages that draw with the Mu/Python
glmodule. A Metal/Vulkan backend can't run their immediate-mode GL directly.Proposed approach (no regressions)
Golden-image regression suite first. Render reference scenes through
utvioand compare with the bundledrmsImageDiffagainst checked-in references, using per-case tolerances. Cover:Run it in CI on all OSes (builds on test(ci): add CLI smoke and image format round-trip tests; run ctest in CI #64's
ctestwiring). This is the "nothing breaks" guarantee, and it's valuable even before any porting.Abstraction layer. Introduce a thin render-API boundary in TwkGLF / IPCore (textures, FBOs / render targets, uploads, fences, shader programs). The first implementation wraps today's GL calls unchanged, verified against the goldens.
Shaders. Move the GLSL snippets to QRhi's Vulkan-style GLSL, and bake them to SPIR-V / MSL / HLSL with
QShaderBaker(QtShaderTools). IPCore composes shaders at runtime, so decide between runtime baking with a cache and pre-baking the finite set of shader combinations.QRhi on its OpenGL backend first. Output should match the goldens bit for bit (or within tolerance) while the API is still GL underneath.
Switch backends per platform behind a flag: Metal (macOS), Vulkan (Linux), D3D12 (Windows). Keep GL as a selectable fallback. Compare against the goldens on each.
Package compatibility. Keep a GL context for Mu/Python
gloverlay drawing: packages draw into a GL texture that's shared/imported into QRhi and composited. Document the deprecation path for immediate-mode GL in packages.Presentation. Replace
MetalView,VulkanViewandGLViewwith one QRhi swapchain presenter (QWindow+QRhiSwapChainviacreateWindowContainer), including HDR formats andhdrInfo()headroom.Output devices. Port AJA / BMD / NDI readback from GL PBOs to QRhi readbacks.
Headless.
utvioand other offscreen rendering on QRhi with software Vulkan (lavapipe) or the GL fallback on GPU-less machines.Related
cteston all OSes and the image format round-trip test (the foundation for the golden suite)Code of Conduct