diff --git a/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs b/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs index 1248da7f80..108ae3e5aa 100644 --- a/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs +++ b/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs @@ -1,7 +1,7 @@ use super::Builder; use crate::builder_spirv::{SpirvValue, SpirvValueExt, SpirvValueKind}; use crate::spirv_type::SpirvType; -use rspirv::spirv::Word; +use rspirv::spirv::{Decoration, Word}; use rustc_codegen_ssa::traits::BuilderMethods; use rustc_errors::ErrorGuaranteed; use rustc_span::DUMMY_SP; @@ -38,9 +38,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }; let u32_ty = SpirvType::Integer(32, false).def(DUMMY_SP, self); let u32_ptr = self.type_ptr_to(u32_ty); + let array = array.def(self); + let actual_index = actual_index.def(self); + self.emit().decorate(array, Decoration::NonUniform, []); + self.emit() + .decorate(actual_index, Decoration::NonUniform, []); let ptr = self .emit() - .in_bounds_access_chain(u32_ptr, None, array.def(self), [actual_index.def(self)]) + .in_bounds_access_chain(u32_ptr, None, array, [actual_index]) .unwrap() .with_type(u32_ptr); self.load(u32_ty, ptr, Align::ONE) diff --git a/crates/spirv-std/src/image.rs b/crates/spirv-std/src/image.rs index 0a9924dbd9..c9c4eb869d 100644 --- a/crates/spirv-std/src/image.rs +++ b/crates/spirv-std/src/image.rs @@ -18,13 +18,13 @@ pub use spirv_std_types::image_params::{ use sample_with::{NoneTy, SampleParams, SomeTy}; -use crate::{float::Float, integer::Integer, vector::Vector, Sampler}; +use crate::{Sampler, float::Float, integer::Integer, vector::Vector}; /// Re-export of primitive types to ensure the `Image` proc macro always points /// to the right type. #[doc(hidden)] pub mod __private { - pub use {f32, f64, i16, i32, i64, i8, u16, u32, u64, u8}; + pub use {f32, f64, i8, i16, i32, i64, u8, u16, u32, u64}; } /// A 1d image used with a sampler. @@ -149,6 +149,8 @@ impl< let mut result = SampledType::Vec4::default(); unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%coordinate = OpLoad _ {coordinate}", "%result = OpImageFetch typeof*{result} %image %coordinate", @@ -200,6 +202,10 @@ impl< let mut result = SampledType::Vec4::default(); unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%typeSampledImage = OpTypeSampledImage typeof*{this}", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", @@ -230,6 +236,10 @@ impl< unsafe { let mut result = SampledType::Vec4::default(); asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%typeSampledImage = OpTypeSampledImage typeof*{1}", "%image = OpLoad typeof*{1} {1}", "%sampler = OpLoad typeof*{2} {2}", @@ -262,6 +272,10 @@ impl< let mut result = SampledType::Vec4::default(); asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%typeSampledImage = OpTypeSampledImage typeof*{1}", "%image = OpLoad typeof*{1} {1}", "%sampler = OpLoad typeof*{2} {2}", @@ -295,6 +309,10 @@ impl< let mut result = SampledType::Vec4::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%coordinate = OpLoad _ {coordinate}", @@ -328,6 +346,10 @@ impl< let mut result = SampledType::Vec4::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%coordinate = OpLoad _ {coordinate}", @@ -362,6 +384,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%coordinate = OpLoad _ {coordinate}", @@ -395,6 +421,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%coordinate = OpLoad _ {coordinate}", @@ -432,6 +462,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%coordinate = OpLoad _ {coordinate}", @@ -487,6 +521,10 @@ impl< unsafe { let mut result = SampledType::Vec4::default(); asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%project_coordinate = OpLoad _ {project_coordinate}", @@ -517,6 +555,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%project_coordinate = OpLoad _ {project_coordinate}", @@ -550,6 +592,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%project_coordinate = OpLoad _ {project_coordinate}", @@ -584,6 +630,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%project_coordinate = OpLoad _ {project_coordinate}", @@ -617,6 +667,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%coordinate = OpLoad _ {coordinate}", @@ -654,6 +708,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%coordinate = OpLoad _ {coordinate}", @@ -710,6 +768,8 @@ impl< unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%coordinate = OpLoad _ {coordinate}", "%result = OpImageRead typeof*{result} %image %coordinate", @@ -733,14 +793,17 @@ impl< ) where I: Integer, { - asm! { - "%image = OpLoad _ {this}", - "%coordinate = OpLoad _ {coordinate}", - "%texels = OpLoad _ {texels}", - "OpImageWrite %image %coordinate %texels", - this = in(reg) self, - coordinate = in(reg) &coordinate, - texels = in(reg) &texels, + unsafe { + asm! { + "OpDecorate %image NonUniform", + "%image = OpLoad _ {this}", + "%coordinate = OpLoad _ {coordinate}", + "%texels = OpLoad _ {texels}", + "OpImageWrite %image %coordinate %texels", + this = in(reg) self, + coordinate = in(reg) &coordinate, + texels = in(reg) &texels, + } } } } @@ -779,6 +842,8 @@ impl< unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%coordinate = OpLoad _ {coordinate}", "%result = OpImageRead typeof*{result} %image %coordinate", @@ -802,14 +867,17 @@ impl< ) where I: Integer, { - asm! { - "%image = OpLoad _ {this}", - "%coordinate = OpLoad _ {coordinate}", - "%texels = OpLoad _ {texels}", - "OpImageWrite %image %coordinate %texels", - this = in(reg) self, - coordinate = in(reg) &coordinate, - texels = in(reg) &texels, + unsafe { + asm! { + "OpDecorate %image NonUniform", + "%image = OpLoad _ {this}", + "%coordinate = OpLoad _ {coordinate}", + "%texels = OpLoad _ {texels}", + "OpImageWrite %image %coordinate %texels", + this = in(reg) self, + coordinate = in(reg) &coordinate, + texels = in(reg) &texels, + } } } } @@ -848,13 +916,15 @@ impl< unsafe { asm! { - "%image = OpLoad _ {this}", - "%coordinate = OpLoad _ {coordinate}", - "%result = OpImageRead typeof*{result} %image %coordinate", - "OpStore {result} %result", - this = in(reg) self, - coordinate = in(reg) &coordinate, - result = in(reg) &mut result, + "OpDecorate %image NonUniform", + "OpDecorate %result NonUniform", + "%image = OpLoad _ {this}", + "%coordinate = OpLoad _ {coordinate}", + "%result = OpImageRead typeof*{result} %image %coordinate", + "OpStore {result} %result", + this = in(reg) self, + coordinate = in(reg) &coordinate, + result = in(reg) &mut result, } } @@ -880,13 +950,16 @@ impl< where Self: HasQueryLevels, { - let result: u32; + let mut result = Default::default(); unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", - "{result} = OpImageQueryLevels typeof{result} %image", + "%result = OpImageQueryLevels typeof*{result} %image", + "OpStore {result} %result", this = in(reg) self, - result = out(reg) result, + result = in(reg) &mut result, } } result @@ -940,6 +1013,8 @@ impl< let mut result: Size = Default::default(); unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%result = OpImageQuerySize typeof*{result} %image", "OpStore {result} %result", @@ -984,6 +1059,8 @@ impl< let mut result: Size = Default::default(); unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%result = OpImageQuerySizeLod typeof*{result} %image {lod}", "OpStore {result} %result", @@ -1019,13 +1096,16 @@ impl< #[crate::macros::gpu_only] #[doc(alias = "OpImageQuerySamples")] pub fn query_samples(&self) -> u32 { - let result: u32; + let mut result = Default::default(); unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", - "{result} = OpImageQuerySamples typeof{result} %image", + "%result = OpImageQuerySamples typeof*{result} %image", + "OpStore {result} %result", this = in(reg) self, - result = out(reg) result, + result = in(reg) &mut result, } } result @@ -1065,6 +1145,7 @@ impl< >, > { + // FIXME /// Sample texels at `coord` from the sampled image with an implicit lod. #[crate::macros::gpu_only] pub fn sample( @@ -1077,6 +1158,8 @@ impl< let mut result = SampledType::Vec4::default(); unsafe { asm!( + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%sampledImage = OpLoad typeof*{1} {1}", "%coord = OpLoad typeof*{2} {2}", "%result = OpImageSampleImplicitLod typeof*{0} %sampledImage %coord", @@ -1102,6 +1185,8 @@ impl< let mut result = SampledType::Vec4::default(); unsafe { asm!( + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%sampledImage = OpLoad typeof*{1} {1}", "%coord = OpLoad typeof*{2} {2}", "%lod = OpLoad typeof*{3} {3}", @@ -1236,6 +1321,8 @@ impl< let mut result = SampledType::Vec4::default(); unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%coordinate = OpLoad _ {coordinate}", "%result = OpImageFetch typeof*{result} %image %coordinate $PARAMS", @@ -1266,6 +1353,10 @@ impl< let mut result = SampledType::Vec4::default(); unsafe { asm! { + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%typeSampledImage = OpTypeSampledImage typeof*{this}", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", @@ -1297,6 +1388,10 @@ impl< unsafe { let mut result = SampledType::Vec4::default(); asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%typeSampledImage = OpTypeSampledImage typeof*{this}", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", @@ -1329,6 +1424,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%coordinate = OpLoad _ {coordinate}", @@ -1361,6 +1460,10 @@ impl< unsafe { let mut result = SampledType::Vec4::default(); asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%project_coordinate = OpLoad _ {project_coordinate}", @@ -1392,6 +1495,10 @@ impl< let mut result = Default::default(); unsafe { asm!( + "OpDecorate %image NonUniform", + "OpDecorate %sampler NonUniform", + "OpDecorate %sampledImage NonUniform", + "OpDecorate %result NonUniform", "%image = OpLoad _ {this}", "%sampler = OpLoad _ {sampler}", "%project_coordinate = OpLoad _ {project_coordinate}", diff --git a/tests/ui/byte_addressable_buffer/arr.rs b/tests/ui/byte_addressable_buffer/arr.rs index 798c3cd515..1610eaac87 100644 --- a/tests/ui/byte_addressable_buffer/arr.rs +++ b/tests/ui/byte_addressable_buffer/arr.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{glam::Vec4, ByteAddressableBuffer}; +use spirv_std::{ByteAddressableBuffer, glam::Vec4}; #[spirv(fragment)] pub fn load( diff --git a/tests/ui/byte_addressable_buffer/big_struct.rs b/tests/ui/byte_addressable_buffer/big_struct.rs index 233cb87fae..892a3c37f3 100644 --- a/tests/ui/byte_addressable_buffer/big_struct.rs +++ b/tests/ui/byte_addressable_buffer/big_struct.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing -use spirv_std::spirv; use spirv_std::ByteAddressableBuffer; +use spirv_std::spirv; pub struct BigStruct { a: u32, diff --git a/tests/ui/byte_addressable_buffer/complex.rs b/tests/ui/byte_addressable_buffer/complex.rs index b9e3edf128..5b2fc92bde 100644 --- a/tests/ui/byte_addressable_buffer/complex.rs +++ b/tests/ui/byte_addressable_buffer/complex.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{glam::Vec2, ByteAddressableBuffer}; +use spirv_std::{ByteAddressableBuffer, glam::Vec2}; pub struct Complex { x: u32, diff --git a/tests/ui/byte_addressable_buffer/f32.rs b/tests/ui/byte_addressable_buffer/f32.rs index 2b82f89d16..9a0e8317ab 100644 --- a/tests/ui/byte_addressable_buffer/f32.rs +++ b/tests/ui/byte_addressable_buffer/f32.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing -use spirv_std::spirv; use spirv_std::ByteAddressableBuffer; +use spirv_std::spirv; #[spirv(fragment)] pub fn load(#[spirv(descriptor_set = 0, binding = 0, storage_buffer)] buf: &[u32], out: &mut f32) { diff --git a/tests/ui/byte_addressable_buffer/small_struct.rs b/tests/ui/byte_addressable_buffer/small_struct.rs index 948af2dd92..493d2a8775 100644 --- a/tests/ui/byte_addressable_buffer/small_struct.rs +++ b/tests/ui/byte_addressable_buffer/small_struct.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing -use spirv_std::spirv; use spirv_std::ByteAddressableBuffer; +use spirv_std::spirv; pub struct SmallStruct { a: u32, diff --git a/tests/ui/byte_addressable_buffer/u32.rs b/tests/ui/byte_addressable_buffer/u32.rs index d0e1e44624..50494fa044 100644 --- a/tests/ui/byte_addressable_buffer/u32.rs +++ b/tests/ui/byte_addressable_buffer/u32.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing -use spirv_std::spirv; use spirv_std::ByteAddressableBuffer; +use spirv_std::spirv; #[spirv(fragment)] pub fn load(#[spirv(descriptor_set = 0, binding = 0, storage_buffer)] buf: &[u32], out: &mut u32) { diff --git a/tests/ui/byte_addressable_buffer/vec.rs b/tests/ui/byte_addressable_buffer/vec.rs index e934071b12..d33f0a9ff7 100644 --- a/tests/ui/byte_addressable_buffer/vec.rs +++ b/tests/ui/byte_addressable_buffer/vec.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{glam::Vec4, ByteAddressableBuffer}; +use spirv_std::{ByteAddressableBuffer, glam::Vec4}; #[spirv(matrix)] pub struct Mat4 { diff --git a/tests/ui/image/components.rs b/tests/ui/image/components.rs index f63c7ea0c7..22aec2ceaa 100644 --- a/tests/ui/image/components.rs +++ b/tests/ui/image/components.rs @@ -1,9 +1,9 @@ // build-pass -// compile-flags: -Ctarget-feature=+StorageImageExtendedFormats +// compile-flags: -Ctarget-feature=+StorageImageExtendedFormats,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use glam::{Vec2, Vec3, Vec4}; use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/fetch.rs b/tests/ui/image/fetch.rs index c21cfadb9c..38cb0006fd 100644 --- a/tests/ui/image/fetch.rs +++ b/tests/ui/image/fetch.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/format.rs b/tests/ui/image/format.rs index 5b4232b172..a6dce26866 100644 --- a/tests/ui/image/format.rs +++ b/tests/ui/image/format.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/gather.rs b/tests/ui/image/gather.rs index 9e11f440e9..86b4b1f436 100644 --- a/tests/ui/image/gather.rs +++ b/tests/ui/image/gather.rs @@ -1,9 +1,10 @@ // Test `OpImageGather` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use core::arch::asm; use spirv_std::spirv; -use spirv_std::{arch, Image, Sampler}; +use spirv_std::{Image, Sampler, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/gather_err.rs b/tests/ui/image/gather_err.rs index 917b447327..461887fb41 100644 --- a/tests/ui/image/gather_err.rs +++ b/tests/ui/image/gather_err.rs @@ -1,8 +1,8 @@ // build-fail // normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/" -// compile-flags: -Ctarget-feature=+Sampled1D +// compile-flags: -Ctarget-feature=+Sampled1D,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing -use spirv_std::{arch, spirv, Image, Sampler}; +use spirv_std::{Image, Sampler, arch, spirv}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/gather_err.stderr b/tests/ui/image/gather_err.stderr index f3d2f4cfe0..550fdfd018 100644 --- a/tests/ui/image/gather_err.stderr +++ b/tests/ui/image/gather_err.stderr @@ -9,12 +9,12 @@ error[E0277]: the trait bound `Image: HasGather` is no Image Image note: required by a bound in `Image::::gather` - --> $SPIRV_STD_SRC/image.rs:197:15 + --> $SPIRV_STD_SRC/image.rs:199:15 | -190 | pub fn gather( +192 | pub fn gather( | ------ required by a bound in this associated function ... -197 | Self: HasGather, +199 | Self: HasGather, | ^^^^^^^^^ required by this bound in `Image::::gather` error[E0277]: the trait bound `Image: HasGather` is not satisfied @@ -28,12 +28,12 @@ error[E0277]: the trait bound `Image: HasGather` is no Image Image note: required by a bound in `Image::::gather` - --> $SPIRV_STD_SRC/image.rs:197:15 + --> $SPIRV_STD_SRC/image.rs:199:15 | -190 | pub fn gather( +192 | pub fn gather( | ------ required by a bound in this associated function ... -197 | Self: HasGather, +199 | Self: HasGather, | ^^^^^^^^^ required by this bound in `Image::::gather` error: aborting due to 2 previous errors diff --git a/tests/ui/image/image_with.rs b/tests/ui/image/image_with.rs index 461503b194..05e5a93b4e 100644 --- a/tests/ui/image/image_with.rs +++ b/tests/ui/image/image_with.rs @@ -1,7 +1,8 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, image::sample_with, image::ImageWithMethods, Image, Sampler}; +use spirv_std::{Image, Sampler, arch, image::ImageWithMethods, image::sample_with}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/issue_527.rs b/tests/ui/image/issue_527.rs index 1e81023671..9271eb087c 100644 --- a/tests/ui/image/issue_527.rs +++ b/tests/ui/image/issue_527.rs @@ -1,5 +1,5 @@ // build-pass -// compile-flags: -C target-feature=+StorageImageWriteWithoutFormat +// compile-flags: -C target-feature=+StorageImageWriteWithoutFormat,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use glam::*; use spirv_std::spirv; diff --git a/tests/ui/image/query/query_levels.rs b/tests/ui/image/query/query_levels.rs index 79f51bd7a5..4728f379d2 100644 --- a/tests/ui/image/query/query_levels.rs +++ b/tests/ui/image/query/query_levels.rs @@ -1,8 +1,8 @@ // build-pass -// compile-flags: -C target-feature=+ImageQuery +// compile-flags: -C target-feature=+ImageQuery,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/query/query_levels_err.stderr b/tests/ui/image/query/query_levels_err.stderr index 2f03a3f426..c49926bd05 100644 --- a/tests/ui/image/query/query_levels_err.stderr +++ b/tests/ui/image/query/query_levels_err.stderr @@ -10,12 +10,12 @@ error[E0277]: the trait bound `Image: HasQueryLevels` Image Image note: required by a bound in `Image::::query_levels` - --> $SPIRV_STD_SRC/image.rs:881:15 + --> $SPIRV_STD_SRC/image.rs:951:15 | -879 | pub fn query_levels(&self) -> u32 +949 | pub fn query_levels(&self) -> u32 | ------------ required by a bound in this associated function -880 | where -881 | Self: HasQueryLevels, +950 | where +951 | Self: HasQueryLevels, | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_levels` error: aborting due to 1 previous error diff --git a/tests/ui/image/query/query_lod.rs b/tests/ui/image/query/query_lod.rs index a36e835ecc..775479fa3b 100644 --- a/tests/ui/image/query/query_lod.rs +++ b/tests/ui/image/query/query_lod.rs @@ -1,8 +1,8 @@ // build-pass -// compile-flags: -C target-feature=+ImageQuery +// compile-flags: -C target-feature=+ImageQuery,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image, Sampler}; +use spirv_std::{Image, Sampler, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/query/query_lod_err.rs b/tests/ui/image/query/query_lod_err.rs index f07564c990..af84b46be5 100644 --- a/tests/ui/image/query/query_lod_err.rs +++ b/tests/ui/image/query/query_lod_err.rs @@ -1,8 +1,8 @@ // build-fail // normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/" -// compile-flags: -C target-feature=+ImageQuery +// compile-flags: -C target-feature=+ImageQuery,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing -use spirv_std::{arch, spirv, Image, Sampler}; +use spirv_std::{Image, Sampler, arch, spirv}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/query/query_lod_err.stderr b/tests/ui/image/query/query_lod_err.stderr index 0b6a9a052c..e985e690b5 100644 --- a/tests/ui/image/query/query_lod_err.stderr +++ b/tests/ui/image/query/query_lod_err.stderr @@ -10,12 +10,12 @@ error[E0277]: the trait bound `Image: HasQueryLevels` Image Image note: required by a bound in `Image::::query_lod` - --> $SPIRV_STD_SRC/image.rs:907:15 + --> $SPIRV_STD_SRC/image.rs:980:15 | -901 | pub fn query_lod( +974 | pub fn query_lod( | --------- required by a bound in this associated function ... -907 | Self: HasQueryLevels, +980 | Self: HasQueryLevels, | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_lod` error: aborting due to 1 previous error diff --git a/tests/ui/image/query/query_samples.rs b/tests/ui/image/query/query_samples.rs index eeeb1e15cf..63986bcc76 100644 --- a/tests/ui/image/query/query_samples.rs +++ b/tests/ui/image/query/query_samples.rs @@ -1,8 +1,8 @@ // build-pass -// compile-flags: -C target-feature=+ImageQuery +// compile-flags: -C target-feature=+ImageQuery,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/query/query_size.rs b/tests/ui/image/query/query_size.rs index af2a71994c..ea87bd25c9 100644 --- a/tests/ui/image/query/query_size.rs +++ b/tests/ui/image/query/query_size.rs @@ -1,8 +1,8 @@ // build-pass -// compile-flags: -C target-feature=+ImageQuery +// compile-flags: -C target-feature=+ImageQuery,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/query/query_size_err.rs b/tests/ui/image/query/query_size_err.rs index afc59a467b..5a453ae663 100644 --- a/tests/ui/image/query/query_size_err.rs +++ b/tests/ui/image/query/query_size_err.rs @@ -1,8 +1,8 @@ // build-fail // normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/" -// compile-flags: -C target-feature=+ImageQuery +// compile-flags: -C target-feature=+ImageQuery,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing -use spirv_std::{arch, spirv, Image}; +use spirv_std::{Image, arch, spirv}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/query/query_size_err.stderr b/tests/ui/image/query/query_size_err.stderr index b35b9c1298..59089f798e 100644 --- a/tests/ui/image/query/query_size_err.stderr +++ b/tests/ui/image/query/query_size_err.stderr @@ -1,27 +1,27 @@ error[E0277]: the trait bound `Image: HasQuerySize` is not satisfied - --> $DIR/query_size_err.rs:12:21 - | -12 | *output = image.query_size(); - | ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image` - | - = help: the following other types implement trait `HasQuerySize`: - Image - Image - Image - Image - Image - Image - Image - Image - and 6 others + --> $DIR/query_size_err.rs:12:21 + | +12 | *output = image.query_size(); + | ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image` + | + = help: the following other types implement trait `HasQuerySize`: + Image + Image + Image + Image + Image + Image + Image + Image + and 6 others note: required by a bound in `Image::::query_size` - --> $SPIRV_STD_SRC/image.rs:938:15 - | -936 | pub fn query_size + Default>(&self) -> Size - | ---------- required by a bound in this associated function -937 | where -938 | Self: HasQuerySize, - | ^^^^^^^^^^^^ required by this bound in `Image::::query_size` + --> $SPIRV_STD_SRC/image.rs:1011:15 + | +1009 | pub fn query_size + Default>(&self) -> Size + | ---------- required by a bound in this associated function +1010 | where +1011 | Self: HasQuerySize, + | ^^^^^^^^^^^^ required by this bound in `Image::::query_size` error: aborting due to 1 previous error diff --git a/tests/ui/image/query/query_size_lod.rs b/tests/ui/image/query/query_size_lod.rs index c80c0ca216..f226463e24 100644 --- a/tests/ui/image/query/query_size_lod.rs +++ b/tests/ui/image/query/query_size_lod.rs @@ -1,8 +1,8 @@ // build-pass -// compile-flags: -C target-feature=+ImageQuery +// compile-flags: -C target-feature=+ImageQuery,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/query/query_size_lod_err.rs b/tests/ui/image/query/query_size_lod_err.rs index c106689f6c..ad21d0615d 100644 --- a/tests/ui/image/query/query_size_lod_err.rs +++ b/tests/ui/image/query/query_size_lod_err.rs @@ -1,8 +1,8 @@ // build-fail // normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/" -// compile-flags: -C target-feature=+ImageQuery +// compile-flags: -C target-feature=+ImageQuery,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing -use spirv_std::{arch, spirv, Image}; +use spirv_std::{Image, arch, spirv}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/query/query_size_lod_err.stderr b/tests/ui/image/query/query_size_lod_err.stderr index 20464eb29a..0a02ae22d9 100644 --- a/tests/ui/image/query/query_size_lod_err.stderr +++ b/tests/ui/image/query/query_size_lod_err.stderr @@ -1,22 +1,22 @@ error[E0277]: the trait bound `Image: HasQuerySizeLod` is not satisfied - --> $DIR/query_size_lod_err.rs:12:21 - | -12 | *output = image.query_size_lod(0); - | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` - | - = help: the following other types implement trait `HasQuerySizeLod`: - Image - Image - Image - Image + --> $DIR/query_size_lod_err.rs:12:21 + | +12 | *output = image.query_size_lod(0); + | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` + | + = help: the following other types implement trait `HasQuerySizeLod`: + Image + Image + Image + Image note: required by a bound in `Image::::query_size_lod` - --> $SPIRV_STD_SRC/image.rs:982:15 - | -977 | pub fn query_size_lod + Default>( - | -------------- required by a bound in this associated function + --> $SPIRV_STD_SRC/image.rs:1057:15 + | +1052 | pub fn query_size_lod + Default>( + | -------------- required by a bound in this associated function ... -982 | Self: HasQuerySizeLod, - | ^^^^^^^^^^^^^^^ required by this bound in `Image::::query_size_lod` +1057 | Self: HasQuerySizeLod, + | ^^^^^^^^^^^^^^^ required by this bound in `Image::::query_size_lod` error: aborting due to 1 previous error diff --git a/tests/ui/image/read.rs b/tests/ui/image/read.rs index 295708b873..707c2eee4f 100644 --- a/tests/ui/image/read.rs +++ b/tests/ui/image/read.rs @@ -1,9 +1,9 @@ // Test `OpImageRead` // build-pass -// compile-flags: -C target-feature=+StorageImageReadWithoutFormat +// compile-flags: -C target-feature=+StorageImageReadWithoutFormat,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/read_subpass.rs b/tests/ui/image/read_subpass.rs index 475233698b..6b6e0da16e 100644 --- a/tests/ui/image/read_subpass.rs +++ b/tests/ui/image/read_subpass.rs @@ -1,8 +1,8 @@ // build-pass -// compile-flags: -C target-feature=+InputAttachment +// compile-flags: -C target-feature=+InputAttachment,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/sample.rs b/tests/ui/image/sample.rs index bc5cc44757..78755c91c0 100644 --- a/tests/ui/image/sample.rs +++ b/tests/ui/image/sample.rs @@ -1,8 +1,9 @@ // Test `OpImageSampleImplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image, Sampler}; +use spirv_std::{Image, Sampler, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/sample_bias.rs b/tests/ui/image/sample_bias.rs index 09d3bfa9a7..cde326b2fe 100644 --- a/tests/ui/image/sample_bias.rs +++ b/tests/ui/image/sample_bias.rs @@ -1,8 +1,9 @@ // Test `OpImageSampleImplicitLod` Bias // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image, Sampler}; +use spirv_std::{Image, Sampler, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/sample_depth_reference/sample.rs b/tests/ui/image/sample_depth_reference/sample.rs index 4de6b2c311..c085cbe0c3 100644 --- a/tests/ui/image/sample_depth_reference/sample.rs +++ b/tests/ui/image/sample_depth_reference/sample.rs @@ -1,8 +1,9 @@ // Test `OpImageSampleDrefImplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image, Sampler}; +use spirv_std::{Image, Sampler, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/sample_depth_reference/sample_gradient.rs b/tests/ui/image/sample_depth_reference/sample_gradient.rs index a197e37af6..f369677044 100644 --- a/tests/ui/image/sample_depth_reference/sample_gradient.rs +++ b/tests/ui/image/sample_depth_reference/sample_gradient.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleDrefExplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler}; diff --git a/tests/ui/image/sample_depth_reference/sample_lod.rs b/tests/ui/image/sample_depth_reference/sample_lod.rs index dea60aec74..bfff13de33 100644 --- a/tests/ui/image/sample_depth_reference/sample_lod.rs +++ b/tests/ui/image/sample_depth_reference/sample_lod.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleDrefExplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler}; diff --git a/tests/ui/image/sample_depth_reference_with_project_coordinate/sample.rs b/tests/ui/image/sample_depth_reference_with_project_coordinate/sample.rs index e0d9987440..45309de8a1 100644 --- a/tests/ui/image/sample_depth_reference_with_project_coordinate/sample.rs +++ b/tests/ui/image/sample_depth_reference_with_project_coordinate/sample.rs @@ -1,8 +1,9 @@ // Test `OpImageSampleProjDrefImplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image, Sampler}; +use spirv_std::{Image, Sampler, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/sample_depth_reference_with_project_coordinate/sample_gradient.rs b/tests/ui/image/sample_depth_reference_with_project_coordinate/sample_gradient.rs index d1f5aba513..cf7e27d8be 100644 --- a/tests/ui/image/sample_depth_reference_with_project_coordinate/sample_gradient.rs +++ b/tests/ui/image/sample_depth_reference_with_project_coordinate/sample_gradient.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleProjDrefExplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler}; diff --git a/tests/ui/image/sample_depth_reference_with_project_coordinate/sample_lod.rs b/tests/ui/image/sample_depth_reference_with_project_coordinate/sample_lod.rs index 7c9e75693a..a6e5d74573 100644 --- a/tests/ui/image/sample_depth_reference_with_project_coordinate/sample_lod.rs +++ b/tests/ui/image/sample_depth_reference_with_project_coordinate/sample_lod.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleProjDrefExplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler}; diff --git a/tests/ui/image/sample_gradient.rs b/tests/ui/image/sample_gradient.rs index a8336c5838..64ec6a4d1e 100644 --- a/tests/ui/image/sample_gradient.rs +++ b/tests/ui/image/sample_gradient.rs @@ -1,8 +1,9 @@ // Test `OpImageSampleExplicitLod` Grad // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image, Sampler}; +use spirv_std::{Image, Sampler, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/sample_lod.rs b/tests/ui/image/sample_lod.rs index 0280bd3faa..7f249544e9 100644 --- a/tests/ui/image/sample_lod.rs +++ b/tests/ui/image/sample_lod.rs @@ -1,8 +1,9 @@ // Test `OpImageSampleExplicitLod` Lod // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, image::SampledImage, Image, Sampler}; +use spirv_std::{Image, Sampler, arch, image::SampledImage}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/sample_with_project_coordinate/sample.rs b/tests/ui/image/sample_with_project_coordinate/sample.rs index 580b26b7d5..33a962c5f3 100644 --- a/tests/ui/image/sample_with_project_coordinate/sample.rs +++ b/tests/ui/image/sample_with_project_coordinate/sample.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleProjImplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler}; diff --git a/tests/ui/image/sample_with_project_coordinate/sample_gradient.rs b/tests/ui/image/sample_with_project_coordinate/sample_gradient.rs index 7d39d801de..8b1389fe08 100644 --- a/tests/ui/image/sample_with_project_coordinate/sample_gradient.rs +++ b/tests/ui/image/sample_with_project_coordinate/sample_gradient.rs @@ -1,8 +1,9 @@ // Test `OpImageSampleProjExplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image, Sampler}; +use spirv_std::{Image, Sampler, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/sample_with_project_coordinate/sample_lod.rs b/tests/ui/image/sample_with_project_coordinate/sample_lod.rs index aa4245c7e0..6c8f30082a 100644 --- a/tests/ui/image/sample_with_project_coordinate/sample_lod.rs +++ b/tests/ui/image/sample_with_project_coordinate/sample_lod.rs @@ -1,8 +1,9 @@ // Test `OpImageSampleProjExplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image, Sampler}; +use spirv_std::{Image, Sampler, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/image/write.rs b/tests/ui/image/write.rs index 314f0f4ba4..390055371d 100644 --- a/tests/ui/image/write.rs +++ b/tests/ui/image/write.rs @@ -1,9 +1,9 @@ // Test `OpImageWrite` // build-pass -// compile-flags: -C target-feature=+StorageImageWriteWithoutFormat +// compile-flags: -C target-feature=+StorageImageWriteWithoutFormat,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; -use spirv_std::{arch, Image}; +use spirv_std::{Image, arch}; #[spirv(fragment)] pub fn main( diff --git a/tests/ui/storage_class/runtime_descriptor_array.rs b/tests/ui/storage_class/runtime_descriptor_array.rs index 0596b56725..62dc4cbb12 100644 --- a/tests/ui/storage_class/runtime_descriptor_array.rs +++ b/tests/ui/storage_class/runtime_descriptor_array.rs @@ -1,5 +1,5 @@ // build-pass -// compile-flags: -C target-feature=+RuntimeDescriptorArray,+ext:SPV_EXT_descriptor_indexing +// compile-flags: -C target-feature=+RuntimeDescriptorArray,+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, RuntimeArray, Sampler};