-
Notifications
You must be signed in to change notification settings - Fork 933
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
Add get_default_configure
to simplify user creation of SurfaceConfiguration
#3034
Conversation
dd32cb8
to
7024df7
Compare
Adding |
All field values within SurfaceConfiguration should have a valid default value (exclude width and height), it's just that this value may be reinterpreted in different backends, as in the case of If used as an util function, additional |
I think the biggest problem here is that FIFO isn't actually available everywhere - this is a problem I discovered after starting to tell people that FIFO works everywhere 😬 - wayland doesn't actually have any presentation mode other than MAILBOX. |
@cwfitzgerald Is it acceptable to use |
7024df7
to
1d5ee0a
Compare
1d5ee0a
to
627fdf8
Compare
5de3ffe
to
21ac3ca
Compare
SurfaceConfiguration
, simplify the use of users.get_default_configure
to simplify user creation of SurfaceConfiguration
21ac3ca
to
fa44e57
Compare
Sorry, this one has had a lot of revisions |
fa44e57
to
9cba89f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after one nit
…SurfaceConfiguration`
9cba89f
to
caca9a3
Compare
Checklist
cargo clippy
.RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown
if applicable.Description
Most users don't really need to care about the values of
usage
,format
,present_mode
, and possiblyalpha_mode
,color_space
, etc. when configuringSurfaceConfiguration
. It is only necessary to understand and specify these fields if the user has a clear need for them.impl Default
simplifies the use of users.Bgra8UnormSrgb
is set as the default format value because it is the only format supported by all platforms. Although Bgra8Unorm and Rgba8Unorm are defined in the WebGPU spec, metal actually only supports Bgra8Unorm as the texture format for the SwapChainTesting
Tested examples locally