Implement GLSL rendering for M420 and NV12#14913
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds GPU (GLSL) color conversion/rendering support for the M420 and NV12 formats in the RealSense GL pipeline, and wires the new capability through the public GL processing API and the viewer upload path.
Changes:
- Implement GLSL fragment shader-based conversion for M420 and introduce a new NV12 GLSL converter with CPU fallback via
dual_processing_block. - Expose an NV12 GL decoder in the C/C++ GL processing APIs and export it from the GL shared library.
- Update the viewer/rendering upload path to handle M420 and NV12, and remove them from the “rendering not supported” list.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/gl/rs-gl.cpp |
Adds rs2_gl_create_nv12_decoder and wires it into the GL processing-block factory with CPU fallback. |
src/gl/realsense-gl.def |
Exports the new NV12 GL decoder symbol on Windows. |
src/gl/nv12-to-rgb-gl.h |
Declares the new librealsense::gl::nv12_to_rgb GPU processing block. |
src/gl/nv12-to-rgb-gl.cpp |
Implements the NV12 GLSL shader and processing block (texture upload + FBO render to RGB). |
src/gl/m420-to-rgb-gl.cpp |
Replaces the prior “not supported” runtime error with a working GLSL shader path for M420. |
src/gl/CMakeLists.txt |
Adds the new NV12 GL converter sources to the GL library build. |
include/librealsense2-gl/rs_processing_gl.hpp |
Introduces rs2::gl::nv12_decoder C++ wrapper class. |
include/librealsense2-gl/rs_processing_gl.h |
Adds the C API declaration for rs2_gl_create_nv12_decoder. |
common/viewer.cpp |
Stops flagging M420/NV12 as “rendering not supported” in the viewer UI. |
common/subdevice-model.cpp |
Switches NV12 conversion to use the new GL decoder wrapper. |
common/rendering.h |
Adds M420 and NV12 handling to the texture upload/render path (using the processing blocks). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Test plan
M420 on D585S

NV12 on platform camera

🤖 Generated with Claude Code