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

web: use get_preferred_canvas_format() to fill SurfaceCapabilities #3744

Merged
merged 6 commits into from
Jun 23, 2023

Conversation

jinleili
Copy link
Contributor

@jinleili jinleili commented May 3, 2023

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Description
On the web, wgpu always prioritizes returning the Bgra8Unorm format in the formats field of SurfaceCapabilities, but this format is not supported on Android devices:
截屏2023-05-03 19 44 17

Testing
Tested on Android Chrome Canary 115.0.5747.0 via https://jinleili.github.io/learn-wgpu-zh/simuverse
截屏2023-05-03 19 58 50

wgpu/src/backend/web.rs Outdated Show resolved Hide resolved
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

ah well that will do I guess 😄 👍

@Wumpf Wumpf mentioned this pull request May 14, 2023
3 tasks
@jinleili jinleili force-pushed the web_surface_preferred_format branch from 50d75f0 to b9cff4f Compare June 22, 2023 06:18
wgpu/src/backend/web.rs Outdated Show resolved Hide resolved
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Nits, then good!

wgpu/src/backend/web.rs Outdated Show resolved Hide resolved
wgpu/src/backend/web.rs Show resolved Hide resolved
wgpu/src/backend/web.rs Outdated Show resolved Hide resolved
@jinleili jinleili force-pushed the web_surface_preferred_format branch from c3d8861 to b17e692 Compare June 23, 2023 02:51
wgpu/src/backend/web.rs Outdated Show resolved Hide resolved
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) June 23, 2023 04:33
@cwfitzgerald cwfitzgerald merged commit cc203a6 into gfx-rs:trunk Jun 23, 2023
20 checks passed
@jinleili jinleili deleted the web_surface_preferred_format branch July 7, 2023 20:54
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.

3 participants