From 3bb1f125df7e05f12a6fe1a881518d973d9954b1 Mon Sep 17 00:00:00 2001 From: maratik123 Date: Thu, 15 Feb 2024 21:55:56 +0300 Subject: [PATCH] Up vk version in shader compilation (#2467) * Up vk version in shader compilation * Update test in codegen.rs * cargo +nightly fmt * Update lib.rs * clippy + fmt fixes * simplify changes * post merge --- vulkano-shaders/src/codegen.rs | 9 +++++++-- vulkano-shaders/src/lib.rs | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/vulkano-shaders/src/codegen.rs b/vulkano-shaders/src/codegen.rs index 91561ad1..c546067a 100644 --- a/vulkano-shaders/src/codegen.rs +++ b/vulkano-shaders/src/codegen.rs @@ -262,6 +262,7 @@ pub(super) fn reflect( #[cfg(test)] mod tests { use super::*; + use shaderc::SpirvVersion; use vulkano::shader::reflect; fn convert_paths(root_path: &Path, paths: &[PathBuf]) -> Vec { @@ -579,11 +580,15 @@ mod tests { #[test] fn descriptor_calculation_with_multiple_functions() { let (comp, _) = compile( - &MacroInput::empty(), + &MacroInput { + spirv_version: Some(SpirvVersion::V1_6), + vulkan_version: Some(EnvVersion::Vulkan1_3), + ..MacroInput::empty() + }, None, Path::new(""), r#" - #version 450 + #version 460 layout(set = 1, binding = 0) buffer Buffer { vec3 data; diff --git a/vulkano-shaders/src/lib.rs b/vulkano-shaders/src/lib.rs index cce46cf9..b78153d7 100644 --- a/vulkano-shaders/src/lib.rs +++ b/vulkano-shaders/src/lib.rs @@ -618,7 +618,8 @@ impl Parse for MacroInput { "1.0" => EnvVersion::Vulkan1_0, "1.1" => EnvVersion::Vulkan1_1, "1.2" => EnvVersion::Vulkan1_2, - ver => bail!(lit, "expected `1.0`, `1.1` or `1.2`, found `{ver}`"), + "1.3" => EnvVersion::Vulkan1_3, + ver => bail!(lit, "expected `1.0`, `1.1`, `1.2` or `1.3`, found `{ver}`"), }); } "spirv_version" => {