[Q] How to enable a rendering backend for project?
trsh opened this issue · 10 comments
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: No enabled backends among: vulkan dx12 metal gl', src\libcore\result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: process didn't exit successfully: `target\debug\vox.exe` (exit code: 101)
I guess there is space for improvement in this error message.
You can enable a backend by enabling a feature.
You probably would want to expose same features from your crate like this
[features]
dx12 = ["rendy/dx12"]
gl = ["rendy/gl"]
metal = ["rendy/metal"]
vulkan = ["rendy/vulkan"]
Enabling backend on platform that doesn't support it is perfectly valid (it would be unavailable of course).
So you technically can just enable all of them and use whatever is available on the platform.
But each backend would add to compilation times, that's why they all are optional.
It still give same error even after adding above to toml and cargo run --release --features metal
. Also, it would be cool to have up-to-date examples
With those features added and running cargo run --features vulkan
its working on windows.
@omni-viral any ideas why on the other machine runing with cargo run --features metal
, it still shows the error above?
Will open new issue for that
@BlackGoku36 how exactly examples are out of date?
@omni-viral it seems that example(s) use an old / older version winit. 0.20.0 stable brings some braking changes. You can take a look on the triangle example I added to the new issues where we fixed those.
@omni-viral btw a bit off topic. We use visual studio code with Rust (rls) extension. Its showing stupid things, like function run is never used, but it obvious is used. GraphBuilder
is imported but not used, but it is used, etc. Last time I coded with visual studio and this extension it wasn't so broken. Any advice?