Retire the CPU pick: GPU click fallback, then delete pick-only CPU data #704

Closed
opened 2026-10-12 09:39:06 +00:00 by sky_line · 2 comments
Owner

Follow-up to #702, after its GPU-vs-CPU pick mismatch check comes back clean in testing.

Goal: no CPU narrowphase pick left, so the data that exists only for it can go.

Steps

  1. Uncovered clicks run the #702 cursor pass synchronously (one short GPU wait on a rare click) instead of the CPU pick.
  2. The GPU hit record supplies the exact surface data the CPU narrowphase provides today: UV, normal, tangent, face (touch, media, face select, surface info).
  3. Move the other CPU pick callers to the GPU pass: camera focus on click, the single-object surface-info path, the debug raycast, the HUD path.
  4. Rect select (straddling prims), media-focus face normal and planar align read the drawn-slot geometry helpers; move them to a GPU query or LL-side data so the helpers can go.
  5. Delete:
    • 4-bit pick alpha maps on textures (keep a per-texture map only where the RLV overlay touch-block needs it);
    • instance-store pick boxes / grid / stamps and their per-change upkeep;
    • lazily built per-face volume octrees and the glTF primitive octrees;
    • intersectSlot, slotPositions, the alpha-pick narrowphase (LLCleanPickAlpha) and the CPU world/attachment/HUD intersect paths;
    • the CPU particle-group intersect if it is confirmed unused.

Expected: a few tens of MB of RAM, plus the CPU upkeep of the pick broadphase on every instance change.

Also required for "no CPU fallback" (gaps found in #702):

  1. Independent pick selection: the pick reuses the main view's candidate list, which the HUD / probe culls overwrite later in the frame, so an uncovered click can't re-run the GPU pass. Give the pick its own ray-vs-bounds compute over the full instance table (also fixes rigged instances that weren't drawn this frame being unpickable).
  2. Posed vertices outside the main frame: keep the last frame's pre-skinned ranges alive (ring), or pre-skin just the click's rigged candidates.
  3. Fragment list overflow (256 world / 64 HUD, e.g. dense foliage) falls back to the CPU: two-pass count-then-fill, or keep the nearest K.
  4. glTF scene objects: report node / primitive ids in the hit record.
  5. Exact surface data: exact UV (texgen / TE transform applied), normal and tangent for the hit face from the pick shader, so touch, media and face select never re-intersect on the CPU.
  6. Avatar collision volumes: still tested on the CPU -- move to the GPU or deliberately keep.
  7. Verify mismatches seen in testing (same object, different face on layered geometry): resolve or explicitly accept before the CPU reference is deleted.
  8. Require fragment shader stores/atomics (every targeted desktop Vulkan GPU has them) instead of keeping a CPU path for devices without them.
Follow-up to #702, after its GPU-vs-CPU pick mismatch check comes back clean in testing. **Goal:** no CPU narrowphase pick left, so the data that exists only for it can go. **Steps** 1. Uncovered clicks run the #702 cursor pass synchronously (one short GPU wait on a rare click) instead of the CPU pick. 2. The GPU hit record supplies the exact surface data the CPU narrowphase provides today: UV, normal, tangent, face (touch, media, face select, surface info). 3. Move the other CPU pick callers to the GPU pass: camera focus on click, the single-object surface-info path, the debug raycast, the HUD path. 4. Rect select (straddling prims), media-focus face normal and planar align read the drawn-slot geometry helpers; move them to a GPU query or LL-side data so the helpers can go. 5. Delete: - 4-bit pick alpha maps on textures (keep a per-texture map only where the RLV overlay touch-block needs it); - instance-store pick boxes / grid / stamps and their per-change upkeep; - lazily built per-face volume octrees and the glTF primitive octrees; - `intersectSlot`, `slotPositions`, the alpha-pick narrowphase (`LLCleanPickAlpha`) and the CPU world/attachment/HUD intersect paths; - the CPU particle-group intersect if it is confirmed unused. **Expected:** a few tens of MB of RAM, plus the CPU upkeep of the pick broadphase on every instance change. **Also required for "no CPU fallback"** (gaps found in #702): 1. **Independent pick selection:** the pick reuses the main view's candidate list, which the HUD / probe culls overwrite later in the frame, so an uncovered click can't re-run the GPU pass. Give the pick its own ray-vs-bounds compute over the full instance table (also fixes rigged instances that weren't drawn this frame being unpickable). 2. **Posed vertices outside the main frame:** keep the last frame's pre-skinned ranges alive (ring), or pre-skin just the click's rigged candidates. 3. **Fragment list overflow** (256 world / 64 HUD, e.g. dense foliage) falls back to the CPU: two-pass count-then-fill, or keep the nearest K. 4. **glTF scene objects:** report node / primitive ids in the hit record. 5. **Exact surface data:** exact UV (texgen / TE transform applied), normal and tangent for the hit face from the pick shader, so touch, media and face select never re-intersect on the CPU. 6. **Avatar collision volumes:** still tested on the CPU -- move to the GPU or deliberately keep. 7. **Verify mismatches** seen in testing (same object, different face on layered geometry): resolve or explicitly accept before the CPU reference is deleted. 8. **Require fragment shader stores/atomics** (every targeted desktop Vulkan GPU has them) instead of keeping a CPU path for devices without them.
sky_line added this to the Slipstream project 2026-10-12 09:39:06 +00:00
Author
Owner

Agent assigned (Opus). Scope: the steps above plus the 8 'no CPU fallback' items.

Agent assigned (Opus). Scope: the steps above plus the 8 'no CPU fallback' items.
Author
Owner

Shipped in 1.3.0 Beta 7: the CPU pick is retired. Picks answer any ray on the GPU, with exact surface data, and the pick-only CPU data is deleted.

Shipped in 1.3.0 Beta 7: the CPU pick is retired. Picks answer any ray on the GPU, with exact surface data, and the pick-only CPU data is deleted.
sky_line 2026-10-12 15:12:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#704
No description provided.