Right-size the avatar joint-slot tables (no fixed cap) #762

Open
opened 2026-10-14 17:11:32 +00:00 by sky_line · 0 comments
Owner

The renderer caches skinning joints for animated characters (avatars, animesh control avatars, and flexi prims packed 24 chains per slot) in a fixed table of avatar slots. The cap was a hard-coded 256 (raised to 1024 as a stopgap). Replace the fixed cap with buffers that are sized to demand and grow.

Today

  • Joint table + per-slot CPU arrays (LLCleanSkinStore::MAX_AVATARS), ~10-14 KB per slot.
  • Avatar visibility table (kAvVisSlots) with compile-time section offsets (kCasterBase, kAvBoxBase, kAvLodBase ...) shared by C++ and GLSL.
  • Cluster draw-list avatar masks (rig_bits, fixed words in a uniform struct).
  • Cluster instance flags packing the slot index into a fixed bit field (CLI1B_AV_SHIFT).
  • RT per-avatar masks, admitted / layer bitsets, kSkinAvRows / kRigAvRows.
  • ~170 C++ references in 15 files, ~50 in 36 shaders.

Goal

  • Start small (e.g. 64 slots), grow by doubling with no fixed ceiling short of the VRAM budget; shrink after a grace period like the other stores (free on liveness).
  • Runtime slot capacity read by shaders (no compile-time 256/1024); masks as word buffers indexed by slot >> 5; slot index in its own word (or a field wide enough for any capacity).
  • Growth = reallocate + copy + descriptor update (same pattern as the rigged skin buffers); at most a one-frame blip, only past the previous high-water.
  • Log live / capacity / peak slots.
  • Debug check that clamps + logs any out-of-range slot index (a missed reader would otherwise index past a buffer on the GPU).
  • Allocation failure never crashes (retry later, then drop + log).

Notes

  • Past the cap today, with cluster LOD off a new character falls back to static (unskinned) geometry; with cluster LOD on it is cluster-owned with no slot and does not draw. Right-sizing removes the cap rather than adding a fallback path.
The renderer caches skinning joints for animated characters (avatars, animesh control avatars, and flexi prims packed 24 chains per slot) in a fixed table of avatar slots. The cap was a hard-coded 256 (raised to 1024 as a stopgap). Replace the fixed cap with buffers that are sized to demand and grow. ## Today - Joint table + per-slot CPU arrays (`LLCleanSkinStore::MAX_AVATARS`), ~10-14 KB per slot. - Avatar visibility table (`kAvVisSlots`) with compile-time section offsets (`kCasterBase`, `kAvBoxBase`, `kAvLodBase` ...) shared by C++ and GLSL. - Cluster draw-list avatar masks (`rig_bits`, fixed words in a uniform struct). - Cluster instance flags packing the slot index into a fixed bit field (`CLI1B_AV_SHIFT`). - RT per-avatar masks, admitted / layer bitsets, `kSkinAvRows` / `kRigAvRows`. - ~170 C++ references in 15 files, ~50 in 36 shaders. ## Goal - Start small (e.g. 64 slots), grow by doubling with no fixed ceiling short of the VRAM budget; shrink after a grace period like the other stores (free on liveness). - Runtime slot capacity read by shaders (no compile-time 256/1024); masks as word buffers indexed by `slot >> 5`; slot index in its own word (or a field wide enough for any capacity). - Growth = reallocate + copy + descriptor update (same pattern as the rigged skin buffers); at most a one-frame blip, only past the previous high-water. - Log live / capacity / peak slots. - Debug check that clamps + logs any out-of-range slot index (a missed reader would otherwise index past a buffer on the GPU). - Allocation failure never crashes (retry later, then drop + log). ## Notes - Past the cap today, with cluster LOD off a new character falls back to static (unskinned) geometry; with cluster LOD on it is cluster-owned with no slot and does not draw. Right-sizing removes the cap rather than adding a fallback path.
sky_line added this to the Slipstream project 2026-10-14 17:11:32 +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#762
No description provided.