Unify surface creation by introducing new SurfaceTarget enum#4984
Merged
cwfitzgerald merged 17 commits intogfx-rs:trunkfrom Jan 12, 2024
Merged
Unify surface creation by introducing new SurfaceTarget enum#4984cwfitzgerald merged 17 commits intogfx-rs:trunkfrom
SurfaceTarget enum#4984cwfitzgerald merged 17 commits intogfx-rs:trunkfrom
Conversation
826700d to
bfc8e7e
Compare
cwfitzgerald
previously requested changes
Jan 6, 2024
Member
cwfitzgerald
left a comment
There was a problem hiding this comment.
Trickle this down to wgpu-core?
Yes please!
Member
Author
Let's leave this for another time, this PR is quite big & scary as is already |
4d3b164 to
656c79a
Compare
48cabb2 to
b5192e8
Compare
Wumpf
commented
Jan 11, 2024
6 tasks
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connections
Came up while talking about #2804 since all the different surface creation code paths were a bit in the way when working on this.
Description
Unifies all
create_surface_Xmethods to justcreate_surfaceby expecting a newSurfaceTargetenum.To be accurate, we're expecting
Into<SurfaceTarget>which allows to pass anything that implements raw window handle directly.Was a bit unsure about the
create_surface_rawone. I think removing it in the way I did is correct, but I'm wonder if I blocked some usecases or made things less safe.Future work:
Testing
Compiles! Also ran examples on native (mac) and webgl.
Checklist
cargo fmt.cargo clippy. If applicable, add:--target wasm32-unknown-unknown--target wasm32-unknown-emscriptencargo xtask testto run tests.CHANGELOG.md. See simple instructions inside file.