From 80d19d890c64e2eb00597d907ff565328bf53ddb Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 18 Jul 2023 13:25:48 +0200 Subject: [PATCH] Update `naga` to 0.12.0@git:409239c0e2313bfd0dc4fd64f8c3021185ccef1b (#3935) --- Cargo.lock | 2 +- Cargo.toml | 2 +- wgpu-core/Cargo.toml | 2 +- wgpu-hal/Cargo.toml | 4 ++-- wgpu-hal/src/gles/device.rs | 3 ++- wgpu-hal/src/metal/device.rs | 5 +++-- wgpu-hal/src/vulkan/adapter.rs | 14 +++++++++----- wgpu-hal/src/vulkan/device.rs | 6 ++++-- wgpu-hal/src/vulkan/mod.rs | 2 +- 9 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b4db35e6d..f77a9cf46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1523,7 +1523,7 @@ dependencies = [ [[package]] name = "naga" version = "0.12.0" -source = "git+https://github.com/gfx-rs/naga?rev=76003dc0035d53a474d366dcdf49d2e4d12e921f#76003dc0035d53a474d366dcdf49d2e4d12e921f" +source = "git+https://github.com/gfx-rs/naga?rev=409239c0e2313bfd0dc4fd64f8c3021185ccef1b#409239c0e2313bfd0dc4fd64f8c3021185ccef1b" dependencies = [ "bit-set", "bitflags 2.3.2", diff --git a/Cargo.toml b/Cargo.toml index 156e4dfe3..c322538e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ version = "0.16" [workspace.dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "76003dc0035d53a474d366dcdf49d2e4d12e921f" +rev = "409239c0e2313bfd0dc4fd64f8c3021185ccef1b" version = "0.12.0" [workspace.dependencies] diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 7c8213e8b..6161af820 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -72,7 +72,7 @@ thiserror = "1" [dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "76003dc0035d53a474d366dcdf49d2e4d12e921f" +rev = "409239c0e2313bfd0dc4fd64f8c3021185ccef1b" version = "0.12.0" features = ["clone", "span", "validate"] diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 75b8094dd..f21725ca7 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -120,14 +120,14 @@ android_system_properties = "0.1.1" [dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "76003dc0035d53a474d366dcdf49d2e4d12e921f" +rev = "409239c0e2313bfd0dc4fd64f8c3021185ccef1b" version = "0.12.0" features = ["clone"] # DEV dependencies [dev-dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "76003dc0035d53a474d366dcdf49d2e4d12e921f" +rev = "409239c0e2313bfd0dc4fd64f8c3021185ccef1b" version = "0.12.0" features = ["wgsl-in"] diff --git a/wgpu-hal/src/gles/device.rs b/wgpu-hal/src/gles/device.rs index ecd68b4b8..54f3003fc 100644 --- a/wgpu-hal/src/gles/device.rs +++ b/wgpu-hal/src/gles/device.rs @@ -221,7 +221,8 @@ impl super::Device { let policies = naga::proc::BoundsCheckPolicies { index: BoundsCheckPolicy::Unchecked, buffer: BoundsCheckPolicy::Unchecked, - image: image_check, + image_load: image_check, + image_store: image_check, binding_array: BoundsCheckPolicy::Unchecked, }; diff --git a/wgpu-hal/src/metal/device.rs b/wgpu-hal/src/metal/device.rs index a2f9ed641..b0db65dab 100644 --- a/wgpu-hal/src/metal/device.rs +++ b/wgpu-hal/src/metal/device.rs @@ -99,7 +99,8 @@ impl super::Device { bounds_check_policies: naga::proc::BoundsCheckPolicies { index: bounds_check_policy, buffer: bounds_check_policy, - image: bounds_check_policy, + image_load: bounds_check_policy, + image_store: bounds_check_policy, // TODO: support bounds checks on binding arrays binding_array: naga::proc::BoundsCheckPolicy::Unchecked, }, @@ -107,7 +108,7 @@ impl super::Device { }; let pipeline_options = naga::back::msl::PipelineOptions { - allow_point_size: match primitive_class { + allow_and_force_point_size: match primitive_class { metal::MTLPrimitiveTopologyClass::Point => true, _ => false, }, diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index bfee8545b..ed0bbbda8 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -1201,6 +1201,12 @@ impl super::Adapter { None }; + let image_checks = if self.private_caps.robust_image_access { + naga::proc::BoundsCheckPolicy::Unchecked + } else { + naga::proc::BoundsCheckPolicy::Restrict + }; + let naga_options = { use naga::back::spv; @@ -1262,11 +1268,8 @@ impl super::Adapter { } else { naga::proc::BoundsCheckPolicy::Restrict }, - image: if self.private_caps.robust_image_access { - naga::proc::BoundsCheckPolicy::Unchecked - } else { - naga::proc::BoundsCheckPolicy::Restrict - }, + image_load: image_checks, + image_store: image_checks, // TODO: support bounds checks on binding arrays binding_array: naga::proc::BoundsCheckPolicy::Unchecked, }, @@ -1280,6 +1283,7 @@ impl super::Adapter { }, // We need to build this separately for each invocation, so just default it out here binding_map: BTreeMap::default(), + debug_info: None, } }; diff --git a/wgpu-hal/src/vulkan/device.rs b/wgpu-hal/src/vulkan/device.rs index 1ed98fbd5..43410be88 100644 --- a/wgpu-hal/src/vulkan/device.rs +++ b/wgpu-hal/src/vulkan/device.rs @@ -731,7 +731,8 @@ impl super::Device { temp_options.bounds_check_policies = naga::proc::BoundsCheckPolicies { index: naga::proc::BoundsCheckPolicy::Unchecked, buffer: naga::proc::BoundsCheckPolicy::Unchecked, - image: naga::proc::BoundsCheckPolicy::Unchecked, + image_load: naga::proc::BoundsCheckPolicy::Unchecked, + image_store: naga::proc::BoundsCheckPolicy::Unchecked, binding_array: naga::proc::BoundsCheckPolicy::Unchecked, }; } @@ -1525,7 +1526,8 @@ impl crate::Device for super::Device { naga_options.bounds_check_policies = naga::proc::BoundsCheckPolicies { index: naga::proc::BoundsCheckPolicy::Unchecked, buffer: naga::proc::BoundsCheckPolicy::Unchecked, - image: naga::proc::BoundsCheckPolicy::Unchecked, + image_load: naga::proc::BoundsCheckPolicy::Unchecked, + image_store: naga::proc::BoundsCheckPolicy::Unchecked, binding_array: naga::proc::BoundsCheckPolicy::Unchecked, }; } diff --git a/wgpu-hal/src/vulkan/mod.rs b/wgpu-hal/src/vulkan/mod.rs index 2220ffbe8..694940326 100644 --- a/wgpu-hal/src/vulkan/mod.rs +++ b/wgpu-hal/src/vulkan/mod.rs @@ -283,7 +283,7 @@ pub struct Device { desc_allocator: Mutex>, valid_ash_memory_types: u32, - naga_options: naga::back::spv::Options, + naga_options: naga::back::spv::Options<'static>, #[cfg(feature = "renderdoc")] render_doc: crate::auxil::renderdoc::RenderDoc, }