Visitar URL original
fix: Rebuild gsplat work buffer render targets for runtime-added streams by mvaligursky · Pull Request #9876 · playcanvas/engine · GitHub
Skip to content

fix: Rebuild gsplat work buffer render targets for runtime-added streams - #9876

Merged
mvaligursky merged 1 commit into
mainfrom
claude/gsplat-work-buffer-sync
Oct 29, 2026
Merged

mvaligursky merged 1 commit into
mainfrom
claude/gsplat-work-buffer-sync

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Fixes a gsplat work buffer bug where a stream added at runtime never got a render target attachment, so the copy pass never wrote it. Extracted from #9873.

Changes:

  • GSplatWorkBuffer.syncWithFormat() compared the streams' format version before and after its own sync. GSplatStreams.getTexture() also syncs the streams, so when a renderer fetched a texture by name after the stream was added, the streams were already up to date and the render targets were never rebuilt. The new stream then had a texture but no attachment. This affects any extra stream added at runtime (app.scene.gsplat.format.addExtraStreams()) on the GPU-sort path.
  • The work buffer now tracks the stream version its render targets were built for, and rebuilds them whenever they're behind.
  • Added test/scene/gsplat-unified/gsplat-work-buffer.test.mjs.

…at runtime

GSplatWorkBuffer.syncWithFormat() compared the streams' format version before and after its own
sync. GSplatStreams.getTexture() also syncs, so when a texture was fetched by name after a stream
was added, the streams were already up to date and the render targets were never rebuilt. The
new stream then had a texture but no attachment, and the copy pass never wrote it.

Track the version the render targets were built for and rebuild whenever it is behind.

Extracted from #9873.

Co-authored-by: Donovan Hutchence <slimbuck7@gmail.com>
@github-actions

Copy link
Copy Markdown

Build size report

This PR changes the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2780.1 KB (+81 B, +0.00%) 720.9 KB (+12 B, +0.00%) 558.7 KB (−118 B, −0.02%)
playcanvas.min.mjs 2776.8 KB (+81 B, +0.00%) 719.9 KB (+12 B, +0.00%) 558.3 KB (+21 B, +0.00%)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the fix to render-target attachments for runtime-added gsplat streams.

No open issues 🎉

What changed in this PR

Fixes missing render-target attachments for runtime-added gsplat streams on the GPU-sort path, including when a texture lookup has already synchronized the streams.

Changes:

  • Tracks the stream version used to create render targets and rebuilds them when it changes.
  • Adds regression tests for runtime-added streams, both with and without a preceding getTexture() call.
File Description
test/​scene/​gsplat-unified/​gsplat-work-buffer.test.mjs Tests that runtime-added streams receive render-target attachments.
src/​scene/​gsplat-unified/​gsplat-work-buffer.js Tracks render-target versions independently of stream synchronization.

Review effort: Balanced

@mvaligursky
mvaligursky merged commit 3112d84 into main Oct 29, 2026
12 checks passed
@mvaligursky
mvaligursky deleted the claude/gsplat-work-buffer-sync branch October 29, 2026 16:57
mvaligursky pushed a commit to slimbuck/engine that referenced this pull request Oct 30, 2026
The fix landed separately in playcanvas#9876 with its own test.

This branch was successfully deployed

2 active deployments
Preview – engine — 80b769b6 Deployed Oct 29, 2026 by vercel[bot]
Preview – engine-api-docs — 80b769b6 Deployed Oct 29, 2026 by vercel[bot]
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