diff --git a/src/backend/gl/Cargo.toml b/src/backend/gl/Cargo.toml index b1bad702f0c..fbb7eee03c0 100644 --- a/src/backend/gl/Cargo.toml +++ b/src/backend/gl/Cargo.toml @@ -47,7 +47,7 @@ optional = true [dependencies.naga] git = "https://github.com/gfx-rs/naga" -tag = "gfx-17" +tag = "gfx-18" features = ["spv-in", "glsl-out"] [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/src/backend/gl/src/device.rs b/src/backend/gl/src/device.rs index c90ebcf5316..47ec3f964f2 100644 --- a/src/backend/gl/src/device.rs +++ b/src/backend/gl/src/device.rs @@ -532,7 +532,7 @@ impl Device { fn reflect_shader( module: &naga::Module, - ep_info: &naga::proc::analyzer::FunctionInfo, + ep_info: &naga::valid::FunctionInfo, reflection_info: naga::back::glsl::ReflectionInfo, context: CompilationContext, ) { @@ -605,11 +605,11 @@ impl Device { ) -> Result { let mut output = Vec::new(); let mut writer = - naga::back::glsl::Writer::new(&mut output, &shader.module, &shader.analysis, options) + naga::back::glsl::Writer::new(&mut output, &shader.module, &shader.info, options) .map_err(|e| { - log::warn!("Naga GLSL init: {}", e); - d::ShaderError::CompilationFailed(format!("{:?}", e)) - })?; + log::warn!("Naga GLSL init: {}", e); + d::ShaderError::CompilationFailed(format!("{:?}", e)) + })?; let entry_point_index = (&shader.module.entry_points) .into_iter() @@ -623,7 +623,7 @@ impl Device { Ok(reflection_info) => { Self::reflect_shader( &shader.module, - shader.analysis.get_entry_point(entry_point_index), + shader.info.get_entry_point(entry_point_index), reflection_info, context, ); @@ -1207,8 +1207,10 @@ impl d::Device for Device { match parser.parse() { Ok(module) => { log::debug!("Naga module {:#?}", module); - match naga::proc::Validator::new().validate(&module) { - Ok(analysis) => Some(d::NagaShader { module, analysis }), + match naga::valid::Validator::new(naga::valid::ValidationFlags::empty()) + .validate(&module) + { + Ok(info) => Some(d::NagaShader { module, info }), Err(e) => { log::warn!("Naga validation failed: {:?}", e); None @@ -1231,11 +1233,7 @@ impl d::Device for Device { Ok(n::ShaderModule { prefer_naga: true, #[cfg(feature = "cross")] - spv: match naga::back::spv::write_vec( - &shader.module, - &shader.analysis, - &self.spv_options, - ) { + spv: match naga::back::spv::write_vec(&shader.module, &shader.info, &self.spv_options) { Ok(spv) => spv, Err(e) => { return Err((d::ShaderError::CompilationFailed(format!("{}", e)), shader)) diff --git a/src/backend/metal/Cargo.toml b/src/backend/metal/Cargo.toml index 02b952b28a1..a61485ba960 100644 --- a/src/backend/metal/Cargo.toml +++ b/src/backend/metal/Cargo.toml @@ -53,7 +53,7 @@ optional = true [dependencies.naga] git = "https://github.com/gfx-rs/naga" -tag = "gfx-17" +tag = "gfx-18" features = ["spv-in", "msl-out"] # This forces docs.rs to build the crate on mac, otherwise the build fails diff --git a/src/backend/metal/src/device.rs b/src/backend/metal/src/device.rs index 09f93c8f962..46629dca8c9 100644 --- a/src/backend/metal/src/device.rs +++ b/src/backend/metal/src/device.rs @@ -687,7 +687,7 @@ impl Device { naga_options: &naga::back::msl::Options, ) -> Result { let (source, info) = - match naga::back::msl::write_string(&shader.module, &shader.analysis, naga_options) { + match naga::back::msl::write_string(&shader.module, &shader.info, naga_options) { Ok(pair) => pair, Err(e) => { warn!("Naga: {:?}", e); @@ -1876,8 +1876,10 @@ impl hal::device::Device for Device { match parser.parse() { Ok(module) => { debug!("Naga module {:#?}", module); - match naga::proc::Validator::new().validate(&module) { - Ok(analysis) => Ok(d::NagaShader { module, analysis }), + match naga::valid::Validator::new(naga::valid::ValidationFlags::empty()) + .validate(&module) + { + Ok(info) => Ok(d::NagaShader { module, info }), Err(e) => Err(format!("Naga validation: {:?}", e)), } } @@ -1894,11 +1896,7 @@ impl hal::device::Device for Device { Ok(n::ShaderModule { prefer_naga: true, #[cfg(feature = "cross")] - spv: match naga::back::spv::write_vec( - &shader.module, - &shader.analysis, - &self.spv_options, - ) { + spv: match naga::back::spv::write_vec(&shader.module, &shader.info, &self.spv_options) { Ok(spv) => spv, Err(e) => { return Err((d::ShaderError::CompilationFailed(format!("{}", e)), shader)) diff --git a/src/backend/vulkan/Cargo.toml b/src/backend/vulkan/Cargo.toml index 49b1bcb038c..a0d198df41c 100644 --- a/src/backend/vulkan/Cargo.toml +++ b/src/backend/vulkan/Cargo.toml @@ -33,7 +33,7 @@ inplace_it = "0.3.3" [dependencies.naga] git = "https://github.com/gfx-rs/naga" -tag = "gfx-17" +tag = "gfx-18" features = ["spv-out"] optional = true diff --git a/src/backend/vulkan/src/device.rs b/src/backend/vulkan/src/device.rs index 2d977e3f1c0..4937a0069f0 100644 --- a/src/backend/vulkan/src/device.rs +++ b/src/backend/vulkan/src/device.rs @@ -963,7 +963,7 @@ impl d::Device for super::Device { &self, shader: d::NagaShader, ) -> Result { - match naga::back::spv::write_vec(&shader.module, &shader.analysis, &self.naga_options) { + match naga::back::spv::write_vec(&shader.module, &shader.info, &self.naga_options) { Ok(spv) => self.create_shader_module(&spv).map_err(|e| (e, shader)), Err(e) => return Err((d::ShaderError::CompilationFailed(format!("{}", e)), shader)), } diff --git a/src/hal/Cargo.toml b/src/hal/Cargo.toml index c4c0698a9a8..2f4ecd25734 100644 --- a/src/hal/Cargo.toml +++ b/src/hal/Cargo.toml @@ -20,7 +20,7 @@ path = "src/lib.rs" [dependencies] bitflags = "1.0" -naga = { git = "https://github.com/gfx-rs/naga", tag = "gfx-17" } +naga = { git = "https://github.com/gfx-rs/naga", tag = "gfx-18" } raw-window-handle = "0.3" serde = { version = "1", features = ["serde_derive"], optional = true } thiserror = "1" diff --git a/src/hal/src/device.rs b/src/hal/src/device.rs index 394b12a4f5b..476312f55ed 100644 --- a/src/hal/src/device.rs +++ b/src/hal/src/device.rs @@ -163,8 +163,8 @@ pub enum ShaderModuleDesc<'a> { pub struct NagaShader { /// Shader module IR. pub module: naga::Module, - /// Analysis of the module. - pub analysis: naga::proc::analyzer::Analysis, + /// Analysis information of the module. + pub info: naga::valid::ModuleInfo, } /// Logical device handle, responsible for creating and managing resources