Skip to content

fix(WebGPU): use filterable textures for 16-bit image scalars - #3748

Merged
PaulHax merged 1 commit into
masterfrom
webgpu-filterable-image-scalars
Nov 12, 2026
Merged

PaulHax merged 1 commit into
masterfrom
webgpu-filterable-image-scalars

Conversation

@PaulHax

@PaulHax PaulHax commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Context

VolumeMapperLightAndShadow uses a linearly filtered texture for the head volume. On devices with texture-formats-tier1, vtk.js selects r16snorm for those scalars. WebGPU only permits an unfilterable float binding for that format. Example · Original format selection · WebGPU format table

The console error in the example without this fix in WebGPU mode

WebGPU uncaptured error: None of the supported sample types (UnfilterableFloat) of [Texture (unlabeled 64x64x93 px, TextureFormat::R16Snorm)] match the expected sample types (Float).
 - While validating entries[6] against { binding: 6, visibility: ShaderStage::(Vertex|Fragment), texture: {sampleType: TextureSampleType::Float, viewDimension: TextureViewDimension::e3D, multisampled: 0} }.
 - While validating [BindGroupDescriptor ""mapperBG""] against [BindGroupLayout (unlabeled)]
 - While calling [Device].CreateBindGroup([BindGroupDescriptor ""mapperBG""]).

Results

Signed and unsigned 16-bit image scalars can be sampled with a linear sampler. For values outside the exact integer range of half-float, the accuracy path can use four bytes per component when float32 filtering is available. Compact storage takes two bytes and can round values.

Changes

Use the existing float16/float32 selection for 16-bit image scalars on tier1 devices, including when updating an existing texture.

PR Checklist

  • GitHub Actions CI passed: semantic-release commit messages, lint, and tests
  • Test coverage added
  • Documentation and TypeScript definitions are current for this internal change

@PaulHax
PaulHax force-pushed the webgpu-filterable-image-scalars branch from 5850a49 to 9f28e36 Compare November 11, 2026 13:20
@daker

daker commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

It would good if you can attach a before/after or a screenshot of the issue

@PaulHax

PaulHax commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

It would good if you can attach a before/after or a screenshot of the issue

Before the vtk.js viewprot is just white in Chrome with WebGPU rendering. After, it shows the volume.

@PaulHax
PaulHax requested a review from daker November 11, 2026 15:42

@daker daker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@PaulHax
PaulHax added this pull request to the merge queue Nov 12, 2026
Merged via the queue into master with commit e90c4d9 Nov 12, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 38.0.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released Automated label label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Automated label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants