Skip to content

fix(dx12): Map components properly for textureLoad from stencil#9520

Open
andyleiserson wants to merge 3 commits intogfx-rs:trunkfrom
andyleiserson:dx12-stencil
Open

fix(dx12): Map components properly for textureLoad from stencil#9520
andyleiserson wants to merge 3 commits intogfx-rs:trunkfrom
andyleiserson:dx12-stencil

Conversation

@andyleiserson
Copy link
Copy Markdown
Contributor

@andyleiserson andyleiserson commented May 7, 2026

The shader view format used by the dx12 backend for stencil-only views, DXGI_FORMAT_X24_TYPELESS_G8_UINT, places the value in the green component. WebGPU requires it in the red component.

Fixes #6620 using the approach suggested by the reporter: configure a D3D12_SHADER_COMPONENT_MAPPING swizzle in the view.

Testing
Enables CTS tests (it's not clear that this coverage is the primary goal of these CTS tests, but I couldn't find anything better, and coverage is coverage). This change fixes the two format="stencil8" tests; it also adds other tests that were already passing to test.lst, and other pre-existing failures to fail.lst.

Squash or Rebase? Squash

Checklist

  • I self-reviewed and fully understand this PR.
  • WebGPU implementations built with wgpu may be affected behaviorally.
  • Validation and feature gates are in place to confine behavioral changes.
  • Tests demonstrate the validation and altered logic works.
  • CHANGELOG.md entries for the user-facing effects of this change are present.
  • The PR is minimal, and doesn't make sense to land as multiple PRs.
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.

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.

DX12 textureLoad from a Stencil8 value in GREEN channel instead of RED

1 participant