Hi
Enabling validation layers in pure vulkan seems reasonably straightforward. However I cannot seem to figure out how to do so when developing with wgpu-rs. I couldn't find any documentation about this either.
Does anyone know how to do this?
Since validation layers are a pretty common thing to use in vulkan, it seems reasonable that the documentation should include a short note about this as well.
gfx-backend-vulkan enables the validation layers by default when building for debug mode.
These get routed to log according to severity. So you'd see all of them if enabling the logging (e.g. calling env_logger::init()) and running with the Vulkan backend (could be forced with the backend bits here - https://github.com/gfx-rs/wgpu-rs/blob/8b13a10d2d46cb8c8d709e46bd6d12ae1d487e29/src/lib.rs#L526)
Thank you! That did indeed work!
For others. This requires adding a dependency on these crates in your Cargo.toml
[dependencies]
log = "0.4"
env_logger = "0.7"
Initializing logging like
#[macro_use] extern crate log;
fn main () {
env_logger::init();
// Rest of the program
}
And finally running the program and setting the appropriate logging level (see https://docs.rs/log/0.4.10/log/) using an environment variable:
env RUST_LOG=trace cargo run
@HalfVoxel a few notes on your info.
log unless you use it. If you just use wgpu-rs and want to see log messages from it, there is no need to directly involve log.env_logger is one of the way to put them on screen, but not the only way. It's what our examples use, so assume users consider this when writing their apps.Finally, it would be great to have a "Getting Started" wiki page describing:
A wiki page would be great indeed. I was actually about to add one previously, but it looks like the wiki has been disabled for this repository.
@HalfVoxel I added you to the team with rights to edit the wiki.
Thanks!
I added a get started wiki page: https://github.com/gfx-rs/wgpu-rs/wiki/Get-Started and filled it out to the best of my knowledge. But please do correct it if you find any errors in it.
Most helpful comment
Thanks!
I added a get started wiki page: https://github.com/gfx-rs/wgpu-rs/wiki/Get-Started and filled it out to the best of my knowledge. But please do correct it if you find any errors in it.