From d7e144aafd33c2753c5e994a130cab0da80514d4 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Wed, 17 Sep 2025 12:27:56 +0200 Subject: [PATCH 1/6] asm vector: deny `OpTypeVector` in asm --- .../src/builder/spirv_asm.rs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs b/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs index 3c72bd6286..8441d74c08 100644 --- a/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs +++ b/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs @@ -367,14 +367,20 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> { SpirvType::Float(inst.operands[0].unwrap_literal_bit32()).def(self.span(), self) } Op::TypeStruct => { - self.err("OpTypeStruct in asm! is not supported yet"); + self.err("`OpTypeStruct` in asm! is not supported"); return; } - Op::TypeVector => SpirvType::Vector { - element: inst.operands[0].unwrap_id_ref(), - count: inst.operands[1].unwrap_literal_bit32(), + Op::TypeVector => { + self.struct_err( + "`OpTypeVector` in asm! is not supported, since `#[spirv(vector)]` structs can \ + create different vector types due to varying size and alignment", + ) + .with_note( + "pass `glam::VecN` as parameters and use `typeof{foo}` or `typeof*{foo}` (pointer to type) to resolve vector type", + ) + .emit(); + return; } - .def(self.span(), self), Op::TypeMatrix => SpirvType::Matrix { element: inst.operands[0].unwrap_id_ref(), count: inst.operands[1].unwrap_literal_bit32(), @@ -762,12 +768,6 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> { } .def(DUMMY_SP, cx), - TyPat::Vector4(pat) => SpirvType::Vector { - element: subst_ty_pat(cx, pat, ty_vars, leftover_operands)?, - count: 4, - } - .def(DUMMY_SP, cx), - TyPat::SampledImage(pat) => SpirvType::SampledImage { image_type: subst_ty_pat(cx, pat, ty_vars, leftover_operands)?, } From deedecc7a672ad3c4924362a44c8bc4682dc18a9 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Wed, 17 Sep 2025 12:31:15 +0200 Subject: [PATCH 2/6] asm vector: fix float packing --- crates/spirv-std/src/float.rs | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/crates/spirv-std/src/float.rs b/crates/spirv-std/src/float.rs index aaf85c5051..33e143f6b8 100644 --- a/crates/spirv-std/src/float.rs +++ b/crates/spirv-std/src/float.rs @@ -49,10 +49,8 @@ pub fn f16x2_to_vec2>(int: u32) -> V { unsafe { asm!( "%glsl = OpExtInstImport \"GLSL.std.450\"", - "%float = OpTypeFloat 32", - "%vec2 = OpTypeVector %float 2", // 62 = UnpackHalf2x16 - "%result = OpExtInst %vec2 %glsl 62 {int}", + "%result = OpExtInst typeof*{result} %glsl 62 {int}", "OpStore {result} %result", int = in(reg) int, result = in(reg) &mut result, @@ -164,10 +162,8 @@ pub fn u8x4_to_vec4_snorm>(int: u32) -> V { unsafe { asm!( "%glsl = OpExtInstImport \"GLSL.std.450\"", - "%float = OpTypeFloat 32", - "%vec4 = OpTypeVector %float 4", // 63 = UnpackSnorm4x8 - "%result = OpExtInst %vec4 %glsl 63 {int}", + "%result = OpExtInst typeof*{result} %glsl 63 {int}", "OpStore {result} %result", int = in(reg) int, result = in(reg) &mut result, @@ -185,10 +181,8 @@ pub fn u8x4_to_vec4_unorm>(int: u32) -> V { unsafe { asm!( "%glsl = OpExtInstImport \"GLSL.std.450\"", - "%float = OpTypeFloat 32", - "%vec4 = OpTypeVector %float 4", // 64 = UnpackUnorm4x8 - "%result = OpExtInst %vec4 %glsl 64 {int}", + "%result = OpExtInst typeof*{result} %glsl 64 {int}", "OpStore {result} %result", int = in(reg) int, result = in(reg) &mut result, @@ -206,10 +200,8 @@ pub fn u16x2_to_vec2_snorm>(int: u32) -> V { unsafe { asm!( "%glsl = OpExtInstImport \"GLSL.std.450\"", - "%float = OpTypeFloat 32", - "%vec2 = OpTypeVector %float 2", // 60 = UnpackSnorm2x16 - "%result = OpExtInst %vec2 %glsl 60 {int}", + "%result = OpExtInst typeof*{result} %glsl 60 {int}", "OpStore {result} %result", int = in(reg) int, result = in(reg) &mut result, @@ -227,10 +219,8 @@ pub fn u16x2_to_vec2_unorm>(int: u32) -> V { unsafe { asm!( "%glsl = OpExtInstImport \"GLSL.std.450\"", - "%float = OpTypeFloat 32", - "%vec2 = OpTypeVector %float 2", // 61 = UnpackUnorm2x16 - "%result = OpExtInst %vec2 %glsl 61 {int}", + "%result = OpExtInst typeof*{result} %glsl 61 {int}", "OpStore {result} %result", int = in(reg) int, result = in(reg) &mut result, From 268dd5166c0e391364afd143d57277e8c2f98bf6 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Wed, 17 Sep 2025 12:31:39 +0200 Subject: [PATCH 3/6] asm vector: adjust compiletest `lang/asm/const_args` --- tests/compiletests/ui/lang/asm/const_args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiletests/ui/lang/asm/const_args.rs b/tests/compiletests/ui/lang/asm/const_args.rs index 4a42533c31..b90640c673 100644 --- a/tests/compiletests/ui/lang/asm/const_args.rs +++ b/tests/compiletests/ui/lang/asm/const_args.rs @@ -9,7 +9,7 @@ fn asm() { const N: usize = 3; asm!( "%int = OpTypeInt 32 0", - "%type = OpTypeVector %int {len}", + "%value = OpConstant %int {len}", len = const N, ); } From 7e98c39a6a0b00b75144e267e5691fb5c080f373 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Wed, 17 Sep 2025 12:33:06 +0200 Subject: [PATCH 4/6] asm vector: fix `subgroup_ballot()` --- crates/spirv-std/src/arch/subgroup.rs | 3 +- .../ui/arch/subgroup/subgroup_ballot.stderr | 4 +-- .../subgroup/subgroup_ballot_bit_count.stderr | 2 +- .../subgroup_cluster_size_0_fail.stderr | 28 +++++++++---------- ..._cluster_size_non_power_of_two_fail.stderr | 28 +++++++++---------- .../subgroup/subgroup_i_add_clustered.stderr | 2 +- .../subgroup_i_add_exclusive_scan.stderr | 2 +- .../subgroup_i_add_inclusive_scan.stderr | 2 +- .../subgroup/subgroup_i_add_reduce.stderr | 2 +- 9 files changed, 36 insertions(+), 37 deletions(-) diff --git a/crates/spirv-std/src/arch/subgroup.rs b/crates/spirv-std/src/arch/subgroup.rs index f6acf93765..0d53c85191 100644 --- a/crates/spirv-std/src/arch/subgroup.rs +++ b/crates/spirv-std/src/arch/subgroup.rs @@ -372,10 +372,9 @@ pub fn subgroup_ballot(predicate: bool) -> SubgroupMask { unsafe { asm! { "%u32 = OpTypeInt 32 0", - "%groupmask = OpTypeVector %u32 4", "%subgroup = OpConstant %u32 {subgroup}", "%predicate = OpLoad _ {predicate}", - "%result = OpGroupNonUniformBallot %groupmask %subgroup %predicate", + "%result = OpGroupNonUniformBallot typeof*{result} %subgroup %predicate", "OpStore {result} %result", subgroup = const SUBGROUP, predicate = in(reg) &predicate, diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_ballot.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_ballot.stderr index 5fd6e0fde0..d5171d95e9 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_ballot.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_ballot.stderr @@ -1,9 +1,9 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel -OpLine %6 378 13 +OpLine %6 377 13 %7 = OpGroupNonUniformBallot %8 %9 %4 -OpLine %6 417 13 +OpLine %6 416 13 %10 = OpGroupNonUniformInverseBallot %2 %9 %7 OpNoLine OpReturnValue %10 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr index 49ff494bc1..0d224f07d0 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr @@ -1,7 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %5 %6 = OpLabel -OpLine %7 512 0 +OpLine %7 511 0 %8 = OpGroupNonUniformBallotBitCount %2 %9 Reduce %4 OpNoLine OpReturnValue %8 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr index 632c45702f..6d9aa75c7a 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr @@ -1,27 +1,27 @@ error[E0080]: evaluation panicked: `ClusterSize` must be at least 1 - --> $SPIRV_STD_SRC/arch/subgroup.rs:840:1 + --> $SPIRV_STD_SRC/arch/subgroup.rs:839:1 | -840 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" -841 | | An integer add group operation of all `value` operands contributed by active invocations in the group. -842 | | -843 | | Result Type must be a scalar or vector of integer type. +839 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" +840 | | An integer add group operation of all `value` operands contributed by active invocations in the group. +841 | | +842 | | Result Type must be a scalar or vector of integer type. ... | -856 | | * `ClusterSize` must not be greater than the size of the group -857 | | "); +855 | | * `ClusterSize` must not be greater than the size of the group +856 | | "); | |__^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<0, u32, u32>::{constant#0}` failed here | = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $SPIRV_STD_SRC/arch/subgroup.rs:840:1 + --> $SPIRV_STD_SRC/arch/subgroup.rs:839:1 | -840 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" -841 | | An integer add group operation of all `value` operands contributed by active invocations in the group. -842 | | -843 | | Result Type must be a scalar or vector of integer type. +839 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" +840 | | An integer add group operation of all `value` operands contributed by active invocations in the group. +841 | | +842 | | Result Type must be a scalar or vector of integer type. ... | -856 | | * `ClusterSize` must not be greater than the size of the group -857 | | "); +855 | | * `ClusterSize` must not be greater than the size of the group +856 | | "); | |__^ | = note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr index b6b1b35fb9..ed0fbbf35f 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr @@ -1,27 +1,27 @@ error[E0080]: evaluation panicked: `ClusterSize` must be a power of 2 - --> $SPIRV_STD_SRC/arch/subgroup.rs:840:1 + --> $SPIRV_STD_SRC/arch/subgroup.rs:839:1 | -840 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" -841 | | An integer add group operation of all `value` operands contributed by active invocations in the group. -842 | | -843 | | Result Type must be a scalar or vector of integer type. +839 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" +840 | | An integer add group operation of all `value` operands contributed by active invocations in the group. +841 | | +842 | | Result Type must be a scalar or vector of integer type. ... | -856 | | * `ClusterSize` must not be greater than the size of the group -857 | | "); +855 | | * `ClusterSize` must not be greater than the size of the group +856 | | "); | |__^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<5, u32, u32>::{constant#0}` failed here | = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $SPIRV_STD_SRC/arch/subgroup.rs:840:1 + --> $SPIRV_STD_SRC/arch/subgroup.rs:839:1 | -840 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" -841 | | An integer add group operation of all `value` operands contributed by active invocations in the group. -842 | | -843 | | Result Type must be a scalar or vector of integer type. +839 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" +840 | | An integer add group operation of all `value` operands contributed by active invocations in the group. +841 | | +842 | | Result Type must be a scalar or vector of integer type. ... | -856 | | * `ClusterSize` must not be greater than the size of the group -857 | | "); +855 | | * `ClusterSize` must not be greater than the size of the group +856 | | "); | |__^ | = note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.stderr index 710c976877..d1d520364d 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.stderr @@ -1,7 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel -OpLine %6 840 0 +OpLine %6 839 0 %7 = OpGroupNonUniformIAdd %2 %8 ClusteredReduce %4 %9 OpNoLine OpReturnValue %7 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.stderr index da708505b8..00a742fc98 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.stderr @@ -1,7 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel -OpLine %6 827 0 +OpLine %6 826 0 %7 = OpGroupNonUniformIAdd %2 %8 ExclusiveScan %4 OpNoLine OpReturnValue %7 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.stderr index 684d46dec0..694495fb73 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.stderr @@ -1,7 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel -OpLine %6 827 0 +OpLine %6 826 0 %7 = OpGroupNonUniformIAdd %2 %8 InclusiveScan %4 OpNoLine OpReturnValue %7 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.stderr index 9430d3452d..4776bf1903 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.stderr @@ -1,7 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel -OpLine %6 827 0 +OpLine %6 826 0 %7 = OpGroupNonUniformIAdd %2 %8 Reduce %4 OpNoLine OpReturnValue %7 From 976ae8bfb57b3c0825fe363ca3d86c10aaf1421b Mon Sep 17 00:00:00 2001 From: firestar99 Date: Wed, 17 Sep 2025 12:46:42 +0200 Subject: [PATCH 5/6] asm vector: adjust compiletest `dis/complex_image_sample_inst`, remove non-sense ConstOffset --- .../ui/dis/complex_image_sample_inst.rs | 20 +++---------------- .../ui/dis/complex_image_sample_inst.stderr | 18 ++++++++--------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/tests/compiletests/ui/dis/complex_image_sample_inst.rs b/tests/compiletests/ui/dis/complex_image_sample_inst.rs index f42cce8d0b..73b4dd2254 100644 --- a/tests/compiletests/ui/dis/complex_image_sample_inst.rs +++ b/tests/compiletests/ui/dis/complex_image_sample_inst.rs @@ -5,13 +5,7 @@ use core::arch::asm; use spirv_std::spirv; -fn sample_proj_lod( - coord: glam::Vec4, - ddx: glam::Vec2, - ddy: glam::Vec2, - offset_x: i32, - offset_y: i32, -) -> glam::Vec4 { +fn sample_proj_lod(coord: glam::Vec4, ddx: glam::Vec2, ddy: glam::Vec2) -> glam::Vec4 { unsafe { let mut result = glam::Vec4::default(); let index = 0u32; @@ -19,11 +13,8 @@ fn sample_proj_lod( "OpDecorate %image_2d_var DescriptorSet 0", "OpDecorate %image_2d_var Binding 0", "%uint = OpTypeInt 32 0", - "%int = OpTypeInt 32 1", "%float = OpTypeFloat 32", - "%v2int = OpTypeVector %int 2", "%uint_0 = OpConstant %uint 0", - "%int_0 = OpConstant %int 0", "%image_2d = OpTypeImage %float Dim2D 0 0 0 1 Unknown", "%sampled_image_2d = OpTypeSampledImage %image_2d", "%image_array = OpTypeRuntimeArray %sampled_image_2d", @@ -40,23 +31,18 @@ fn sample_proj_lod( "%coord = OpLoad _ {0}", "%ddx = OpLoad _ {3}", "%ddy = OpLoad _ {4}", - "%offset_x = OpLoad _ {5}", - "%offset_y = OpLoad _ {6}", - "%const_offset = OpConstantComposite %v2int %int_0 %int_0", - "%result = OpImageSampleProjExplicitLod _ %25 %coord Grad|ConstOffset %ddx %ddy %const_offset", + "%result = OpImageSampleProjExplicitLod typeof*{2} %25 %coord Grad %ddx %ddy", "OpStore {2} %result", in(reg) &coord, in(reg) &index, in(reg) &mut result, in(reg) &ddx, in(reg) &ddy, - in(reg) &offset_x, - in(reg) &offset_y, ); result } } #[spirv(fragment)] pub fn main() { - sample_proj_lod(glam::Vec4::ZERO, glam::Vec2::ZERO, glam::Vec2::ZERO, 0, 0); + sample_proj_lod(glam::Vec4::ZERO, glam::Vec2::ZERO, glam::Vec2::ZERO); } diff --git a/tests/compiletests/ui/dis/complex_image_sample_inst.stderr b/tests/compiletests/ui/dis/complex_image_sample_inst.stderr index 32bf06149d..cde98c1dec 100644 --- a/tests/compiletests/ui/dis/complex_image_sample_inst.stderr +++ b/tests/compiletests/ui/dis/complex_image_sample_inst.stderr @@ -2,15 +2,13 @@ %4 = OpFunctionParameter %2 %5 = OpFunctionParameter %6 %7 = OpFunctionParameter %6 -%8 = OpFunctionParameter %9 -%10 = OpFunctionParameter %9 -%11 = OpLabel -OpLine %12 38 13 -%13 = OpAccessChain %14 %15 %16 -OpLine %12 39 13 -%17 = OpLoad %18 %13 -OpLine %12 46 13 -%19 = OpImageSampleProjExplicitLod %2 %17 %4 Grad|ConstOffset %5 %7 %20 +%8 = OpLabel +OpLine %9 29 13 +%10 = OpAccessChain %11 %12 %13 +OpLine %9 30 13 +%14 = OpLoad %15 %10 +OpLine %9 34 13 +%16 = OpImageSampleProjExplicitLod %2 %14 %4 Grad %5 %7 OpNoLine -OpReturnValue %19 +OpReturnValue %16 OpFunctionEnd From 6aa48ff12104bef0d07d64c43ef199394bdac466 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Wed, 17 Sep 2025 12:54:48 +0200 Subject: [PATCH 6/6] asm vector: fix image sample ops --- crates/spirv-std/src/image.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/spirv-std/src/image.rs b/crates/spirv-std/src/image.rs index d07710cef0..8d4eef8b63 100644 --- a/crates/spirv-std/src/image.rs +++ b/crates/spirv-std/src/image.rs @@ -334,7 +334,7 @@ impl< "%coordinate = OpLoad _ {coordinate}", "%lod = OpLoad _ {lod}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleExplicitLod _ %sampledImage %coordinate Lod %lod", + "%result = OpImageSampleExplicitLod typeof*{result} %sampledImage %coordinate Lod %lod", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -372,7 +372,7 @@ impl< "%gradient_dx = OpLoad _ {gradient_dx}", "%gradient_dy = OpLoad _ {gradient_dy}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleExplicitLod _ %sampledImage %coordinate Grad %gradient_dx %gradient_dy", + "%result = OpImageSampleExplicitLod typeof*{result} %sampledImage %coordinate Grad %gradient_dx %gradient_dy", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -409,7 +409,7 @@ impl< "%coordinate = OpLoad _ {coordinate}", "%depth_reference = OpLoad _ {depth_reference}", // not required to do this way, but done for consistency "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleDrefImplicitLod _ %sampledImage %coordinate %depth_reference", + "%result = OpImageSampleDrefImplicitLod typeof*{result} %sampledImage %coordinate %depth_reference", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -447,7 +447,7 @@ impl< "%depth_reference = OpLoad _ {depth_reference}", "%lod = OpLoad _ {lod}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleDrefExplicitLod _ %sampledImage %coordinate %depth_reference Lod %lod", + "%result = OpImageSampleDrefExplicitLod typeof*{result} %sampledImage %coordinate %depth_reference Lod %lod", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -489,7 +489,7 @@ impl< "%gradient_dx = OpLoad _ {gradient_dx}", "%gradient_dy = OpLoad _ {gradient_dy}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleDrefExplicitLod _ %sampledImage %coordinate %depth_reference Grad %gradient_dx %gradient_dy", + "%result = OpImageSampleDrefExplicitLod typeof*{result} %sampledImage %coordinate %depth_reference Grad %gradient_dx %gradient_dy", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -545,7 +545,7 @@ impl< "%sampler = OpLoad _ {sampler}", "%project_coordinate = OpLoad _ {project_coordinate}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleProjImplicitLod _ %sampledImage %project_coordinate", + "%result = OpImageSampleProjImplicitLod typeof*{result} %sampledImage %project_coordinate", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -580,7 +580,7 @@ impl< "%project_coordinate = OpLoad _ {project_coordinate}", "%lod = OpLoad _ {lod}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleProjExplicitLod _ %sampledImage %project_coordinate Lod %lod", + "%result = OpImageSampleProjExplicitLod typeof*{result} %sampledImage %project_coordinate Lod %lod", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -618,7 +618,7 @@ impl< "%gradient_dx = OpLoad _ {gradient_dx}", "%gradient_dy = OpLoad _ {gradient_dy}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleProjExplicitLod _ %sampledImage %project_coordinate Grad %gradient_dx %gradient_dy", + "%result = OpImageSampleProjExplicitLod typeof*{result} %sampledImage %project_coordinate Grad %gradient_dx %gradient_dy", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -655,7 +655,7 @@ impl< "%project_coordinate = OpLoad _ {project_coordinate}", "%depth_reference = OpLoad _ {depth_reference}", // not required to do this way, but done for consistency "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleProjDrefImplicitLod _ %sampledImage %project_coordinate %depth_reference", + "%result = OpImageSampleProjDrefImplicitLod typeof*{result} %sampledImage %project_coordinate %depth_reference", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -693,7 +693,7 @@ impl< "%depth_reference = OpLoad _ {depth_reference}", "%lod = OpLoad _ {lod}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleProjDrefExplicitLod _ %sampledImage %coordinate %depth_reference Lod %lod", + "%result = OpImageSampleProjDrefExplicitLod typeof*{result} %sampledImage %coordinate %depth_reference Lod %lod", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -735,7 +735,7 @@ impl< "%gradient_dx = OpLoad _ {gradient_dx}", "%gradient_dy = OpLoad _ {gradient_dy}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleProjDrefExplicitLod _ %sampledImage %coordinate %depth_reference Grad %gradient_dx %gradient_dy", + "%result = OpImageSampleProjDrefExplicitLod typeof*{result} %sampledImage %coordinate %depth_reference Grad %gradient_dx %gradient_dy", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -1542,7 +1542,7 @@ impl< "%coordinate = OpLoad _ {coordinate}", "%depth_reference = OpLoad _ {depth_reference}", // not required to do this way, but done for consistency "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleDref$LOD _ %sampledImage %coordinate %depth_reference $PARAMS", + "%result = OpImageSampleDref$LOD typeof*{result} %sampledImage %coordinate %depth_reference $PARAMS", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -1577,7 +1577,7 @@ impl< "%sampler = OpLoad _ {sampler}", "%project_coordinate = OpLoad _ {project_coordinate}", "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleProj$LOD _ %sampledImage %project_coordinate $PARAMS", + "%result = OpImageSampleProj$LOD typeof*{result} %sampledImage %project_coordinate $PARAMS", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self, @@ -1613,7 +1613,7 @@ impl< "%project_coordinate = OpLoad _ {project_coordinate}", "%depth_reference = OpLoad _ {depth_reference}", // not required to do this way, but done for consistency "%sampledImage = OpSampledImage _ %image %sampler", - "%result = OpImageSampleProjDref$LOD _ %sampledImage %project_coordinate %depth_reference $PARAMS", + "%result = OpImageSampleProjDref$LOD typeof*{result} %sampledImage %project_coordinate %depth_reference $PARAMS", "OpStore {result} %result", result = in(reg) &mut result, this = in(reg) self,