Feature/vulkan 1.3#650
Conversation
….0.0. The top-level maplibre-native fork was never wired into CMake; MapLibre builds from maplibre-native-qt/vendor/maplibre-native. Point maplibre-native-qt at upstream 4.0.0 for Vulkan/RHI support.
Replace the OpenGL application rendering path with QRhi/Vulkan overlays and remove GL build dependencies so performance work starts from a verified Vulkan baseline.
There was a problem hiding this comment.
Pull request overview
This PR is an early-stage migration of Supercell Wx’s rendering stack from an OpenGL/QOpenGLWidget-based approach to a Vulkan 1.3 + Qt QRhi-based renderer, including new QRhi overlay renderers, Vulkan device/context setup, and local smoke-test tooling to validate visible Vulkan output.
Changes:
- Introduces Vulkan/QRhi render infrastructure (context, overlays/pipelines, shader loading, projections) and wires it into map rendering.
- Refactors map layers/draw items to accept a
RenderContextand (when enabled) render via Vulkan overlay paths. - Updates build/deps/docs for Vulkan (MapLibre Qt Vulkan config, ImGui Vulkan backend, removes OpenGL/GLU/glad usage) and adds Vulkan smoke tooling.
Reviewed changes
Copilot reviewed 137 out of 150 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| wxdata/wxdata.cmake | Adjusts GCC warning suppressions for -Werror builds. |
| tools/vulkan-smoke.sh | Adds a local Vulkan backend smoke-runner script. |
| tools/analyze-vulkan-capture.py | Adds screenshot analysis to validate Vulkan-visible output. |
| scwx-qt/source/scwx/qt/vk/vk_context.hpp | Declares a Vulkan device/context wrapper. |
| scwx-qt/source/scwx/qt/vk/vk_context.cpp | Implements Vulkan instance + physical/logical device selection and setup. |
| scwx-qt/source/scwx/qt/vk/vk_check.hpp | Adds a VkResult checking helper/macro. |
| scwx-qt/source/scwx/qt/util/texture_atlas.hpp | Refactors atlas API toward Vulkan/QRhi consumption. |
| scwx-qt/source/scwx/qt/util/texture_atlas.cpp | Exposes atlas layer geometry/pixels for non-OpenGL upload paths. |
| scwx-qt/source/scwx/qt/util/polygon_triangulation.hpp | Adds polygon triangulation API (earcut wrapper). |
| scwx-qt/source/scwx/qt/util/polygon_triangulation.cpp | Implements triangulation via mapbox/earcut. |
| scwx-qt/source/scwx/qt/ui/imgui_debug_widget.hpp | Updates ImGui debug widget to no longer depend on QOpenGLWidget. |
| scwx-qt/source/scwx/qt/ui/imgui_debug_widget.cpp | Removes OpenGL ImGui backend usage from debug widget. |
| scwx-qt/source/scwx/qt/types/imgui_font.cpp | Adjusts ImGui font creation to respect the active atlas/context. |
| scwx-qt/source/scwx/qt/render/rhi_vulkan_overlay.hpp | Defines a resource bundle passed into Vulkan overlay render calls. |
| scwx-qt/source/scwx/qt/render/rhi_texture_array_overlay.hpp | Declares texture-array overlay renderer for Vulkan/QRhi. |
| scwx-qt/source/scwx/qt/render/rhi_texture_array_overlay.cpp | Implements QRhi pipelines/resources for texture array overlays and atlas sync. |
| scwx-qt/source/scwx/qt/render/rhi_shader_util.hpp | Declares SPIR-V shader loading helper. |
| scwx-qt/source/scwx/qt/render/rhi_shader_util.cpp | Implements SPIR-V shader loading into QShader. |
| scwx-qt/source/scwx/qt/render/rhi_radar_overlay.hpp | Declares Vulkan radar overlay renderer (uniforms + buffers). |
| scwx-qt/source/scwx/qt/render/rhi_radar_overlay.cpp | Implements Vulkan radar overlay rendering via QRhi. |
| scwx-qt/source/scwx/qt/render/rhi_imgui_util.hpp | Declares helper to render ImGui draw data via Vulkan command buffers. |
| scwx-qt/source/scwx/qt/render/rhi_imgui_util.cpp | Implements ImGui Vulkan render call bridging from QRhi command buffers. |
| scwx-qt/source/scwx/qt/render/rhi_geo_uniforms.hpp | Declares geo uniform packing for Vulkan pipelines. |
| scwx-qt/source/scwx/qt/render/rhi_geo_uniforms.cpp | Implements geo uniform construction for Vulkan paths. |
| scwx-qt/source/scwx/qt/render/rhi_geo_colored_geometry.hpp | Declares Vulkan geo-colored geometry renderer. |
| scwx-qt/source/scwx/qt/render/rhi_geo_colored_geometry.cpp | Implements Vulkan geo-colored geometry rendering pipeline/buffers. |
| scwx-qt/source/scwx/qt/render/rhi_colored_geometry.hpp | Declares Vulkan screen-space colored geometry renderer. |
| scwx-qt/source/scwx/qt/render/rhi_colored_geometry.cpp | Implements Vulkan colored geometry pipeline/buffers. |
| scwx-qt/source/scwx/qt/render/rhi_color_table_overlay.hpp | Declares Vulkan color table overlay renderer. |
| scwx-qt/source/scwx/qt/render/rhi_color_table_overlay.cpp | Implements Vulkan color table rendering (QRhi texture upload + draw). |
| scwx-qt/source/scwx/qt/render/rhi_buffer_util.hpp | Declares helper for resizing/creating dynamic QRhi buffers. |
| scwx-qt/source/scwx/qt/render/rhi_buffer_util.cpp | Implements dynamic buffer ensure/resize logic. |
| scwx-qt/source/scwx/qt/render/render_init.hpp | Declares graphics initialization entry point. |
| scwx-qt/source/scwx/qt/render/render_init.cpp | Logs/initializes selected render backend. |
| scwx-qt/source/scwx/qt/render/render_context.hpp | Introduces backend-agnostic RenderContext interface. |
| scwx-qt/source/scwx/qt/render/render_context.cpp | Adds a (currently stub) Vulkan render context factory. |
| scwx-qt/source/scwx/qt/render/render_backend.hpp | Defines render backend enum and default selection. |
| scwx-qt/source/scwx/qt/render/projection.hpp | Adds projection/CPU-transform helpers for Vulkan rendering paths. |
| scwx-qt/source/scwx/qt/render/projection.cpp | Implements CPU transforms for map-colored vertex data. |
| scwx-qt/source/scwx/qt/model/imgui_context_model.hpp | Extends ImGui context creation to allow atlas sharing control. |
| scwx-qt/source/scwx/qt/model/imgui_context_model.cpp | Implements atlas-sharing option + atlas selection for NewFrame updates. |
| scwx-qt/source/scwx/qt/map/radar_site_layer.hpp | Converts layer to accept RenderContext and adds Vulkan overlay hooks. |
| scwx-qt/source/scwx/qt/map/radar_site_layer.cpp | Refactors visibility/transform logic and adds Vulkan overlay + ImGui split rendering. |
| scwx-qt/source/scwx/qt/map/radar_product_layer.hpp | Converts layer to accept RenderContext and adds Vulkan overlay hook. |
| scwx-qt/source/scwx/qt/map/placefile_layer.hpp | Converts layer to accept RenderContext and adds Vulkan overlay hooks. |
| scwx-qt/source/scwx/qt/map/placefile_layer.cpp | Adds Vulkan overlay + ImGui split rendering paths for placefiles. |
| scwx-qt/source/scwx/qt/map/overlay_product_layer.hpp | Converts layer to accept RenderContext. |
| scwx-qt/source/scwx/qt/map/overlay_product_layer.cpp | Migrates to RenderContext and removes OpenGL error checking. |
| scwx-qt/source/scwx/qt/map/overlay_layer.hpp | Converts layer to accept RenderContext and adds Vulkan overlay hooks. |
| scwx-qt/source/scwx/qt/map/marker_layer.hpp | Converts layer to accept RenderContext. |
| scwx-qt/source/scwx/qt/map/marker_layer.cpp | Migrates to RenderContext and removes OpenGL error checking. |
| scwx-qt/source/scwx/qt/map/map_widget.hpp | Switches map widget base to QRhiWidget and updates lifecycle overrides. |
| scwx-qt/source/scwx/qt/map/map_rhi_renderer.hpp | Adds a QRhi-to-MapLibre renderer bridge. |
| scwx-qt/source/scwx/qt/map/map_rhi_renderer.cpp | Implements Vulkan-native handle wiring for MapLibre rendering. |
| scwx-qt/source/scwx/qt/map/map_overlay_renderer.hpp | Adds Vulkan overlay renderer orchestrator for layers + ImGui. |
| scwx-qt/source/scwx/qt/map/map_overlay_renderer.cpp | Implements overlay render pass creation + per-layer Vulkan overlay dispatch. |
| scwx-qt/source/scwx/qt/map/map_imgui_vulkan_renderer.hpp | Adds an ImGui Vulkan backend manager for map panes. |
| scwx-qt/source/scwx/qt/map/map_imgui_vulkan_renderer.cpp | Implements ImGui Vulkan init/reinit, per-frame, and texture updates. |
| scwx-qt/source/scwx/qt/map/map_annotation_layer.hpp | Converts layer to accept RenderContext and adds Vulkan overlay hook. |
| scwx-qt/source/scwx/qt/map/map_annotation_layer.cpp | Adds Vulkan overlay rendering path and disables legacy Render under Vulkan. |
| scwx-qt/source/scwx/qt/map/layer_wrapper.cpp | Disables MapLibre custom-layer render callback when using Vulkan backend. |
| scwx-qt/source/scwx/qt/map/generic_layer.hpp | Migrates base layer to hold RenderContext and introduces Vulkan overlay virtual. |
| scwx-qt/source/scwx/qt/map/generic_layer.cpp | Implements RenderContext storage and no-op default Vulkan overlay. |
| scwx-qt/source/scwx/qt/map/draw_layer.hpp | Migrates draw-layer base to RenderContext and adds Vulkan overlay helpers. |
| scwx-qt/source/scwx/qt/map/draw_layer.cpp | Removes OpenGL draw path and adds Vulkan ImGui frame helpers + Vulkan draw dispatch. |
| scwx-qt/source/scwx/qt/map/color_table_layer.hpp | Migrates to RenderContext and adds Vulkan overlay hook. |
| scwx-qt/source/scwx/qt/map/color_table_layer.cpp | Replaces OpenGL color table rendering with Vulkan/QRhi overlay path. |
| scwx-qt/source/scwx/qt/map/alert_layer.hpp | Migrates to RenderContext. |
| scwx-qt/source/scwx/qt/map/alert_layer.cpp | Migrates to RenderContext and removes OpenGL error checking. |
| scwx-qt/source/scwx/qt/manager/font_manager.hpp | Adds ImGui font build helper for Vulkan/multi-atlas usage. |
| scwx-qt/source/scwx/qt/manager/font_manager.cpp | Refactors ImGui font caching to be per-ImFontAtlas and supports multi-atlas backends. |
| scwx-qt/source/scwx/qt/main/main.cpp | Replaces OpenGL init with render backend initialization. |
| scwx-qt/source/scwx/qt/main/main_window.cpp | Replaces GlContext storage with RenderContext and updates MapWidget construction. |
| scwx-qt/source/scwx/qt/gl/shader_program.hpp | Removes OpenGL shader program wrapper (deleted). |
| scwx-qt/source/scwx/qt/gl/shader_program.cpp | Removes OpenGL shader program implementation (deleted). |
| scwx-qt/source/scwx/qt/gl/gl.hpp | Removes OpenGL error macro header (deleted). |
| scwx-qt/source/scwx/qt/gl/gl_context.hpp | Removes OpenGL context wrapper (deleted). |
| scwx-qt/source/scwx/qt/gl/gl_context.cpp | Removes OpenGL context implementation (deleted). |
| scwx-qt/source/scwx/qt/gl/draw/rectangle.hpp | Updates draw item to accept RenderContext and adds Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.cpp | Ports triangle rendering toward Vulkan with CPU-side transform path. |
| scwx-qt/source/scwx/qt/gl/draw/placefile_text.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/placefile_text.cpp | Adds no-op Vulkan render stub for text (placeholder). |
| scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/placefile_lines.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/placefile_images.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/placefile_images_xy.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/placefile_icons.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/map_annotations_draw_item.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/linked_vectors.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/linked_vectors.cpp | Adds Vulkan render hook wiring for linked vectors. |
| scwx-qt/source/scwx/qt/gl/draw/icons.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/icons.cpp | Ports icon drawing toward Vulkan texture-array overlay rendering. |
| scwx-qt/source/scwx/qt/gl/draw/geo_lines.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/geo_icons.hpp | Updates draw item for RenderContext and Vulkan render hook. |
| scwx-qt/source/scwx/qt/gl/draw/draw_item.hpp | Adds Vulkan render virtual and migrates away from GL helpers. |
| scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp | Removes OpenGL projection helpers and adds default Vulkan no-op. |
| scwx-qt/scwx-qt.qrc | Adds Vulkan SPIR-V shader resources to Qt resource system. |
| scwx-qt/gl/vulkan/texture1d.vert | Adds Vulkan GLSL shader source for texture1d vertex stage. |
| scwx-qt/gl/vulkan/texture1d.frag | Adds Vulkan GLSL shader source for texture1d fragment stage. |
| scwx-qt/gl/vulkan/texture_lut.frag | Adds LUT sampling fragment shader source. |
| scwx-qt/gl/vulkan/screen_texture_array.vert | Adds screen-space texture-array vertex shader source. |
| scwx-qt/gl/vulkan/screen_texture_array.frag | Adds screen-space texture-array fragment shader source. |
| scwx-qt/gl/vulkan/radar.vert | Adds radar overlay vertex shader source. |
| scwx-qt/gl/vulkan/radar.frag | Adds radar overlay fragment shader source. |
| scwx-qt/gl/vulkan/geo_texture_array.vert | Adds geo texture-array vertex shader source. |
| scwx-qt/gl/vulkan/geo_texture_array.frag | Adds geo texture-array fragment shader source. |
| scwx-qt/gl/vulkan/geo_color.vert | Adds geo colored-geometry vertex shader source. |
| scwx-qt/gl/vulkan/geo_color.frag | Adds geo colored-geometry fragment shader source. |
| scwx-qt/gl/vulkan/color.vert | Adds colored-geometry vertex shader source. |
| scwx-qt/gl/vulkan/color.frag | Adds colored-geometry fragment shader source. |
| README.md | Updates Linux rendering requirements to Vulkan 1.3. |
| external/maplibre-native-qt.cmake | Configures MapLibre Qt build for Vulkan, disables OpenGL, adjusts warnings/includes. |
| external/imgui.cmake | Enables ImGui Vulkan backend when building with Vulkan and links Vulkan. |
| external/CMakeLists.txt | Stops including glad external when OpenGL is removed. |
| conanfile.py | Removes Linux OpenGL/GLU system requirements. |
| CMakePresets.json | Adds a Vulkan-enabled Linux preset. |
| CMakeLists.txt | Adds SCWX_RENDER_BACKEND cache variable with Vulkan default. |
| AGENTS.md | Updates contributor guide to reflect Vulkan/QRhi primitives path. |
| ACKNOWLEDGEMENTS.md | Updates Qt module list wording (drops Qt OpenGL mention). |
| .gitmodules | Switches MapLibre Qt submodule upstream URL and removes maplibre-native submodule. |
| .github/workflows/ci.yml | Removes GLU copy step from Flatpak packaging. |
| if (floatVertices.empty()) | ||
| { | ||
| return {}; | ||
| } | ||
|
|
||
| const GeoUniforms uniforms = | ||
| BuildGeoUniforms(params, thresholded, selectedTime); | ||
| const glm::vec2 mapScreenCoord = util::maplibre::LatLongToScreenCoordinate( | ||
| {params.latitude, params.longitude}); | ||
|
|
||
| const std::size_t vertexCount = | ||
| floatVertices.size() / kMapColorFloatsPerVertex_; | ||
| std::vector<float> transformed; | ||
| transformed.reserve(vertexCount * kColoredFloatsPerVertex_); | ||
|
|
| const boost::gil::rgba8_image_t& image = p->atlasArray_[layer]; | ||
| const boost::gil::rgba8c_view_t view = boost::gil::const_view(image); | ||
| byteSize = image.width() * image.height() * sizeof(boost::gil::rgba8_pixel_t); | ||
| return reinterpret_cast<const std::uint8_t*>(&view(0, 0)); |
| uint32_t extensionCount = 0; | ||
| vkEnumerateDeviceExtensionProperties( | ||
| device, nullptr, &extensionCount, nullptr); | ||
|
|
||
| std::vector<VkExtensionProperties> extensions(extensionCount); | ||
| vkEnumerateDeviceExtensionProperties( | ||
| device, nullptr, &extensionCount, extensions.data()); |
| if [[ ! -x "${BIN}" ]]; then | ||
| echo "Missing binary: ${BIN}" >&2 | ||
| exit 1 | ||
| fi |
Cache radar and geo line GPU uploads, coalesce resize and splitter work, and route alert/STI updates through the Vulkan overlay path so loaded polygons no longer stall pan and resize.
Upstream ImGui bump moved RenderPass into PipelineInfoMain and renamed descriptor pool size constants.
Build alert polygons once per phenomenon across panes instead of per MapWidget. Post refresh timer signals on the Qt main thread. Remove ImGuiSelectContext on radar-site click so Vulkan keeps MapWidget context.
Move CI and review workflows to clang-21, add ccache and libvulkan-dev on Linux, and ship helper scripts that mirror pipeline checks locally. Relax clang-tidy rules that are noisy for Qt/QRhi and graphics code.
Remove OpenGL shader assets and the old Vulkan context wrapper now that rendering goes through Qt QRhi with SPIR-V resources in scwx-qt.cmake.
Add RHI helpers for colored geometry, radar sweeps, texture arrays, and color tables used by the Vulkan map overlay path.
Route map paint through RHI/Vulkan renderers, share basemap textures across linked panes, and replace layer_wrapper with focused helpers.
Update geo/placefile draw paths for QRhi buffers and stroke styling, including texture atlas and annotation layer integration.
Capture geo-line weak_ptr by value in event handlers, guard segment lookup with a mutex, and batch alert geometry refresh during warnings backfill.
Hide incomplete radar products, simplify radar-site overlay ImGui, and align overlay, marker, and placefile layers with the RHI map path.
Add unit tests for geo stroke banding, basemap texture sharing, and map perf counters introduced with the QRhi map refactor.
Use portable env helpers instead of getenv, fix ImGui shared atlas lifetime, align overlay forward declarations, gate Clang-only MapLibre flags, and update CI workflows for the Vulkan migration.
Gate unsupported Clang warning flags, allow macOS MapLibre configure without Qt Vulkan headers, and route env-var tests through wxdata helpers.
Remove dead OpenGL branches and glad, move draw code out of gl/, and add pipeline cache persistence plus device-lost recovery. Unify Clang CI and macOS dev tooling on LLVM 22.
|
cursor review verbose=true |
|
Bugbot request id: serverGenReqId_b9852a76-803c-4044-8640-6dbad1cfb395 |
Gate LLVM 22 install to Linux, add a local git-diff fallback for oversized clang-tidy PR diffs, apply clang-format, and remove an unused storm-track constant. Fix alert geo-line click crashes via AlertLayerHandler and keep hover tooltips visible while the cursor is stationary.
|
@cursor Please review this PR for bugs, threading/lifetime safety, and missing Vulkan error handling. Focus on the QRhi/Vulkan render path. Post findings as a summary comment with file:line references. Do not commit or push changes. |
Code review: QRhi/Vulkan render pathFocused on bugs, threading/lifetime safety, and missing Vulkan error handling. File:line refs are against the PR branch ( Critical / high1. Global
Problems:
Suggested fix: store handler per- 2. Basemap sharing copies a leader Follower path:
If panes truly have independent 3.
Threading / lifetime (medium)4. Basemap share has no frame synchronization despite tracking generation
With multiple Suggested fix: expose generation via callbacks; skip follower copy until 5. MapLibre basemap render is issued outside the active
There is no explicit queue submission / semaphore / barrier between MapLibre finishing its write to 6.
Missing Vulkan / QRhi error handling (medium)7. Several hot-path render uploads assume a non-null batch:
Only init path in 8. Direct Pipeline cache helpers call Vulkan directly without logging or the installed handler:
ImGui integration wires 9. On recreate failure ( Notes / lower severity
Happy to re-review after fixes. I did not run the build on this pass; findings are from static analysis of the PR branch. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Important Review skippedToo many files! This PR contains 211 files, which is 61 over the limit of 150. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (211)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
initial draft pr for move to vulkan. Very early stages, feel free to pull the branch and play around with it. CI build will probably fail a bunch initially.
Will update the PR with more information as more progress is made.