Skip to content

fix(gsplat): tile interval-scatter dispatch over workgroup limit#8841

Merged
mvaligursky merged 1 commit into
mainfrom
mv-gsplat-scatter-dispatch
Jun 4, 2026
Merged

fix(gsplat): tile interval-scatter dispatch over workgroup limit#8841
mvaligursky merged 1 commit into
mainfrom
mv-gsplat-scatter-dispatch

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Fix a WebGPU GPUValidationError when rendering very large GPU-sorted gsplat scenes.

The interval-compaction "scatter" pass dispatched one workgroup per visible interval as a 1D dispatch, assuming the interval count stays below the device's max workgroups per dimension (65535). Scenes with a high visible-interval count (e.g. many gsplat instances across the full LOD range) exceed that limit and trigger: "Dispatch workgroup count X exceeds max compute workgroups per dimension".

Changes:

  • Tile the scatter dispatch across X and Y via Compute.calcDispatchSize, using device.limits.maxComputeWorkgroupsPerDimension. Behavior is unchanged for scenes under the limit (stays a 1D dispatch).
  • Reconstruct the linear interval index in the scatter shader from the 2D workgroup id (wgId.y * numWorkgroups.x + wgId.x); the existing intervalIdx >= numIntervals bounds check discards over-dispatched workgroups.

Only affects the WebGPU GPU-sort path; the WebGL/CPU-sort path is unchanged.

The interval-compaction scatter pass dispatched one workgroup per visible
interval as a 1D dispatch, assuming the interval count stays below the device's
max workgroups per dimension (65535). Large GPU-sorted scenes (e.g. many gsplat
instances across the full LOD range) exceed that limit and trigger a WebGPU
GPUValidationError.

Tile the scatter dispatch across X and Y via Compute.calcDispatchSize and
reconstruct the linear interval index in the shader from the 2D workgroup id.
The existing numIntervals bounds check discards over-dispatched workgroups.
Behavior is unchanged for scenes under the limit and for the CPU-sort path.
@mvaligursky mvaligursky self-assigned this Jun 4, 2026
@mvaligursky mvaligursky merged commit b97ae22 into main Jun 4, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-gsplat-scatter-dispatch branch June 4, 2026 14:04
mvaligursky added a commit that referenced this pull request Jun 4, 2026
The interval-compaction scatter pass dispatched one workgroup per visible
interval as a 1D dispatch, assuming the interval count stays below the device's
max workgroups per dimension (65535). Large GPU-sorted scenes (e.g. many gsplat
instances across the full LOD range) exceed that limit and trigger a WebGPU
GPUValidationError.

Tile the scatter dispatch across X and Y via Compute.calcDispatchSize and
reconstruct the linear interval index in the shader from the 2D workgroup id.
The existing numIntervals bounds check discards over-dispatched workgroups.
Behavior is unchanged for scenes under the limit and for the CPU-sort path.

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
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.

1 participant