(OpenGL) Render Targets#771
Merged
Merged
Conversation
maurhofer-ubique
commented
Jun 16, 2025
Collaborator
- Add render targets for OpenGL
- Move render targets from the RenderPassInterface into the RenderPassConfig (make the easily available in the render calls of a GraphicsObjectInterface)
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for OpenGL render targets by moving render target handling from RenderPassInterface into RenderPassConfig and updating the native and Kotlin layers to manage offscreen framebuffers.
- Introduce a nullable
renderTargetfield inRenderPassConfigand remove the oldgetRenderTargetInterfacemethod. - Update JNI bridge (
NativeRenderPassConfig.cpp) to marshal the newrenderTargetfield. - Extend
OpenGlContextto create, delete, and resume/pause render targets, and update consumer code (MapView,OffscreenMapRenderer) to iterate over them.
Reviewed Changes
Copilot reviewed 71 out of 71 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| bridging/android/jni/graphics/NativeRenderPassConfig.cpp | Add optional renderTarget to JNI mapping |
| android/java/.../RenderPassConfig.kt | Add renderTarget: RenderTargetInterface? |
| android/java/.../RenderPassInterface.kt | Remove obsolete getRenderTargetInterface |
| android/src/.../cpp/graphics/OpenGlRenderTarget.h/.cpp | Implement OpenGlRenderTarget for offscreen framebuffer handling |
| android/src/.../cpp/graphics/OpenGlContext.h/.cpp | Implement OpenGlRenderingContextInterface methods and manage targets |
| android/src/.../MapView.kt, OffscreenMapRenderer.kt | Bind, render, and unbind new render targets each frame |
| android/src/.../SchedulerExtensions.kt | Add addGraphicsTask extension for scheduling on GRAPHICS thread |
| android/build.gradle | Update ndkVersion to latest LTS |
Comments suppressed due to low confidence (1)
android/src/main/cpp/graphics/OpenGlRenderTarget.cpp:51
- The
<<=operator appears to be a typo; it should be<<to appendsize.yin the log message instead of performing a bitwise assignment.
LogError << "Setup of framebuffer (w=" << size.x << ", h=" << size.y <<= ") failed!";
| void OpenGlContext::storeProgram(const std::string &name, int program) { programs[name] = program; } | ||
|
|
||
| void OpenGlContext::cleanAll() { | ||
| for (const auto &target : renderTargets) { |
There was a problem hiding this comment.
[nitpick] The cleanAll method clears each render target's framebuffer but leaves the renderTargets map entries intact; consider calling renderTargets.clear() afterward if you want to drop stale targets entirely.
stmitt
approved these changes
Jun 17, 2025
maerki
approved these changes
Jun 17, 2025
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.