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 59814a03d1..77af83b5c6 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}",
@@ -1326,6 +1414,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",
@@ -1356,6 +1446,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}",
@@ -1387,6 +1481,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}",
@@ -1419,6 +1517,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}",
@@ -1451,6 +1553,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}",
@@ -1482,6 +1588,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<T> RuntimeArray<T> {
     #[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<T> RuntimeArray<T> {
     #[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<f32, 0, 2, 0, 0, 1, 0, 4>: HasGather` is no
               Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
               Image<SampledType, 4, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
 note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
-   --> $SPIRV_STD_SRC/image.rs:197:15
+   --> $SPIRV_STD_SRC/image.rs:199:15
     |
-190 |     pub fn gather<F>(
+192 |     pub fn gather<F>(
     |            ------ required by a bound in this associated function
 ...
-197 |         Self: HasGather,
+199 |         Self: HasGather,
     |               ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
 
 error[E0277]: the trait bound `Image<f32, 2, 2, 0, 0, 1, 0, 4>: HasGather` is not satisfied
@@ -28,12 +28,12 @@ error[E0277]: the trait bound `Image<f32, 2, 2, 0, 0, 1, 0, 4>: HasGather` is no
               Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
               Image<SampledType, 4, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
 note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
-   --> $SPIRV_STD_SRC/image.rs:197:15
+   --> $SPIRV_STD_SRC/image.rs:199:15
     |
-190 |     pub fn gather<F>(
+192 |     pub fn gather<F>(
     |            ------ required by a bound in this associated function
 ...
-197 |         Self: HasGather,
+199 |         Self: HasGather,
     |               ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::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<f32, 4, 2, 0, 0, 1, 0, 4>: HasQueryLevels`
               Image<SampledType, 2, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
               Image<SampledType, 3, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
 note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::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::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::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<f32, 4, 2, 0, 0, 1, 0, 4>: HasQueryLevels`
               Image<SampledType, 2, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
               Image<SampledType, 3, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
 note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::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::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::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 4c3dca3c39..c94971162e 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<f32, 1, 2, 0, 0, 1, 0, 4>: HasQuerySize` is not satisfied
-   --> $DIR/query_size_err.rs:12:21
-    |
-12  |     *output = image.query_size();
-    |                     ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image<f32, 1, 2, 0, 0, 1, 0, 4>`
-    |
-    = help: the following other types implement trait `HasQuerySize`:
-              Image<SampledType, 0, DEPTH, ARRAYED, 0, 0, FORMAT, COMPONENTS>
-              Image<SampledType, 0, DEPTH, ARRAYED, 0, 2, FORMAT, COMPONENTS>
-              Image<SampledType, 0, DEPTH, ARRAYED, 1, SAMPLED, FORMAT, COMPONENTS>
-              Image<SampledType, 1, DEPTH, ARRAYED, 0, 0, FORMAT, COMPONENTS>
-              Image<SampledType, 1, DEPTH, ARRAYED, 0, 2, FORMAT, COMPONENTS>
-              Image<SampledType, 1, DEPTH, ARRAYED, 1, SAMPLED, FORMAT, COMPONENTS>
-              Image<SampledType, 2, DEPTH, ARRAYED, 0, 0, FORMAT, COMPONENTS>
-              Image<SampledType, 2, DEPTH, ARRAYED, 0, 2, FORMAT, COMPONENTS>
-            and 6 others
+    --> $DIR/query_size_err.rs:12:21
+     |
+12   |     *output = image.query_size();
+     |                     ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image<f32, 1, 2, 0, 0, 1, 0, 4>`
+     |
+     = help: the following other types implement trait `HasQuerySize`:
+               Image<SampledType, 0, DEPTH, ARRAYED, 0, 0, FORMAT, COMPONENTS>
+               Image<SampledType, 0, DEPTH, ARRAYED, 0, 2, FORMAT, COMPONENTS>
+               Image<SampledType, 0, DEPTH, ARRAYED, 1, SAMPLED, FORMAT, COMPONENTS>
+               Image<SampledType, 1, DEPTH, ARRAYED, 0, 0, FORMAT, COMPONENTS>
+               Image<SampledType, 1, DEPTH, ARRAYED, 0, 2, FORMAT, COMPONENTS>
+               Image<SampledType, 1, DEPTH, ARRAYED, 1, SAMPLED, FORMAT, COMPONENTS>
+               Image<SampledType, 2, DEPTH, ARRAYED, 0, 0, FORMAT, COMPONENTS>
+               Image<SampledType, 2, DEPTH, ARRAYED, 0, 2, FORMAT, COMPONENTS>
+             and 6 others
 note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_size`
-   --> $SPIRV_STD_SRC/image.rs:938:15
-    |
-936 |     pub fn query_size<Size: ImageSizeQuery<u32, DIM, ARRAYED> + Default>(&self) -> Size
-    |            ---------- required by a bound in this associated function
-937 |     where
-938 |         Self: HasQuerySize,
-    |               ^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_size`
+    --> $SPIRV_STD_SRC/image.rs:1015:15
+     |
+1013 |     pub fn query_size<Size: ImageSizeQuery<u32, DIM, ARRAYED> + Default>(&self) -> Size
+     |            ---------- required by a bound in this associated function
+1014 |     where
+1015 |         Self: HasQuerySize,
+     |               ^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::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 1b097f3f9c..bbad070b0a 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<f32, 4, 2, 0, 0, 1, 0, 4>: 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<f32, 4, 2, 0, 0, 1, 0, 4>`
-    |
-    = help: the following other types implement trait `HasQuerySizeLod`:
-              Image<SampledType, 0, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
-              Image<SampledType, 1, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
-              Image<SampledType, 2, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
-              Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
+    --> $DIR/query_size_lod_err.rs:12:21
+     |
+12   |     *output = image.query_size_lod(0);
+     |                     ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image<f32, 4, 2, 0, 0, 1, 0, 4>`
+     |
+     = help: the following other types implement trait `HasQuerySizeLod`:
+               Image<SampledType, 0, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
+               Image<SampledType, 1, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
+               Image<SampledType, 2, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
+               Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
 note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#7}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::query_size_lod`
-   --> $SPIRV_STD_SRC/image.rs:982:15
-    |
-977 |     pub fn query_size_lod<Size: ImageSizeQuery<u32, DIM, ARRAYED> + Default>(
-    |            -------------- required by a bound in this associated function
+    --> $SPIRV_STD_SRC/image.rs:1061:15
+     |
+1056 |     pub fn query_size_lod<Size: ImageSizeQuery<u32, DIM, ARRAYED> + Default>(
+     |            -------------- required by a bound in this associated function
 ...
-982 |         Self: HasQuerySizeLod,
-    |               ^^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#7}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::query_size_lod`
+1061 |         Self: HasQuerySizeLod,
+     |               ^^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#7}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::query_size_lod`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr b/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr
index e4000bd415..9403b250ee 100644
--- a/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr
+++ b/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr
@@ -10,12 +10,12 @@ error[E0277]: the trait bound `Image<f32, 4, 2, 0, 0, 1, 0, 4>: HasQuerySizeLod`
                Image<SampledType, 2, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
                Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
 note: required by a bound in `SampledImage::<Image<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#9}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>>::query_size_lod`
-    --> /image.rs:1138:12
+    --> /image.rs:1226:12
      |
-1124 |     pub fn query_size_lod<Size: ImageSizeQuery<u32, DIM, ARRAYED> + Default>(
+1212 |     pub fn query_size_lod<Size: ImageSizeQuery<u32, DIM, ARRAYED> + Default>(
      |            -------------- required by a bound in this associated function
 ...
-1138 |         >: HasQuerySizeLod,
+1226 |         >: HasQuerySizeLod,
      |            ^^^^^^^^^^^^^^^ required by this bound in `SampledImage::<Image<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#9}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>>::query_size_lod`
 
 error: aborting due to 1 previous error