Skip to content

feat: SG-43127 - 10 bits support with Vulkan (Linux)#1310

Open
cedrik-fuoco-adsk wants to merge 5 commits into
AcademySoftwareFoundation:mainfrom
cedrik-fuoco-adsk:vulkan-10bit-linux
Open

feat: SG-43127 - 10 bits support with Vulkan (Linux)#1310
cedrik-fuoco-adsk wants to merge 5 commits into
AcademySoftwareFoundation:mainfrom
cedrik-fuoco-adsk:vulkan-10bit-linux

Conversation

@cedrik-fuoco-adsk

@cedrik-fuoco-adsk cedrik-fuoco-adsk commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

SG-43127 - 10 bits support with Vulkan (Linux)

Linked issues

none

Summarize your change.

Adds a 10-bit Vulkan presentation backend for Linux, enabling 30-bit (RGB10 + A2) display output

New rendering path (Linux 10-bit Vulkan):

When the user requests a 10-bit display (RGB10 + A2) and the hardware/driver supports it, RV now renders through a Vulkan presentation path instead of the usual OpenGL one. The renderer still draws into an offscreen 16-bit float framebuffer using OpenGL as before.

The difference is the final step: instead of presenting that framebuffer through a GLView, the GL color buffer is handed to QTVulkanVideoDevice via a zero-copy GL↔Vulkan interop (the same image memory is shared, not blitted), and VulkanView presents it through a Vulkan swapchain backed by a true 30-bit X11/Wayland visual. This is what gives us real 10-bit output without banding, which the OpenGL path on Linux couldn't do.

Backend selection happens at view-creation time: a 10-bit preference routes to Vulkan when VulkanView::supports10BitPresentation() returns true, and otherwise everything falls back to the existing GLView path unchanged. On the Vulkan path m_glView is null, so GL-widget-dependent pieces like DiagnosticsView aren't created.


Platform-neutral view abstraction:

RvDocument is decoupled from GLView by routing the active view through a generic QWidget* m_viewWidget / viewWidget() accessor instead of hardcoding m_glView at every shared call site (focus, geometry, stacked-layout, popup/menu coordinate mapping). RvApplication now tolerates a null view/GL context and uses the session's control video device for the primary display group. The GL path is unchanged; this is the shared base for both the Metal (macOS) and Vulkan (Linux) backends.


Vulkan backend (Linux):

Adds VulkanView (a Vulkan swapchain over a 30-bit visual) and QTVulkanVideoDevice (offscreen 16F FBO + GL↔Vulkan zero-copy interop), wired into RvDocument behind #if defined(PLATFORM_LINUX). Backend selection is driven by the display-depth preference: a 10-bit request routes to Vulkan when VulkanView::supports10BitPresentation() is true, otherwise it falls back to the OpenGL GLView. Vulkan headers + loader are fetched as a managed Linux dependency (cmake/dependencies/vulkan.cmake) and linked on Linux.

Describe the reason for the change.

OpenRV's OpenGL presentation path on Linux is currently limited to 8-bit output, which causes visible banding on 10-bit-capable displays. Vulkan provides reliable access to 30-bit swapchain formats on modern X11/Wayland drivers, allowing true 10-bit presentation. The view abstraction was extracted first so the new backend could be plugged in cleanly without disturbing the existing GL path, and so the same base can be shared with the macOS Metal backend.

Describe what you have tested and on which operating system.

Add a list of changes, and note any that might need special attention during the review.

If possible, provide screenshots.

Decouple RvDocument from GLView by routing the active view through a
generic QWidget* m_viewWidget and a viewWidget() accessor, instead of
hardcoding m_glView at every shared call site (focus, geometry,
stacked-layout, popup/menu coordinate mapping in Mu/Py UI commands).

RvApplication now tolerates a null view()/GL context and uses the
session's control video device for the primary display group, so an
alternative presentation backend can be plugged in.

No backend-specific code is introduced here; the GL path behaves exactly
as before. This is the shared base for the Metal (macOS) and Vulkan
(Linux) 10-bit presentation backends.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Builds on the neutral view-abstraction base. Adds VulkanView (a Vulkan
swapchain over a 30-bit X11/Wayland visual) and QTVulkanVideoDevice
(offscreen 16F FBO + GL<->Vulkan zero-copy interop), wired into
RvDocument behind '#if defined(PLATFORM_LINUX)'.

Backend selection is driven by the display-depth preference: a 10-bit
request (RGB10 + A2) routes to Vulkan when VulkanView::supports10Bit
Presentation() is true, otherwise it falls back to the OpenGL GLView.
On the Vulkan path m_glView is null, so DiagnosticsView (a QOpenGLWidget)
is not created.

Vulkan (headers + loader) is fetched as a managed Linux dependency
(cmake/dependencies/vulkan.cmake) and linked unconditionally on Linux.
The shared view plumbing lives in the neutral base; this commit only
adds the Vulkan-specific pieces.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
- Replaced platform-specific size policy and content size handling with unified methods for setting active view sizes.
- Introduced new methods: setActiveViewContentSize, setActiveViewMinimumContentSize, and activeViewFirstPaintCompleted to enhance code clarity and maintainability.
- Updated resize logic to utilize the new methods, ensuring consistent behavior across platforms.

This refactor simplifies the management of view sizes and improves the overall structure of the RvDocument class.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
- Added QTVulkanVideoDevice, a new class that serves as a GL-to-Vulkan bridge, enabling 10-bit display on Linux by transferring frames from an OpenGL rendering pipeline to a Vulkan swapchain.
- Implemented lifecycle management for VulkanView, including lazy GL context setup and buffer synchronization.
- Enhanced video device API to support Vulkan, ensuring compatibility with existing GLVideoDevice functionality.
- Updated main application to ensure all QOpenGLContexts share resources, preventing issues with font texture uploads.

This addition significantly improves rendering capabilities on Linux platforms, leveraging Vulkan's advanced features.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant