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..4704f903a8 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,8 @@ 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_spirv_types::Capability; use rustc_codegen_ssa::traits::BuilderMethods; use rustc_errors::ErrorGuaranteed; use rustc_span::DUMMY_SP; @@ -41,11 +42,20 @@ 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); 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); + if self.builder.has_capability(Capability::ShaderNonUniform) { + // apply NonUniform to the operation and the index + self.emit() + .decorate(ptr.def(self), Decoration::NonUniform, []); + self.emit() + .decorate(actual_index, Decoration::NonUniform, []); + } self.load(u32_ty, ptr, Align::ONE) } @@ -233,11 +243,20 @@ 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); 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); + if self.builder.has_capability(Capability::ShaderNonUniform) { + // apply NonUniform to the operation and the index + self.emit() + .decorate(ptr.def(self), Decoration::NonUniform, []); + self.emit() + .decorate(actual_index, Decoration::NonUniform, []); + } self.store(value, ptr, Align::ONE); Ok(()) } diff --git a/crates/rustc_codegen_spirv/src/linker/mod.rs b/crates/rustc_codegen_spirv/src/linker/mod.rs index fa69dc8e7f..6b5d7919b1 100644 --- a/crates/rustc_codegen_spirv/src/linker/mod.rs +++ b/crates/rustc_codegen_spirv/src/linker/mod.rs @@ -472,6 +472,11 @@ pub fn link( duplicates::remove_duplicate_debuginfo(&mut output); } + { + let _timer = sess.timer("link_remove_non_uniform"); + simple_passes::remove_non_uniform_decorations(sess, &mut output)?; + } + // NOTE(eddyb) SPIR-T pipeline is entirely limited to this block. { let (spv_words, module_or_err, lower_from_spv_timer) = diff --git a/crates/rustc_codegen_spirv/src/linker/simple_passes.rs b/crates/rustc_codegen_spirv/src/linker/simple_passes.rs index d0e7854895..9dfeadad35 100644 --- a/crates/rustc_codegen_spirv/src/linker/simple_passes.rs +++ b/crates/rustc_codegen_spirv/src/linker/simple_passes.rs @@ -1,6 +1,7 @@ use super::{Result, get_name, get_names}; use rspirv::dr::{Block, Function, Module}; -use rspirv::spirv::{ExecutionModel, Op, Word}; +use rspirv::spirv::{Decoration, ExecutionModel, Op, Word}; +use rustc_codegen_spirv_types::Capability; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_session::Session; use std::iter::once; @@ -264,3 +265,19 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> Result<()> { } } } + +/// Remove all [`Decoration::NonUniform`] if this module does *not* have [`Capability::ShaderNonUniform`]. +/// This allows image asm to always declare `NonUniform` and not worry about conditional compilation. +pub fn remove_non_uniform_decorations(_sess: &Session, module: &mut Module) -> Result<()> { + let has_shader_non_uniform_capability = module.capabilities.iter().any(|inst| { + inst.class.opcode == Op::Capability + && inst.operands[0].unwrap_capability() == Capability::ShaderNonUniform + }); + if !has_shader_non_uniform_capability { + module.annotations.retain(|inst| { + !(inst.class.opcode == Op::Decorate + && inst.operands[1].unwrap_decoration() == Decoration::NonUniform) + }); + } + Ok(()) +} diff --git a/crates/spirv-std/src/image.rs b/crates/spirv-std/src/image.rs index e37fe641df..a9accf10bb 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 @@ -914,6 +987,10 @@ impl< let mut result = Default::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}", @@ -940,6 +1017,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 +1063,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 +1100,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 @@ -1079,6 +1163,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 +1190,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 +1326,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 +1358,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 +1393,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 +1429,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 +1465,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 +1500,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/crates/spirv-std/src/runtime_array.rs b/crates/spirv-std/src/runtime_array.rs index 5d5df01dfb..f94c166994 100644 --- a/crates/spirv-std/src/runtime_array.rs +++ b/crates/spirv-std/src/runtime_array.rs @@ -31,15 +31,18 @@ impl RuntimeArray { #[spirv_std_macros::gpu_only] pub unsafe fn index(&self, index: usize) -> &T { // FIXME(eddyb) `let mut result = T::default()` uses (for `asm!`), with this. - let mut result_slot = core::mem::MaybeUninit::uninit(); + let mut result = core::mem::MaybeUninit::uninit(); asm! { - "%result = OpAccessChain _ {arr} {index}", - "OpStore {result_slot} %result", - arr = in(reg) self, - index = in(reg) index, - result_slot = in(reg) result_slot.as_mut_ptr(), + "OpDecorate %index NonUniform", + "OpDecorate %result NonUniform", + "%index = OpLoad _ {index}", + "%result = OpAccessChain typeof*{result} {this} %index", + "OpStore {result} %result", + result = in(reg) result.as_mut_ptr(), + this = in(reg) self, + index = in(reg) &index, } - result_slot.assume_init() + result.assume_init() } /// Index the array, returning a mutable reference to an element. Unfortunately, because the @@ -52,14 +55,17 @@ impl RuntimeArray { #[spirv_std_macros::gpu_only] pub unsafe fn index_mut(&mut self, index: usize) -> &mut T { // FIXME(eddyb) `let mut result = T::default()` uses (for `asm!`), with this. - let mut result_slot = core::mem::MaybeUninit::uninit(); + let mut result = core::mem::MaybeUninit::uninit(); asm! { - "%result = OpAccessChain _ {arr} {index}", - "OpStore {result_slot} %result", - arr = in(reg) self, - index = in(reg) index, - result_slot = in(reg) result_slot.as_mut_ptr(), + "OpDecorate %index NonUniform", + "OpDecorate %result NonUniform", + "%index = OpLoad _ {index}", + "%result = OpAccessChain typeof*{result} {this} %index", + "OpStore {result} %result", + result = in(reg) result.as_mut_ptr(), + this = in(reg) self, + index = in(reg) &index, } - result_slot.assume_init() + result.assume_init() } } diff --git a/tests/compiletests/src/main.rs b/tests/compiletests/src/main.rs index c2947bd35d..ffb42b0577 100644 --- a/tests/compiletests/src/main.rs +++ b/tests/compiletests/src/main.rs @@ -14,7 +14,7 @@ struct Opt { bless: bool, /// The environment to compile to the SPIR-V tests. - #[arg(long, default_value = "spv1.3")] + #[arg(long, default_value = "vulkan1.2")] target_env: String, /// Only run tests that match these filters. diff --git a/tests/compiletests/ui/image/gather_err.stderr b/tests/compiletests/ui/image/gather_err.stderr index f3d2f4cfe0..550fdfd018 100644 --- a/tests/compiletests/ui/image/gather_err.stderr +++ b/tests/compiletests/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/compiletests/ui/image/query/query_levels_err.stderr b/tests/compiletests/ui/image/query/query_levels_err.stderr index 2f03a3f426..c49926bd05 100644 --- a/tests/compiletests/ui/image/query/query_levels_err.stderr +++ b/tests/compiletests/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/compiletests/ui/image/query/query_lod_err.stderr b/tests/compiletests/ui/image/query/query_lod_err.stderr index 0b6a9a052c..e985e690b5 100644 --- a/tests/compiletests/ui/image/query/query_lod_err.stderr +++ b/tests/compiletests/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/compiletests/ui/image/query/query_size_err.stderr b/tests/compiletests/ui/image/query/query_size_err.stderr index b35b9c1298..f2d3a7e03f 100644 --- a/tests/compiletests/ui/image/query/query_size_err.stderr +++ b/tests/compiletests/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:1015:15 + | +1013 | pub fn query_size + Default>(&self) -> Size + | ---------- required by a bound in this associated function +1014 | where +1015 | Self: HasQuerySize, + | ^^^^^^^^^^^^ required by this bound in `Image::::query_size` error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/image/query/query_size_lod_err.stderr b/tests/compiletests/ui/image/query/query_size_lod_err.stderr index 20464eb29a..32bdd433fc 100644 --- a/tests/compiletests/ui/image/query/query_size_lod_err.stderr +++ b/tests/compiletests/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:1061:15 + | +1056 | 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` +1061 | Self: HasQuerySizeLod, + | ^^^^^^^^^^^^^^^ required by this bound in `Image::::query_size_lod` error: aborting due to 1 previous error