Try add renderdoc vulkan layer
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 4m59s

This commit is contained in:
Florian RICHER 2025-03-21 17:13:27 +01:00
parent 6b6534df76
commit 1d0ef32f60
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
2 changed files with 11 additions and 3 deletions

View file

@ -31,7 +31,7 @@
cargo = rust;
});
buildInputs = with pkgs; [ vulkan-headers vulkan-loader vulkan-validation-layers ]
buildInputs = with pkgs; [ vulkan-headers vulkan-loader vulkan-validation-layers renderdoc ]
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux (with pkgs; [ libxkbcommon wayland libGL ])
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin (with pkgs; [ darwin.apple_sdk.frameworks.SystemConfiguration ]);
@ -45,6 +45,7 @@
devShells = {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
renderdoc
(rust.override { extensions = [ "rust-src" "rust-analyzer" ]; })
] ++ nativeBuildInputs;
@ -52,7 +53,7 @@
++ [ pkgs.nixgl.auto.nixVulkanNvidia pkgs.nixgl.nixVulkanMesa ];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d:${pkgs.renderdoc}/share/vulkan/implicit_layer.d";
RUST_LOG = "info,rust_vulkan_test=trace";
};
};

View file

@ -41,6 +41,10 @@ impl App {
pub fn new(event_loop: &EventLoop<()>) -> Self {
let library = VulkanLibrary::new().unwrap();
for layer in library.layer_properties().unwrap() {
log::debug!("Available layer: {}", layer.name());
}
let required_extensions = Surface::required_extensions(event_loop).unwrap();
let instance = Instance::new(
@ -52,6 +56,7 @@ impl App {
enabled_extensions: required_extensions,
enabled_layers: vec![
String::from("VK_LAYER_KHRONOS_validation"),
String::from("VK_LAYER_RENDERDOC_Capture"),
],
..Default::default()
},
@ -90,7 +95,7 @@ impl App {
})
.expect("no suitable physical device found");
println!(
log::debug!(
"Using device: {} (type: {:?})",
physical_device.properties().device_name,
physical_device.properties().device_type,
@ -100,6 +105,8 @@ impl App {
device_extensions.khr_dynamic_rendering = true;
}
log::debug!("Using device extensions: {:#?}", device_extensions);
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {