Skip to content

Fix WebGPU staging buffer error in non-unified GSplat sorter#8499

Merged
mvaligursky merged 1 commit intomainfrom
mv-fix-gsplat-sorter-upload-race
Mar 4, 2026
Merged

Fix WebGPU staging buffer error in non-unified GSplat sorter#8499
mvaligursky merged 1 commit intomainfrom
mv-fix-gsplat-sorter-upload-race

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Mar 4, 2026

Summary

  • The GSplatSorter (non-unified path, unified=false) uploaded sort results directly from the web worker message callback. When multiple worker results arrived between GPU submits, the staging buffer from the first upload was mapped while still referenced by the unsubmitted command encoder, causing a WebGPU validation error: "buffer used in submit while mapped".
  • Defer sort result uploads to GSplatInstance.update() via a pendingSorted field, matching the pattern used by the unified sorter (GSplatUnifiedSorter). Only the latest result is kept, avoiding both the validation error and redundant GPU uploads on both WebGL and WebGPU.
  • Add a submitVersion counter to WebgpuGraphicsDevice and a diagnostic assert in WebgpuUploadStream to catch future violations of the one-upload-per-submit constraint.

…GSplat path

The GSplatSorter uploaded sort results directly from the web worker message
callback, which could fire multiple times between GPU submits. When two
results arrived before the command buffer was submitted, the staging buffer
from the first upload was mapped while still referenced by the unsubmitted
encoder, causing a WebGPU validation error.

Defer sort result uploads to GSplatInstance.update() via a pendingSorted
field (matching the unified sorter pattern). Only the latest result is kept,
avoiding both the validation error and redundant GPU uploads.

Also adds a submitVersion counter to WebgpuGraphicsDevice and a diagnostic
assert in WebgpuUploadStream to catch future violations of the one-upload-
per-submit constraint.

Made-with: Cursor
@mvaligursky mvaligursky merged commit ffa6626 into main Mar 4, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-fix-gsplat-sorter-upload-race branch March 4, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants