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 76260a7765..0fe8de5df9 100644 --- a/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs +++ b/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs @@ -4,7 +4,7 @@ use crate::maybe_pqp_cg_ssa as rustc_codegen_ssa; 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; @@ -41,9 +41,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 e37fe641df..37de2b1db4 100644 --- a/crates/spirv-std/src/image.rs +++ b/crates/spirv-std/src/image.rs @@ -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 @@ -1067,6 +1147,7 @@ impl< >, > { + // FIXME /// Sample texels at `coord` from the sampled image with an implicit lod. #[crate::macros::gpu_only] pub fn sample( @@ -1079,6 +1160,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", @@ -1104,6 +1187,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}", @@ -1238,6 +1323,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", @@ -1268,6 +1355,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}", @@ -1299,6 +1390,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}", @@ -1331,6 +1426,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}", @@ -1363,6 +1462,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}", @@ -1394,6 +1497,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 b9396ffb85..1610eaac87 100644 --- a/tests/ui/byte_addressable_buffer/arr.rs +++ b/tests/ui/byte_addressable_buffer/arr.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{ByteAddressableBuffer, glam::Vec4}; diff --git a/tests/ui/byte_addressable_buffer/big_struct.rs b/tests/ui/byte_addressable_buffer/big_struct.rs index 5ffe96c097..892a3c37f3 100644 --- a/tests/ui/byte_addressable_buffer/big_struct.rs +++ b/tests/ui/byte_addressable_buffer/big_struct.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::ByteAddressableBuffer; use spirv_std::spirv; diff --git a/tests/ui/byte_addressable_buffer/complex.rs b/tests/ui/byte_addressable_buffer/complex.rs index 1932755415..5b2fc92bde 100644 --- a/tests/ui/byte_addressable_buffer/complex.rs +++ b/tests/ui/byte_addressable_buffer/complex.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{ByteAddressableBuffer, glam::Vec2}; diff --git a/tests/ui/byte_addressable_buffer/f32.rs b/tests/ui/byte_addressable_buffer/f32.rs index 602016a10d..9a0e8317ab 100644 --- a/tests/ui/byte_addressable_buffer/f32.rs +++ b/tests/ui/byte_addressable_buffer/f32.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::ByteAddressableBuffer; use spirv_std::spirv; diff --git a/tests/ui/byte_addressable_buffer/small_struct.rs b/tests/ui/byte_addressable_buffer/small_struct.rs index 2fb315ac13..493d2a8775 100644 --- a/tests/ui/byte_addressable_buffer/small_struct.rs +++ b/tests/ui/byte_addressable_buffer/small_struct.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::ByteAddressableBuffer; use spirv_std::spirv; diff --git a/tests/ui/byte_addressable_buffer/u32.rs b/tests/ui/byte_addressable_buffer/u32.rs index 0b4b709608..50494fa044 100644 --- a/tests/ui/byte_addressable_buffer/u32.rs +++ b/tests/ui/byte_addressable_buffer/u32.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::ByteAddressableBuffer; use spirv_std::spirv; diff --git a/tests/ui/byte_addressable_buffer/vec.rs b/tests/ui/byte_addressable_buffer/vec.rs index 2f3342aa0b..d33f0a9ff7 100644 --- a/tests/ui/byte_addressable_buffer/vec.rs +++ b/tests/ui/byte_addressable_buffer/vec.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{ByteAddressableBuffer, glam::Vec4}; diff --git a/tests/ui/image/components.rs b/tests/ui/image/components.rs index 34e010fbcd..22aec2ceaa 100644 --- a/tests/ui/image/components.rs +++ b/tests/ui/image/components.rs @@ -1,5 +1,5 @@ // 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; diff --git a/tests/ui/image/fetch.rs b/tests/ui/image/fetch.rs index 674c3400bb..38cb0006fd 100644 --- a/tests/ui/image/fetch.rs +++ b/tests/ui/image/fetch.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, arch}; diff --git a/tests/ui/image/format.rs b/tests/ui/image/format.rs index e9f2386c10..a6dce26866 100644 --- a/tests/ui/image/format.rs +++ b/tests/ui/image/format.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, arch}; diff --git a/tests/ui/image/gather.rs b/tests/ui/image/gather.rs index d4a555193b..86b4b1f436 100644 --- a/tests/ui/image/gather.rs +++ b/tests/ui/image/gather.rs @@ -1,5 +1,6 @@ // Test `OpImageGather` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use core::arch::asm; use spirv_std::spirv; diff --git a/tests/ui/image/gather_err.rs b/tests/ui/image/gather_err.rs index e44da14565..461887fb41 100644 --- a/tests/ui/image/gather_err.rs +++ b/tests/ui/image/gather_err.rs @@ -1,6 +1,6 @@ // 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::{Image, Sampler, arch, spirv}; 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 90d8d62b2f..05e5a93b4e 100644 --- a/tests/ui/image/image_with.rs +++ b/tests/ui/image/image_with.rs @@ -1,4 +1,5 @@ // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler, arch, image::ImageWithMethods, image::sample_with}; 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 061dc4bacc..4728f379d2 100644 --- a/tests/ui/image/query/query_levels.rs +++ b/tests/ui/image/query/query_levels.rs @@ -1,5 +1,5 @@ // 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::{Image, arch}; 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 4d764d0514..775479fa3b 100644 --- a/tests/ui/image/query/query_lod.rs +++ b/tests/ui/image/query/query_lod.rs @@ -1,5 +1,5 @@ // 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::{Image, Sampler, arch}; diff --git a/tests/ui/image/query/query_lod_err.rs b/tests/ui/image/query/query_lod_err.rs index 74e86972f1..af84b46be5 100644 --- a/tests/ui/image/query/query_lod_err.rs +++ b/tests/ui/image/query/query_lod_err.rs @@ -1,6 +1,6 @@ // 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::{Image, Sampler, arch, spirv}; 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 fb5db92ded..63986bcc76 100644 --- a/tests/ui/image/query/query_samples.rs +++ b/tests/ui/image/query/query_samples.rs @@ -1,5 +1,5 @@ // 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::{Image, arch}; diff --git a/tests/ui/image/query/query_size.rs b/tests/ui/image/query/query_size.rs index ba2b12afa4..ea87bd25c9 100644 --- a/tests/ui/image/query/query_size.rs +++ b/tests/ui/image/query/query_size.rs @@ -1,5 +1,5 @@ // 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::{Image, arch}; diff --git a/tests/ui/image/query/query_size_err.rs b/tests/ui/image/query/query_size_err.rs index c526f3bd6b..5a453ae663 100644 --- a/tests/ui/image/query/query_size_err.rs +++ b/tests/ui/image/query/query_size_err.rs @@ -1,6 +1,6 @@ // 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::{Image, arch, spirv}; 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 dd6c7f1855..f226463e24 100644 --- a/tests/ui/image/query/query_size_lod.rs +++ b/tests/ui/image/query/query_size_lod.rs @@ -1,5 +1,5 @@ // 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::{Image, arch}; diff --git a/tests/ui/image/query/query_size_lod_err.rs b/tests/ui/image/query/query_size_lod_err.rs index 8b2e9e8ff1..ad21d0615d 100644 --- a/tests/ui/image/query/query_size_lod_err.rs +++ b/tests/ui/image/query/query_size_lod_err.rs @@ -1,6 +1,6 @@ // 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::{Image, arch, spirv}; 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 0c1fb23ba3..707c2eee4f 100644 --- a/tests/ui/image/read.rs +++ b/tests/ui/image/read.rs @@ -1,6 +1,6 @@ // 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::{Image, arch}; diff --git a/tests/ui/image/read_subpass.rs b/tests/ui/image/read_subpass.rs index 1dd84965d0..6b6e0da16e 100644 --- a/tests/ui/image/read_subpass.rs +++ b/tests/ui/image/read_subpass.rs @@ -1,5 +1,5 @@ // 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::{Image, arch}; diff --git a/tests/ui/image/sample.rs b/tests/ui/image/sample.rs index e480828900..78755c91c0 100644 --- a/tests/ui/image/sample.rs +++ b/tests/ui/image/sample.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleImplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler, arch}; diff --git a/tests/ui/image/sample_bias.rs b/tests/ui/image/sample_bias.rs index 4aace83047..cde326b2fe 100644 --- a/tests/ui/image/sample_bias.rs +++ b/tests/ui/image/sample_bias.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleImplicitLod` Bias // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler, arch}; diff --git a/tests/ui/image/sample_depth_reference/sample.rs b/tests/ui/image/sample_depth_reference/sample.rs index f0a379b254..c085cbe0c3 100644 --- a/tests/ui/image/sample_depth_reference/sample.rs +++ b/tests/ui/image/sample_depth_reference/sample.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleDrefImplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler, arch}; 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 b846e8b5f3..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,5 +1,6 @@ // Test `OpImageSampleProjDrefImplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler, arch}; 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 ca2930276e..64ec6a4d1e 100644 --- a/tests/ui/image/sample_gradient.rs +++ b/tests/ui/image/sample_gradient.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleExplicitLod` Grad // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler, arch}; diff --git a/tests/ui/image/sample_lod.rs b/tests/ui/image/sample_lod.rs index 7d4a628514..7f249544e9 100644 --- a/tests/ui/image/sample_lod.rs +++ b/tests/ui/image/sample_lod.rs @@ -1,5 +1,6 @@ // Test `OpImageSampleExplicitLod` Lod // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler, arch, image::SampledImage}; 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 73ce1eb6ee..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,5 +1,6 @@ // Test `OpImageSampleProjExplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler, arch}; 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 99361164d4..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,5 +1,6 @@ // Test `OpImageSampleProjExplicitLod` // build-pass +// compile-flags: -Ctarget-feature=+ShaderNonUniform,+ext:SPV_EXT_descriptor_indexing use spirv_std::spirv; use spirv_std::{Image, Sampler, arch}; diff --git a/tests/ui/image/write.rs b/tests/ui/image/write.rs index 34dfae1350..390055371d 100644 --- a/tests/ui/image/write.rs +++ b/tests/ui/image/write.rs @@ -1,6 +1,6 @@ // 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::{Image, arch}; 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};