Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPU spec compliant dual source blending #7144

Closed
wants to merge 8 commits into from

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Feb 14, 2025

Connections

Description

Makes the dual source implementation in wgpu WebGPU spec compliant.
This means changing the wgsl syntax & associated validation to match what's described here and here and here.
Furthermore, makes the dual source blending extension available when targeting WebGPU.

Testing
Added a slew of naga tests. Did manual testing in a pet project against native & WebGPU (see also draft todo for ongoing problems)

Draft TODO

  • [help wanted:] need to validate the the right enable directive is set but can't quite figure out how to access this in the right places
  • [help wanted] [partially orthogonal]: While trying this out on my pet project I couldn't get it to fly in WebGPU because I was using naga_oil (with a hack, see also Support wgsl diagnostic directives. bevyengine/naga_oil#113 (comment)) where I have to rely on Module->write_wgsl which right now ignores all directives 😱 . Fixing that isn't entirely straight forward since Module is language agnostic so I have to detect the need for those
  • a more vertical wgpu test checking that happy path works and that shaders needing wgsl require the device to have the correct feature set

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@Wumpf
Copy link
Member Author

Wumpf commented Feb 14, 2025

oops, didn't push this to my fork

@Wumpf Wumpf closed this Feb 14, 2025
@Wumpf Wumpf deleted the webgpu-dual-source-blending branch February 14, 2025 23:30
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.

Converge dual-source blending with the WebGPU standard
1 participant