gfx-rs / wgpu-rs

Rust bindings to wgpu native library
https://wgpu.rs
Mozilla Public License 2.0
1.69k stars 186 forks source link

vulkan-portability on MacOS panics #840

Closed rybertm closed 3 years ago

rybertm commented 3 years ago

https://github.com/gfx-rs/wgpu-rs/blob/55cafa398868998d1c14620111208d92f5cda9d5/Cargo.toml#L23 sets the gfx-backend-vulkan feature inside wgpu/wgpu-core but in this crate only vulkan-portability gets set, so when gfx_select! is expanded it checks for gfx-backend-vulkan, which is not present in wgpu-rs: https://github.com/gfx-rs/wgpu-rs/blob/55cafa398868998d1c14620111208d92f5cda9d5/src/backend/direct.rs#L593-L595

As for fixing, I could add a gfx-backend-vulkan dependency to the vulkan-portability feature as well as add it to macos targets, but I don't know if it could break in other unix systems @kvark.

Originally posted by @rybertm in https://github.com/gfx-rs/wgpu-rs/issues/575#issuecomment-696066934

rybertm commented 3 years ago

Looks like https://github.com/gfx-rs/wgpu-rs/blob/78234dd12030c2c4e7247d8ae1a6df08e299e44d/Cargo.toml#L23 broke the "vulkan-portability" feature on MacOS for the same reason stated above, quoted from the original issue.

The same fix could be applied unless there's other plans.

kvark commented 3 years ago

I'm thinking that, since gfx_select! isn't ever used internally by wgpu-core, the feature it should be checking should be "vulkan-portability" (instead of "gfx-backend-vulkan"), even though wgpu-core doesn't have this feature.

rybertm commented 3 years ago

Not sure if i should submit a PR with that change or if you want some discussion around it or ideas

kvark commented 3 years ago

A PR would be appreciated!

On Apr 5, 2021, at 18:24, Robert Broketa @.***> wrote:

 Not sure if i should submit a PR with that change or if you want some discussion around it or ideas

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

kvark commented 3 years ago

I decided to remove support for Vulkan Portability, at least for the 0.8 release. The reason for it being - our validation is very good now, and Naga's Metal output is great. So we have very little value to extract from running with Vulkan Validation Layers at this point.