-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Allow for querying supported sample counts in Msaa and expose 16 samples #22568
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
base: main
Are you sure you want to change the base?
Conversation
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
4dd0175 to
0fd45e8
Compare
|
It looks like your PR is a breaking change, but you didn't provide a migration guide. Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes. |
a0da69a to
95f8841
Compare
95f8841 to
e47b468
Compare
|
I reverted the API breaking enum -> struct change, as I realized it was unnecessary. The changeset is much cleaner now, sorry about the previous noise. |
Objective
Adds support for querying supported MSAA sample counts on the current GPU, making possible for users to select only supported MSAA modes, thus avoiding fatal WGPU validation errors. Also exposes MSAAx16, which wasn't available before.
anti_aliasingexample crashes when MSAA is set to 8 samples #15789Solution
TextureCache::get), since for some reason WebGPU ties max. sample count info to texture formats, and that's trivially available there. But max. sample count query also requires aRenderAdapter, and passing it to all callsites was not really feasible.Msaaimplementation instead.Msaanow exposes a method to retrieve supported sample counts on the givenRenderAdapter. Usage is opt-in,Msaa::from_samplesstill won't check for actual GPU support.Msaawith the highest supported sample count.anti_aliasingexample got adapted to these changes, to only show supported MSAA modes.Testing
anti_aliasingexample: