Skip to content

GSplat Work Buffer Custom Streams Support#8396

Merged
mvaligursky merged 4 commits into
mainfrom
mv-work-buffer-format
Jan 23, 2026
Merged

GSplat Work Buffer Custom Streams Support#8396
mvaligursky merged 4 commits into
mainfrom
mv-work-buffer-format

Conversation

@mvaligursky

@mvaligursky mvaligursky commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends the GSplat unified rendering work buffer to support custom per-splat data streams. Users can add extra streams to the work buffer format and use shader hooks to write custom data during the copy-to-work-buffer pass and read it during rendering.

Features

  • Custom streams: Add extra texture streams to app.scene.gsplat.format via addExtraStreams()
  • Write hooks: Use existing workBufferModifier shader chunks on GSplatComponent to write custom data using generated write{StreamName}() functions
  • Read hooks: Access custom data in render shaders using generated load{StreamName}() functions via existing gsplatModifyVS chunk on app.scene.gsplat.material

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the GSplat unified rendering work buffer to support custom per-splat data streams. Users can now add extra texture streams to the work buffer format and use shader hooks to write and read custom data during rendering.

Changes:

  • Refactored work buffer to use GSplatFormat for stream management, enabling dynamic addition of extra streams
  • Added support for custom stream declarations and generated write{StreamName}() and load{StreamName}() shader functions
  • Modified shader chunks to support work buffer read functions and output declarations for MRT

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/scene/shader-lib/wgsl/collections/gsplat-chunks-wgsl.js Replaced gsplatWorkBufferVS with gsplatWorkBufferReadVS chunk
src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatFormat.js Reorganized format declarations and moved #include directive
src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatCommon.js Reordered includes to ensure format declarations load before usage
src/scene/shader-lib/wgsl/chunks/gsplat/vert/formats/workBufferRead.js Updated to initialize splatUV for generated load functions
src/scene/shader-lib/wgsl/chunks/gsplat/frag/gsplatCopyToWorkbuffer.js Changed to use module-scope output variable and generated write functions
src/scene/shader-lib/glsl/collections/gsplat-chunks-glsl.js Replaced gsplatWorkBufferVS with gsplatWorkBufferReadVS chunk
src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatFormat.js Reorganized format declarations and moved #include directive
src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatCommon.js Reordered includes to ensure format declarations load before usage
src/scene/shader-lib/glsl/chunks/gsplat/vert/formats/workBufferRead.js Updated to initialize splatUV for generated load functions, fixed trailing spaces
src/scene/shader-lib/glsl/chunks/gsplat/frag/gsplatCopyToWorkbuffer.js Changed to use generated write functions instead of direct fragment output
src/scene/scene.js Updated GSplatParams instantiation to pass device parameter
src/scene/gsplat/gsplat-streams.js Added getTexturesInOrder() and resize() methods for work buffer support
src/scene/gsplat/gsplat-resource-base.js Updated getWorkBufferRenderInfo() signature to accept work buffer format
src/scene/gsplat/gsplat-format.js Enhanced documentation for stream descriptors and format usage
src/scene/gsplat-unified/gsplat-work-buffer.js Refactored to use GSplatStreams for texture management and support dynamic formats
src/scene/gsplat-unified/gsplat-work-buffer-render-pass.js Updated to pass work buffer format to render info
src/scene/gsplat-unified/gsplat-sort-key-compute.js Changed to access textures via getTexture() method
src/scene/gsplat-unified/gsplat-renderer.js Refactored to sync with work buffer format changes and bind textures dynamically
src/scene/gsplat-unified/gsplat-params.js Added format descriptor initialization and public getter
src/scene/gsplat-unified/gsplat-manager.js Updated work buffer instantiation to pass format parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/scene/gsplat/gsplat-streams.js
Comment thread src/scene/gsplat-unified/gsplat-work-buffer.js
@mvaligursky mvaligursky merged commit b915412 into main Jan 23, 2026
7 checks passed
@mvaligursky mvaligursky deleted the mv-work-buffer-format branch January 23, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants