Skip to content

Conversation

AlexAPPi
Copy link
Contributor

@AlexAPPi AlexAPPi commented Oct 2, 2025

Solution: #8020

PR Description

This PR introduces a ring buffer for SkinInstance, used when updating the bone matrix texture.
Instead of a single buffer that could cause frequent GPU stalls during data uploads, the system now uses a multi-slot ring buffer across frames.

Main Changes

  • Implemented a ring buffer to store bone matrices, allowing updates to be written into independent slots per frame.
  • Bone texture updates no longer wait for the previous frame to complete, reducing the risk of GPU stalls.
  • Updated SkinInstance logic to pick the active ring buffer slot based on the current render frame.
  • Added configurability for the number of ring buffer slots (default is 1).

Results

  • Reduced GPU blocking during bone data uploads.
  • More stable frame times when animating many characters simultaneously.
  • Lowered latency between CPU → GPU updates.
  • This update is fully backward-compatible and does not affect existing behavior.

I have read the contributing guidelines

@mvaligursky
Copy link
Contributor

I developed UploadStream internal API to help with CPU->GPU uploads here: #8053

And so I'm keen to use this for Skin/Batch Instances as well. Which means first switching those to use StorageBuffer instead of texture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants