-
Notifications
You must be signed in to change notification settings - Fork 953
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
Unify surface creation by introducing new SurfaceTarget
enum
#4984
Conversation
826700d
to
bfc8e7e
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.
Trickle this down to wgpu-core?
Yes please!
Let's leave this for another time, this PR is quite big & scary as is already |
4d3b164
to
656c79a
Compare
48cabb2
to
b5192e8
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.
Very good stuff!
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_X
methods to justcreate_surface
by expecting a newSurfaceTarget
enum.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_raw
one. 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-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.