Skip to content

Mask stencil clear value and reference value with 255#9607

Merged
andyleiserson merged 3 commits into
gfx-rs:trunkfrom
beicause:stencil-reference-value-lsb-255
Jun 2, 2026
Merged

Mask stencil clear value and reference value with 255#9607
andyleiserson merged 3 commits into
gfx-rs:trunkfrom
beicause:stencil-reference-value-lsb-255

Conversation

@beicause
Copy link
Copy Markdown
Contributor

@beicause beicause commented May 30, 2026

Connections
Fix webgpu:api,operation,render_pass,clear_value:stencil_clear_value:* on metal.
Found this issue in #9568.

Description
See gpuweb/gpuweb#2921 and https://issues.chromium.org/issues/42240605, we need to take the LSBs of stencil value. Currently only 8-bit stencil formats are supported so value & 255.

Testing

cargo xtask cts `webgpu:api,operation,render_pass,clear_value:stencil_clear_value:*`

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.

@beicause beicause force-pushed the stencil-reference-value-lsb-255 branch from e7ec315 to 5a62e47 Compare May 30, 2026 08:45
@beicause beicause changed the title Mask stencil reference value with 255 Mask stencil clear value and reference value with 255 May 30, 2026
@beicause beicause force-pushed the stencil-reference-value-lsb-255 branch from 5a62e47 to 523a1cf Compare May 30, 2026 08:59
Copy link
Copy Markdown
Contributor

@andyleiserson andyleiserson left a comment

Choose a reason for hiding this comment

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

I don't actually see truncation of the reference value in the spec, but that is what the CTS wants, and seems right to me. Filed gpuweb/gpuweb#6273 for that.

Comment thread wgpu-core/src/command/render.rs Outdated
Comment thread wgpu-core/src/command/render.rs Outdated
Copy link
Copy Markdown
Contributor

@andyleiserson andyleiserson left a comment

Choose a reason for hiding this comment

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

Thanks!

@andyleiserson andyleiserson enabled auto-merge (squash) June 2, 2026 16:48
@andyleiserson andyleiserson merged commit 8b7e9ed into gfx-rs:trunk Jun 2, 2026
59 checks passed
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.

2 participants