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

Change get_preferred_format to get_supported_formats #2783

Merged
merged 10 commits into from
Jun 18, 2022
Merged

Change get_preferred_format to get_supported_formats #2783

merged 10 commits into from
Jun 18, 2022

Conversation

stevenhuyn
Copy link
Contributor

@stevenhuyn stevenhuyn commented Jun 17, 2022

Connections
Closes #2718

Description
Converted everything related to get_preferred_format -> Option<TextureFormat> to get_supported_formats -> Option<Vec<TextureFormat>>

Converted the web version to return the set of texture formats defined by https://gpuweb.github.io/gpuweb/#supported-context-formats

Testing
I ran cargo nextest run --no-fail-fast

@stevenhuyn stevenhuyn marked this pull request as draft June 17, 2022 22:03
@stevenhuyn stevenhuyn changed the title Change all the functions Change get_preferred_format to get_supported_formats Jun 17, 2022
@stevenhuyn
Copy link
Contributor Author

Trying to understand this error, when get_preferred_format doesn't exist in either this branch nor the web_sys crate.

error[E0599]: no method named `get_supported_formats` found for struct `GpuCanvasContext` in the current scope
    --> wgpu\src\backend\web.rs:1198:14
     |
1198 |             .get_supported_formats(&adapter.0)
     |              ^^^^^^^^^^^^^^^^^^^^^ help: there is an associated function with a similar name: `get_preferred_format`

For more information about this error, try `rustc --explain E0599`.

@cwfitzgerald
Copy link
Member

All that stuff is behind the web_sys_unstable_apis cfg, so doesn't show up on docs.rs.

wgpu/src/backend/web.rs Outdated Show resolved Hide resolved
@stevenhuyn stevenhuyn marked this pull request as ready for review June 18, 2022 01:04
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.

Looks good, thanks for tackling this, some comments

wgpu-core/src/instance.rs Outdated Show resolved Hide resolved
wgpu/examples/framework.rs Outdated Show resolved Hide resolved
wgpu/src/backend/web.rs Outdated Show resolved Hide resolved
wgpu/src/lib.rs 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.

One more change then we're good

wgpu-core/src/device/mod.rs Outdated Show resolved Hide resolved
wgpu-core/src/instance.rs Outdated Show resolved Hide resolved
stevenhuyn and others added 2 commits June 17, 2022 20:58
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
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.

Thanks!

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.

Change get_preferred_format to get_supported_formats
2 participants