Skip to content

perf: gsplat local rasterize early-out via precomputed power cutoff#8623

Merged
mvaligursky merged 1 commit into
mainfrom
mv-gsplat-rasterize-cutoff
Apr 20, 2026
Merged

perf: gsplat local rasterize early-out via precomputed power cutoff#8623
mvaligursky merged 1 commit into
mainfrom
mv-gsplat-rasterize-cutoff

Conversation

@mvaligursky
Copy link
Copy Markdown
Contributor

Speed up GSplatLocalRasterize by expanding projCache to a 32-byte (8 x u32) stride and precomputing a per-splat Gaussian power cutoff so the rasterize kernel can skip exp() and the blend chain for non-contributing pixels.

Changes:

  • Bump projCache stride from 7 to 8 u32 per splat (32 bytes, cache-line friendly; partial writes become full cache-line writes)
  • Tile-count pass now writes -0.5 * radiusFactor into slot 7 — a tighter per-splat cutoff than the global -4 for low-opacity splats
  • Rasterize pass (color and pick variants) loads the cutoff into shared memory and early-outs per 2x2 quad when power4 <= cutoff at all 4 pixels, skipping exp(), half4 blend math, and (in pick mode) 4 evalSplatPick calls
  • Centralize CACHE_STRIDE into a single JS constant (scene/gsplat-unified/gsplat-local-constants.js) and inject it into the three compute shaders via cdefines ({CACHE_STRIDE}) — removes the four duplicated declarations

Performance (17M splats):

  • Windows, NVIDIA 2070, 2457x1773: total 22.4 -> 21.9 ms; rasterize 9.5 -> 9.4 ms
  • macOS, M4 Max, 1518x1275: total 8.5 -> 8.2 ms; rasterize 3.2 -> 3.0 ms

No public API changes.

- Bump projCache stride from 7 to 8 u32 per splat (32-byte cache-line)
- Tile-count pass writes -0.5 * radiusFactor into slot 7
- Rasterize (color + pick) early-outs per 2x2 quad when all 4 pixels are
  below the per-splat cutoff, skipping exp() and the blend chain
- Centralize CACHE_STRIDE into gsplat-local-constants.js and inject it
  into the compute shaders via cdefines ({CACHE_STRIDE})
@mvaligursky mvaligursky self-assigned this Apr 20, 2026
@mvaligursky mvaligursky merged commit bdb9e63 into main Apr 20, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-gsplat-rasterize-cutoff branch April 20, 2026 12:14
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