Skip to content

fix(gsplat): make writeSortIndirectArgs WGSL helper portable for Firefox WebGPU#8784

Merged
mvaligursky merged 1 commit into
mainfrom
mv-firefox-webgpu-gsplat-shader
May 27, 2026
Merged

fix(gsplat): make writeSortIndirectArgs WGSL helper portable for Firefox WebGPU#8784
mvaligursky merged 1 commit into
mainfrom
mv-firefox-webgpu-gsplat-shader

Conversation

@mvaligursky
Copy link
Copy Markdown
Contributor

Fixes a WebGPU shader validation error in the unified gsplat renderer that prevented Firefox from rendering splats (observed on supersp.at scenes).

The writeSortIndirectArgs WGSL helper took the indirect dispatch buffer as a ptr<storage, array<u32>, read_write> parameter. Passing storage-space pointers across function boundaries requires the unrestricted_pointer_parameters WGSL language feature, which Chrome (Dawn) enables by default but Firefox (naga) rejects:

Argument 'buf' at index 0 is a pointer of space Storage { access: StorageAccess(LOAD | STORE) }, which can't be passed into functions.

Changes:

  • sort-indirect-args.js: drop the buf pointer parameter; the helper now references the global indirectDispatchArgs binding directly. Added a comment documenting the contract (calling shader must declare a indirectDispatchArgs storage binding) and the portability rationale.
  • compute-gsplat-write-indirect-args.js / compute-gsplat-projector-write-indirect-args.js: updated the two call sites to drop the &indirectDispatchArgs argument. Both already used that exact binding name, so no rename was needed.

Affected paths:

  • GSPLAT_RENDERER_COMPUTE (interval compaction)
  • GSPLAT_RENDERER_RASTER_GPU_SORT (hybrid raster + projector)
  • CPU sort path and WebGL paths are unaffected.

…fox WebGPU

The helper took the indirect dispatch buffer as a ptr<storage, ...>
parameter. Passing storage-space pointers across function boundaries
requires the 'unrestricted_pointer_parameters' WGSL language feature,
which Chrome (Dawn) enables by default but Firefox (naga) rejects with
a shader validation error.

Drop the pointer parameter and reference the global indirectDispatchArgs
binding directly. Both call sites already used that exact binding name.
@mvaligursky mvaligursky self-assigned this May 27, 2026
@mvaligursky mvaligursky added the area: graphics Graphics related issue label May 27, 2026
@mvaligursky mvaligursky merged commit 7223389 into main May 27, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-firefox-webgpu-gsplat-shader branch May 27, 2026 08:39
mvaligursky added a commit that referenced this pull request May 27, 2026
…fox WebGPU (#8784)

The helper took the indirect dispatch buffer as a ptr<storage, ...>
parameter. Passing storage-space pointers across function boundaries
requires the 'unrestricted_pointer_parameters' WGSL language feature,
which Chrome (Dawn) enables by default but Firefox (naga) rejects with
a shader validation error.

Drop the pointer parameter and reference the global indirectDispatchArgs
binding directly. Both call sites already used that exact binding name.

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

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant