#1176 Show Physics Shape When Editing (eye on Edit > Features), drawn on the GPU #1181
No reviewers
Labels
No labels
amd
avatars
bug
builder
cannot-reproduce
crash
epic
feature
from-viewer
gl-removal
known-limitation
monitoring
parity
perf
platform
priority
critical
priority
high
priority
low
priority
medium
provenance
rendering
rt
status
in-progress
status
testing
status
up-next
triage
ui
upstream
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sky_line/Slipstream!1181
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "TheSlowly/Slipstream:edit-physics-view-1176"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1176: an eye beside Physics Shape Type (and Build > Options > Show Physics Shape When Editing) draws the physics shapes of the selected objects while editing.
Rewritten as agreed in the review: GPU-driven, with no per-frame CPU work.
Tested in-world on a linked mesh build: placeholders while the physics data downloads, then the hulls.
Review (Sky + Claude): changes requested — not mergeable yet.
Blocker, GPU-driven rule:
pipeline.cpp:1829builds a selection vector on every rendered overlay frame,:1845culls and sorts it on the CPU, then:1852runs four physics-shape passes;vkPhysicsShapePass(:1723) loops objects andvkPushVolume(:1484) walks faces/triangles and emits transformed vertices on the CPU through gGL. That turns a debug-only overlay into a per-frame CPU geometry path while editing, which the renderer rules forbid for new paths (persistent instance data + GPU culling + indirect draws; see doc/DEVELOPER_GUIDE.md section 5).What it needs: keep physics geometry in bounded persistent stores, update only selection / transform / shape deltas, classify and draw on the GPU (indirect), with soft handling of allocation / decomposition failures. Keep the attachment-transform / HUD exclusion and the hidden/visible overlay semantics. Check the depth-bias change against the existing GREATER/GEQUAL overlays (reverse-Z and ortho) since it touches shared overlay ordering. This probably wants a short design note before the rewrite — happy to look at one.
Naming: the commit subject and PR text name another viewer; please describe the feature without naming other viewers (repo rule; credit goes in the release notes / About).
ShowPhysicsShapeInEditas a persisted preference is fine.Thanks, agreed on all points. Here's the plan for the rewrite:
captureRawSlot, like the system bodies. Shapes are refcounted under a 16 MB LRU. A failed build retries, then shows a magenta box.29ee8ef03a) is reverted, so other overlays are untouched.Unless you see a problem, I'll go ahead with this.
Go ahead. The plan fits the renderer's rules: shapes built once into shared, bounded storage, no per-frame CPU work, indirect draws filled on the GPU, the object's own instance row reused, and the shared overlay bias change reverted.
Two small asks:
Thanks!
29ee8ef03ato4e99117ebe#1176 Show Physics Shape When Editing (eye on Edit > Features)to #1176 Show Physics Shape When Editing (eye on Edit > Features), drawn on the GPUDone and pushed (
4e99117ebe, rebased on current main). It follows the plan, plus your two asks:constexprconstants; the only setting is the user toggle.Since the plan:
Tested in-world on a linked mesh build.
Review: one small fix before merge.
llcleanphysshape.cpp~93-104 uses the results of the twoll_aligned_malloc_16calls without checking for null.ll_aligned_malloc_16returns null on failure rather than throwing, so thebad_alloccatch doesn't cover it, and either failure crashes. Our rule is that allocation failure never crashes. Please allocate into locals, check both, free the partial allocation if only one succeeded, and assign the members only on success. Otherwise return; the existing!mHullPointspath already retries later.Done in
ccbbd19bd0: both buffers are allocated into locals and checked. If either fails, the one that succeeded is freed and a one-time warning is logged. The members are only set on success, so the!mHullPointspath retries later.Thanks! The full #1176 series is on main through the Beta 6 port, and main is ahead of this branch (allocation-failure-safe prim hull build and the stereo guard). Closing as landed.
Pull request closed