Skip to content

Add STRICT_WEBGPU_COMPLIANCE instance flag#9586

Merged
teoxoy merged 9 commits into
gfx-rs:trunkfrom
teoxoy:STRICT_WEBGPU_COMPLIANCE
Jun 3, 2026
Merged

Add STRICT_WEBGPU_COMPLIANCE instance flag#9586
teoxoy merged 9 commits into
gfx-rs:trunkfrom
teoxoy:STRICT_WEBGPU_COMPLIANCE

Conversation

@teoxoy

@teoxoy teoxoy commented May 25, 2026

Copy link
Copy Markdown
Member

Connections
Fixes #3274.
Fixes #9436.
Fixes #3365.

Description
Adds the STRICT_WEBGPU_COMPLIANCE flag, intended to be used by wgpu-core users that want to strictly limit the behavior of wgpu-core to the one defined by the WebGPU spec.

Testing
Added some more tests.

Squash or Rebase?
Rebase.

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.

@teoxoy teoxoy force-pushed the STRICT_WEBGPU_COMPLIANCE branch 2 times, most recently from b9aeac7 to b58c67f Compare May 25, 2026 13:54
@teoxoy teoxoy changed the title Add STRICT_WEBGPU_COMPLIANCE instance flags Add STRICT_WEBGPU_COMPLIANCE instance flag May 25, 2026
@teoxoy teoxoy force-pushed the STRICT_WEBGPU_COMPLIANCE branch 3 times, most recently from 2afbe99 to 1c2bb32 Compare May 26, 2026 15:50
@andyleiserson andyleiserson self-assigned this May 27, 2026

@andyleiserson andyleiserson 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.

Nice!

There is another instance flag ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER, which says it "mainly applies to a Vulkan driver's compliance version" (and that is in fact the only place it applies). It might be worth updating the docs for that flag to clarify the difference from STRICT_WEBGPU_COMPLIANCE.

It might be worth a few unit tests (maybe for adapter_allowed) capturing conditions where we don't want to return an adapter. We won't otherwise have much coverage of this logic. An expectation that adapter_allowed exists as a function, is not unused, and has certain properties, provides some protection against breakage.

Comment thread wgpu-core/src/instance.rs Outdated
@teoxoy teoxoy force-pushed the STRICT_WEBGPU_COMPLIANCE branch from 1c2bb32 to fcddc2a Compare June 3, 2026 20:45
@teoxoy teoxoy force-pushed the STRICT_WEBGPU_COMPLIANCE branch from fcddc2a to 38ed056 Compare June 3, 2026 20:52

@andyleiserson andyleiserson 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.

Tests look good, thanks for adding.

@teoxoy teoxoy enabled auto-merge (rebase) June 3, 2026 20:57
@teoxoy teoxoy merged commit 6e8d0bd into gfx-rs:trunk Jun 3, 2026
59 checks passed
@teoxoy teoxoy deleted the STRICT_WEBGPU_COMPLIANCE branch June 4, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants