Replace interval texture binary search with instanced quad rendering for GSplat work buffer copy#8456
Merged
mvaligursky merged 1 commit intomainfrom Feb 13, 2026
Merged
Conversation
…for GSplat work buffer copy
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the two-pass GPU-based interval texture expansion (using binary search) with a more efficient single-pass instanced rendering approach for copying GSplat data to the work buffer. The new implementation computes source indices arithmetically in the fragment shader, eliminating the need for the intermediate interval texture and binary search lookup.
Changes:
- Removed GSplatIntervalTexture class and associated binary search fragment shaders
- Added instanced quad vertex shaders that split LOD intervals into row-aligned rectangles on the CPU
- Modified fragment shaders to compute original splat indices arithmetically from flat varyings
- Unified QuadRender to always use indexed PRIMITIVE_TRIANGLES with a new shared quadIndexBuffer
- Added numInstances parameter to QuadRender for instanced drawing support
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatCopyInstancedQuad.js | New WGSL vertex shader for instanced quad rendering with per-instance rectangle parameters |
| src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatCopyInstancedQuad.js | New GLSL vertex shader for instanced quad rendering with per-instance rectangle parameters |
| src/scene/shader-lib/wgsl/chunks/gsplat/frag/gsplatIntervalTexture.js | Removed - binary search interval expansion no longer needed |
| src/scene/shader-lib/glsl/chunks/gsplat/frag/gsplatIntervalTexture.js | Removed - binary search interval expansion no longer needed |
| src/scene/shader-lib/wgsl/chunks/gsplat/frag/gsplatCopyToWorkbuffer.js | Updated to compute source index arithmetically from flat varyings instead of texture lookup |
| src/scene/shader-lib/glsl/chunks/gsplat/frag/gsplatCopyToWorkbuffer.js | Updated to compute source index arithmetically from flat varyings instead of texture lookup |
| src/scene/gsplat-unified/gsplat-work-buffer.js | Updated to select instanced vertex shader for LOD path, removed unused device field |
| src/scene/gsplat-unified/gsplat-work-buffer-render-pass.js | Updated to use instanced rendering with sub-draw data texture instead of interval texture |
| src/scene/gsplat-unified/gsplat-interval-texture.js | Removed - entire class replaced by simpler sub-draw data texture approach |
| src/scene/gsplat-unified/gsplat-info.js | Added updateSubDraws method to split intervals into row-aligned rectangles and pack into texture |
| src/scene/graphics/quad-render.js | Unified to use indexed triangles, added numInstances parameter for instanced rendering |
| src/platform/graphics/graphics-device.js | Added quadIndexBuffer for indexed quad rendering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the two-pass interval texture expansion (GSplatIntervalTexture class + binary search
fragment shader) with a single instanced draw call when copying GSplat data to the work buffer.
Functionality:
RGBA32U data texture. One instanced quad is drawn per rectangle, with the fragment shader
computing the original source index arithmetically from flat varyings — eliminating the
binary search texture lookup entirely.
with a new numInstances parameter for instanced draws.