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

Fix surfaces only compatible with first enabled backend #5535

Merged
merged 7 commits into from
Apr 17, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Apr 14, 2024

Connections

Description
Both instances and surfaces are supposed to be created for all backends. This has some major drawbacks (see e.g. #2384 - creation of one halsurface may preclude creation of another halsurface), but this is how things were assumed to be working. Only that they didn't and we only created a single AnySurface with only the first successfully create hal surface!

This PR sets things right again and removing AnySurface in the process since there's not much use to it anymore.
We now create hal surface for each available hal instance. Error handling had to change a bit for this (not super happy with it, but will do).

Some small renames & doc additions as well.

Testing

Checklist

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

@Wumpf Wumpf requested a review from a team as a code owner April 14, 2024 22:15
@Wumpf Wumpf changed the title Surface fixes Fix surfaces only compatible with first enabled backend Apr 14, 2024
wgpu-core/src/instance.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.

LGTM

@cwfitzgerald cwfitzgerald merged commit cbace63 into gfx-rs:trunk Apr 17, 2024
25 checks passed
@Wumpf Wumpf deleted the surface-fixes branch April 18, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants