feat: SG-43127 - 10 bits support with Vulkan (Linux)#1310
Open
cedrik-fuoco-adsk wants to merge 5 commits into
Open
feat: SG-43127 - 10 bits support with Vulkan (Linux)#1310cedrik-fuoco-adsk wants to merge 5 commits into
cedrik-fuoco-adsk wants to merge 5 commits into
Conversation
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>
14adbcf to
d3a3436
Compare
- 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>
d3a3436 to
b38677c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.