Skip to content

feat(WebGPU): support user shader replacements - #3670

Open
daker wants to merge 1 commit into
Kitware:masterfrom
daker:webgpu-shaderreplacement
Open

daker wants to merge 1 commit into
Kitware:masterfrom
daker:webgpu-shaderreplacement

Conversation

@daker

@daker daker commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Context

Results

Changes

Add a ReplacementShaderMapper module, as in the OpenGL backend. It reads
mapper.getViewSpecificProperties().WebGPU for all mappers:
VertexShaderCode and FragmentShaderCode replace the templates,
ShaderReplacements run before (replaceFirst) or after the mapper
replacements, and VertexOutputs declares vertex outputs with an
optional interpolation. The user properties are part of the pipeline
hash. VolumePassFSQ joins the properties of all its volume mappers.

Add the coincident slope term to CellArrayMapper and ImageMapper with
the //VTK::CoincidentOffset::Impl marker. The shader writes frag_depth
only when the factor is not zero.

Add the WebGPU and OpenGL property types to the Mapper declarations.

PR Checklist

  • GitHub Actions CI passed: semantic-release commit messages, lint, and tests
  • Test coverage added
  • Documentation and TypeScript definitions are updated to match these changes

@daker daker mentioned this pull request Oct 4, 2026
49 of 56 tasks
Add a ReplacementShaderMapper module, as in the OpenGL backend. It reads
mapper.getViewSpecificProperties().WebGPU for all mappers:
VertexShaderCode and FragmentShaderCode replace the templates,
ShaderReplacements run before (replaceFirst) or after the mapper
replacements, and VertexOutputs declares vertex outputs with an
optional interpolation. The user properties are part of the pipeline
hash. VolumePassFSQ joins the properties of all its volume mappers.

Add the coincident slope term to CellArrayMapper and ImageMapper with
the //VTK::CoincidentOffset::Impl marker. The shader writes frag_depth
only when the factor is not zero.

Add the WebGPU and OpenGL property types to the Mapper declarations.
@daker
daker force-pushed the webgpu-shaderreplacement branch from 68e6433 to f52479f Compare October 5, 2026 09:28

This branch has not been deployed

No deployments
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