Skip to content

fix: Inline WGSL resolveCodebook to fix Firefox naga compatibility#8450

Merged
mvaligursky merged 1 commit intomainfrom
mv-wgsl-codebooks
Feb 9, 2026
Merged

fix: Inline WGSL resolveCodebook to fix Firefox naga compatibility#8450
mvaligursky merged 1 commit intomainfrom
mv-wgsl-codebooks

Conversation

@mvaligursky
Copy link
Copy Markdown
Contributor

@mvaligursky mvaligursky commented Feb 9, 2026

Summary

  • we were pass uniform arrays by reference, which WebGPU spec does not allow (Chrome is ok with it, Firefox correctly is rejecting this)
  • Inlines the WGSL resolveCodebook function at all 3 call sites to fix Firefox WebGPU shader validation errors
  • Firefox's naga WGSL compiler rejects ptr<uniform, ...> as a function parameter per the WGSL spec (only function, private, and workgroup address spaces are allowed for pointer parameters)
  • Codebook uniform arrays are now accessed directly at each call site instead of being passed through a function

Files changed

  • src/scene/shader-lib/wgsl/chunks/gsplat/frag/gsplatPacking.js — Removed resolveCodebook function
  • src/scene/shader-lib/wgsl/chunks/gsplat/frag/gsplatSogReorder.js — Inlined codebook resolution for scales_codebook and sh0_codebook
  • src/scene/shader-lib/wgsl/chunks/gsplat/frag/gsplatSogReorderSh.js — Inlined codebook resolution for shN_codebook

Test plan

  • Verify SOG gaussian splat rendering works correctly on Chrome (WebGPU)
  • Verify SOG gaussian splat rendering works correctly on Firefox (WebGPU)
  • Verify no shader validation errors in Firefox console

Made with Cursor

Firefox's naga WGSL compiler rejects ptr<uniform, ...> as a function
parameter per the WGSL spec. Inline the codebook resolution at all call
sites to directly access uniform arrays without passing pointers.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown
Member

@slimbuck slimbuck left a comment

Choose a reason for hiding this comment

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

any performance regression?

@mvaligursky mvaligursky merged commit 823e3d5 into main Feb 9, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-wgsl-codebooks branch February 9, 2026 11:50
mvaligursky added a commit that referenced this pull request Feb 9, 2026
…8450)

Firefox's naga WGSL compiler rejects ptr<uniform, ...> as a function
parameter per the WGSL spec. Inline the codebook resolution at all call
sites to directly access uniform arrays without passing pointers.

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

2 participants