Repository navigation
Step 3: stop re-uploading GPU buffers while dragging a session's gizmo - #553
Merged
JanuszBedkowski merged 3 commits intoOct 7, 2026
Merged
Conversation
michalpelka
marked this pull request as draft
October 5, 2026 15:12
michalpelka
force-pushed
the
mp/step3-fix-gizmo-drag-gpu-churn
branch
3 times, most recently
from
October 6, 2026 10:54
77faf95 to
87e7c67
Compare
- GPU churn fix (headline): gizmo drag no longer rewrites every scan's pose each frame — candidate poses are stashed and drawn via a transform-only path until the drag ends, so point buffers aren't torn down/re-uploaded every frame. Drag preview also now respects the real color mode (not flat-only). - Loop-closure edge UI: added sliders for active edge / source / target indices (fixes MapsHD#549), aligned on one line with their InputInts. - Intersections (xz/yz/xy slicing): ported step 2's View > Intersections menu to step 3 (global toggles instead of per-session), added grid overlays and per-session export, and wired it into the loop-closure/drag preview rendering too. - save_intersection() dedup: moved the per-session slab-export code into shared Core/export_laz.h; fixed a latent array-desync bug (timestamps array could end up shorter than intensity/pointcloud) found while moving it; removed the now-ambiguous legacy duplicate that broke MSVC/Windows CI. - ICP ground-truth bug: fixed source being built from the edge's raw (un-reordered) index instead of the swapped local, which silently aligned the ground-truth scan against a filtered copy of itself when ground truth was on the edge's "to" side. - Edge-activation crash hardening: fixed inverted bounds check + wrong index type in canEdgeBeActivated(), stale-session bug in setActiveEdge(), a visibility-set collapse bug in settings_gui(), and a session-index mismatch in display()'s active-edge rendering (indexing one session's data with another session's bounds). Also fixed loop-closure open/close lifecycle not firing on title-bar close, and a disabled "Set Active" button that didn't actually disable. - Safety net: removed a blanket top-level catch(...) that was silently swallowing exceptions (including the above bugs) and returning 0; added HDMAPPING_ASSERT (survives NDEBUG, aborts in debug, logs in release unless HDMAPPING_ASSERT_ALWAYS_ABORT). - Cleanup: removed ~200 lines of dead pre-raylib/GLUT code from multi_session_registration.cpp. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
michalpelka
force-pushed
the
mp/step3-fix-gizmo-drag-gpu-churn
branch
from
October 6, 2026 11:50
87e7c67 to
0f41456
Compare
Each "Export xz/yz/xy intersection" item passed all three xz_intersection/yz_intersection/xy_intersection flags to save_intersection()/export_intersection_all_sessions() instead of just its own plane, so enabling more than one plane made every export button dump the same union of slabs. Fixed in step 3, step 2, and the legacy step 2 app. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
michalpelka
marked this pull request as ready for review
October 7, 2026 02:45
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
m_poseevery frame, which forcedScanRenderer::syncPoses()to tear down and re-upload each scan's full GPU point buffer every single frame for as long as the drag lasted (visible as a stream ofVAO: [ID ...] Unloaded...log lines while dragging). Merely selecting a gizmo (not even dragging) triggered the same rebuild, because adouble -> float -> doubleround trip through the gizmo matrix was enough float noise to look like a pose change every frame.ImGuizmo::IsUsing()is true, the candidate pose chain is now stashed insession_drag_preview_posesinstead of being written into the session; the render loop draws it viaScanRenderer::drawCachedWithTransform()(pose folded into the MVP, no GPU re-upload) until the drag ends, at which point the pose is committed for real — the only frame that triggers an actual rebuild.drawCachedWithTransform()only supported a flat/intensity bool, so the drag preview rendered flat-colored instead of matching the scene's live per-point shading (View > Points color, elevation/distance bounds). It now takes the realScanColorModeplus the elevation/distance bounds those modes need, defaulting toFlatso the existing loop-closure edge preview callers (step 2 and step 3) keep their current look; the drag preview opts in viarenderScanAtPose()'s newuseSceneColorModeflag.multi_session_registration.cpp'sdisplay()(referenced asessionvariable and GLUT/legacy-GL calls no longer present in this file).Test plan
multi_session_registration_step_3andmulti_view_tls_registration_step_2both build cleanly (RelWithDebInfo, clang-18).VAO: [ID ...] Unloaded...per frame, and the dragged session now shades the same way as the rest of the scene instead of going flat.gizmo_all_sessions(move-everything) on a multi-session project before merging.🤖 Generated with Claude Code