diff --git a/src/front/spv/mod.rs b/src/front/spv/mod.rs index c69a230cb0..a301ac1413 100644 --- a/src/front/spv/mod.rs +++ b/src/front/spv/mod.rs @@ -1324,14 +1324,17 @@ impl> Frontend { Op::NoLine => inst.expect(1)?, Op::Undef => { inst.expect(3)?; - let (type_id, id, handle) = - self.parse_null_constant(inst, ctx.type_arena, ctx.const_arena)?; + let type_id = self.next()?; + let id = self.next()?; + let type_lookup = self.lookup_type.lookup(type_id)?; + let ty = type_lookup.handle; + self.lookup_expression.insert( id, LookupExpression { handle: ctx .expressions - .append(crate::Expression::Constant(handle), span), + .append(crate::Expression::ZeroValue(ty), span), type_id, block_id, }, diff --git a/src/front/wgsl/lower/construction.rs b/src/front/wgsl/lower/construction.rs index 723d4441f5..0c2f29bd98 100644 --- a/src/front/wgsl/lower/construction.rs +++ b/src/front/wgsl/lower/construction.rs @@ -199,12 +199,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { _ => return Err(Error::TypeNotInferrable(ty_span)), }; - return match ctx.create_zero_value_constant(ty) { - Some(constant) => { - Ok(ctx.interrupt_emitter(crate::Expression::Constant(constant), span)) - } - None => Err(Error::TypeNotConstructible(ty_span)), - }; + return Ok(ctx.interrupt_emitter(crate::Expression::ZeroValue(ty), span)); } // Scalar constructor & conversion (scalar -> scalar) diff --git a/src/front/wgsl/lower/mod.rs b/src/front/wgsl/lower/mod.rs index bc9cce1bee..f6c27caa82 100644 --- a/src/front/wgsl/lower/mod.rs +++ b/src/front/wgsl/lower/mod.rs @@ -342,83 +342,6 @@ impl<'a> ExpressionContext<'a, '_, '_> { } } - /// Creates a zero value constant of type `ty` - /// - /// Returns `None` if the given `ty` is not a constructible type - fn create_zero_value_constant( - &mut self, - ty: Handle, - ) -> Option> { - let inner = match self.module.types[ty].inner { - crate::TypeInner::Scalar { kind, width } => { - let value = match kind { - crate::ScalarKind::Sint => crate::ScalarValue::Sint(0), - crate::ScalarKind::Uint => crate::ScalarValue::Uint(0), - crate::ScalarKind::Float => crate::ScalarValue::Float(0.), - crate::ScalarKind::Bool => crate::ScalarValue::Bool(false), - }; - crate::ConstantInner::Scalar { width, value } - } - crate::TypeInner::Vector { size, kind, width } => { - let scalar_ty = self.ensure_type_exists(crate::TypeInner::Scalar { width, kind }); - let component = self.create_zero_value_constant(scalar_ty)?; - crate::ConstantInner::Composite { - ty, - components: (0..size as u8).map(|_| component).collect(), - } - } - crate::TypeInner::Matrix { - columns, - rows, - width, - } => { - let vec_ty = self.ensure_type_exists(crate::TypeInner::Vector { - width, - kind: crate::ScalarKind::Float, - size: rows, - }); - let component = self.create_zero_value_constant(vec_ty)?; - crate::ConstantInner::Composite { - ty, - components: (0..columns as u8).map(|_| component).collect(), - } - } - crate::TypeInner::Array { - base, - size: crate::ArraySize::Constant(size), - .. - } => { - let size = self.module.constants[size].to_array_length()?; - let component = self.create_zero_value_constant(base)?; - crate::ConstantInner::Composite { - ty, - components: (0..size).map(|_| component).collect(), - } - } - crate::TypeInner::Struct { ref members, .. } => { - let members = members.clone(); - crate::ConstantInner::Composite { - ty, - components: members - .iter() - .map(|member| self.create_zero_value_constant(member.ty)) - .collect::>()?, - } - } - _ => return None, - }; - - let constant = self.module.constants.fetch_or_append( - crate::Constant { - name: None, - specialization: None, - inner, - }, - Span::UNDEFINED, - ); - Some(constant) - } - fn format_typeinner(&self, inner: &crate::TypeInner) -> String { inner.to_wgsl(&self.module.types, &self.module.constants) } diff --git a/src/proc/mod.rs b/src/proc/mod.rs index a775272a19..c4c6d4f4e7 100644 --- a/src/proc/mod.rs +++ b/src/proc/mod.rs @@ -312,6 +312,7 @@ impl crate::Expression { pub const fn needs_pre_emit(&self) -> bool { match *self { Self::Constant(_) + | Self::ZeroValue(_) | Self::FunctionArgument(_) | Self::GlobalVariable(_) | Self::LocalVariable(_) => true, diff --git a/tests/out/glsl/access.foo_frag.Fragment.glsl b/tests/out/glsl/access.foo_frag.Fragment.glsl index c71617572b..3d52fa56b0 100644 --- a/tests/out/glsl/access.foo_frag.Fragment.glsl +++ b/tests/out/glsl/access.foo_frag.Fragment.glsl @@ -54,7 +54,7 @@ void main() { _group_0_binding_0_fs._matrix = mat4x3(vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0)); _group_0_binding_0_fs.arr = uvec2[2](uvec2(0u), uvec2(1u)); _group_0_binding_0_fs.data[1].value = 1; - _group_0_binding_2_fs = ivec2(0, 0); + _group_0_binding_2_fs = ivec2(0); _fs2p_location0 = vec4(0.0); return; } diff --git a/tests/out/glsl/access.foo_vert.Vertex.glsl b/tests/out/glsl/access.foo_vert.Vertex.glsl index 03e33ccb81..f3754247bd 100644 --- a/tests/out/glsl/access.foo_vert.Vertex.glsl +++ b/tests/out/glsl/access.foo_vert.Vertex.glsl @@ -88,10 +88,10 @@ void test_matrix_within_array_within_struct_accesses() { int _e58 = idx_1; int _e60 = idx_1; float unnamed_14 = _group_0_binding_3_vs.am[0][_e58][_e60]; - t_1 = MatCx2InArray(mat4x2[2](mat4x2(vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0)), mat4x2(vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0)))); + t_1 = MatCx2InArray(mat4x2[2](mat4x2(0.0), mat4x2(0.0))); int _e66 = idx_1; idx_1 = (_e66 + 1); - t_1.am = mat4x2[2](mat4x2(vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0)), mat4x2(vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0))); + t_1.am = mat4x2[2](mat4x2(0.0), mat4x2(0.0)); t_1.am[0] = mat4x2(vec2(8.0), vec2(7.0), vec2(6.0), vec2(5.0)); t_1.am[0][0] = vec2(9.0); int _e93 = idx_1; diff --git a/tests/out/glsl/bounds-check-image-restrict.fragment_shader.Fragment.glsl b/tests/out/glsl/bounds-check-image-restrict.fragment_shader.Fragment.glsl index ba7854322f..cf5a2806f6 100644 --- a/tests/out/glsl/bounds-check-image-restrict.fragment_shader.Fragment.glsl +++ b/tests/out/glsl/bounds-check-image-restrict.fragment_shader.Fragment.glsl @@ -83,16 +83,16 @@ void test_textureStore_3d(ivec3 coords_14, vec4 value_4) { void main() { vec4 _e2 = test_textureLoad_1d(0, 0); - vec4 _e5 = test_textureLoad_2d(ivec2(0, 0), 0); - vec4 _e9 = test_textureLoad_2d_array_u(ivec2(0, 0), 0u, 0); - vec4 _e13 = test_textureLoad_2d_array_s(ivec2(0, 0), 0, 0); - vec4 _e16 = test_textureLoad_3d(ivec3(0, 0, 0), 0); - vec4 _e19 = test_textureLoad_multisampled_2d(ivec2(0, 0), 0); - test_textureStore_1d(0, vec4(0.0, 0.0, 0.0, 0.0)); - test_textureStore_2d(ivec2(0, 0), vec4(0.0, 0.0, 0.0, 0.0)); - test_textureStore_2d_array_u(ivec2(0, 0), 0u, vec4(0.0, 0.0, 0.0, 0.0)); - test_textureStore_2d_array_s(ivec2(0, 0), 0, vec4(0.0, 0.0, 0.0, 0.0)); - test_textureStore_3d(ivec3(0, 0, 0), vec4(0.0, 0.0, 0.0, 0.0)); + vec4 _e5 = test_textureLoad_2d(ivec2(0), 0); + vec4 _e9 = test_textureLoad_2d_array_u(ivec2(0), 0u, 0); + vec4 _e13 = test_textureLoad_2d_array_s(ivec2(0), 0, 0); + vec4 _e16 = test_textureLoad_3d(ivec3(0), 0); + vec4 _e19 = test_textureLoad_multisampled_2d(ivec2(0), 0); + test_textureStore_1d(0, vec4(0.0)); + test_textureStore_2d(ivec2(0), vec4(0.0)); + test_textureStore_2d_array_u(ivec2(0), 0u, vec4(0.0)); + test_textureStore_2d_array_s(ivec2(0), 0, vec4(0.0)); + test_textureStore_3d(ivec3(0), vec4(0.0)); _fs2p_location0 = vec4(0.0, 0.0, 0.0, 0.0); return; } diff --git a/tests/out/glsl/bounds-check-image-rzsw.fragment_shader.Fragment.glsl b/tests/out/glsl/bounds-check-image-rzsw.fragment_shader.Fragment.glsl index 7d8aba65c6..4a6718e397 100644 --- a/tests/out/glsl/bounds-check-image-rzsw.fragment_shader.Fragment.glsl +++ b/tests/out/glsl/bounds-check-image-rzsw.fragment_shader.Fragment.glsl @@ -77,16 +77,16 @@ void test_textureStore_3d(ivec3 coords_14, vec4 value_4) { void main() { vec4 _e2 = test_textureLoad_1d(0, 0); - vec4 _e5 = test_textureLoad_2d(ivec2(0, 0), 0); - vec4 _e9 = test_textureLoad_2d_array_u(ivec2(0, 0), 0u, 0); - vec4 _e13 = test_textureLoad_2d_array_s(ivec2(0, 0), 0, 0); - vec4 _e16 = test_textureLoad_3d(ivec3(0, 0, 0), 0); - vec4 _e19 = test_textureLoad_multisampled_2d(ivec2(0, 0), 0); - test_textureStore_1d(0, vec4(0.0, 0.0, 0.0, 0.0)); - test_textureStore_2d(ivec2(0, 0), vec4(0.0, 0.0, 0.0, 0.0)); - test_textureStore_2d_array_u(ivec2(0, 0), 0u, vec4(0.0, 0.0, 0.0, 0.0)); - test_textureStore_2d_array_s(ivec2(0, 0), 0, vec4(0.0, 0.0, 0.0, 0.0)); - test_textureStore_3d(ivec3(0, 0, 0), vec4(0.0, 0.0, 0.0, 0.0)); + vec4 _e5 = test_textureLoad_2d(ivec2(0), 0); + vec4 _e9 = test_textureLoad_2d_array_u(ivec2(0), 0u, 0); + vec4 _e13 = test_textureLoad_2d_array_s(ivec2(0), 0, 0); + vec4 _e16 = test_textureLoad_3d(ivec3(0), 0); + vec4 _e19 = test_textureLoad_multisampled_2d(ivec2(0), 0); + test_textureStore_1d(0, vec4(0.0)); + test_textureStore_2d(ivec2(0), vec4(0.0)); + test_textureStore_2d_array_u(ivec2(0), 0u, vec4(0.0)); + test_textureStore_2d_array_s(ivec2(0), 0, vec4(0.0)); + test_textureStore_3d(ivec3(0), vec4(0.0)); _fs2p_location0 = vec4(0.0, 0.0, 0.0, 0.0); return; } diff --git a/tests/out/glsl/globals.main.Compute.glsl b/tests/out/glsl/globals.main.Compute.glsl index f72bde3dea..cb695ac1d6 100644 --- a/tests/out/glsl/globals.main.Compute.glsl +++ b/tests/out/glsl/globals.main.Compute.glsl @@ -44,8 +44,8 @@ void test_msl_packed_vec3_() { vec3 unnamed = data.v3_; vec2 unnamed_1 = data.v3_.zx; test_msl_packed_vec3_as_arg(data.v3_); - vec3 unnamed_2 = (data.v3_ * mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - vec3 unnamed_3 = (mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) * data.v3_); + vec3 unnamed_2 = (data.v3_ * mat3x3(0.0)); + vec3 unnamed_3 = (mat3x3(0.0) * data.v3_); vec3 unnamed_4 = (data.v3_ * 2.0); vec3 unnamed_5 = (2.0 * data.v3_); } diff --git a/tests/out/glsl/math-functions.main.Fragment.glsl b/tests/out/glsl/math-functions.main.Fragment.glsl index 11c3be1886..70ad0b199a 100644 --- a/tests/out/glsl/math-functions.main.Fragment.glsl +++ b/tests/out/glsl/math-functions.main.Fragment.glsl @@ -12,7 +12,7 @@ void main() { vec4 d = radians(v); vec4 e = clamp(v, vec4(0.0), vec4(1.0)); vec4 g = refract(v, v, 1.0); - int const_dot = ( + ivec2(0, 0).x * ivec2(0, 0).x + ivec2(0, 0).y * ivec2(0, 0).y); + int const_dot = ( + ivec2(0).x * ivec2(0).x + ivec2(0).y * ivec2(0).y); uint first_leading_bit_abs = uint(findMSB(uint(abs(int(0u))))); int flb_a = findMSB(-1); ivec2 flb_b = findMSB(ivec2(-1)); diff --git a/tests/out/glsl/operators.main.Compute.glsl b/tests/out/glsl/operators.main.Compute.glsl index 3857923393..a76465d95e 100644 --- a/tests/out/glsl/operators.main.Compute.glsl +++ b/tests/out/glsl/operators.main.Compute.glsl @@ -58,10 +58,10 @@ float constructors() { int unnamed_4 = int(0); uint unnamed_5 = uint(0u); float unnamed_6 = float(0.0); - uvec2 unnamed_7 = uvec2(uvec2(0u, 0u)); - mat2x3 unnamed_8 = mat2x3(mat2x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - uvec2 unnamed_9 = uvec2(0u, 0u); - mat2x3 unnamed_10 = mat2x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)); + uvec2 unnamed_7 = uvec2(uvec2(0u)); + mat2x3 unnamed_8 = mat2x3(mat2x3(0.0)); + uvec2 unnamed_9 = uvec2(0u); + mat2x3 unnamed_10 = mat2x3(0.0); float _e71 = foo.a.x; return _e71; } @@ -140,13 +140,13 @@ void arithmetic() { uvec2 unnamed_78 = (uvec2(2u) % uvec2(1u)); vec2 unnamed_79 = (vec2(2.0) - vec2(1.0) * trunc(vec2(2.0) / vec2(1.0))); vec2 unnamed_80 = (vec2(2.0) - vec2(1.0) * trunc(vec2(2.0) / vec2(1.0))); - mat3x3 unnamed_81 = (mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) + mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - mat3x3 unnamed_82 = (mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) - mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - mat3x3 unnamed_83 = (mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) * 1.0); - mat3x3 unnamed_84 = (2.0 * mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - vec3 unnamed_85 = (mat4x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) * vec4(1.0)); - vec4 unnamed_86 = (vec3(2.0) * mat4x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - mat3x3 unnamed_87 = (mat4x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) * mat3x4(vec4(0.0, 0.0, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0))); + mat3x3 unnamed_81 = (mat3x3(0.0) + mat3x3(0.0)); + mat3x3 unnamed_82 = (mat3x3(0.0) - mat3x3(0.0)); + mat3x3 unnamed_83 = (mat3x3(0.0) * 1.0); + mat3x3 unnamed_84 = (2.0 * mat3x3(0.0)); + vec3 unnamed_85 = (mat4x3(0.0) * vec4(1.0)); + vec4 unnamed_86 = (vec3(2.0) * mat4x3(0.0)); + mat3x3 unnamed_87 = (mat4x3(0.0) * mat3x4(0.0)); } void bit() { @@ -245,7 +245,7 @@ void assignment() { a_1 = (_e32 + 1); int _e35 = a_1; a_1 = (_e35 - 1); - vec0_ = ivec3(0, 0, 0); + vec0_ = ivec3(0); int _e42 = vec0_.y; vec0_.y = (_e42 + 1); int _e47 = vec0_.y; diff --git a/tests/out/hlsl/access.hlsl b/tests/out/hlsl/access.hlsl index 27786717d4..63814754ed 100644 --- a/tests/out/hlsl/access.hlsl +++ b/tests/out/hlsl/access.hlsl @@ -77,24 +77,6 @@ GlobalConst ConstructGlobalConst(uint arg0, uint3 arg1, int arg2) { return ret; } -typedef float4x2 ret_Constructarray2_float4x2_[2]; -ret_Constructarray2_float4x2_ Constructarray2_float4x2_(float4x2 arg0, float4x2 arg1) { - float4x2 ret[2] = { arg0, arg1 }; - return ret; -} - -typedef float ret_Constructarray10_float_[10]; -ret_Constructarray10_float_ Constructarray10_float_(float arg0, float arg1, float arg2, float arg3, float arg4, float arg5, float arg6, float arg7, float arg8, float arg9) { - float ret[10] = { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 }; - return ret; -} - -typedef float ret_Constructarray5_array10_float__[5][10]; -ret_Constructarray5_array10_float__ Constructarray5_array10_float__(float arg0[10], float arg1[10], float arg2[10], float arg3[10], float arg4[10]) { - float ret[5][10] = { arg0, arg1, arg2, arg3, arg4 }; - return ret; -} - static GlobalConst global_const = ConstructGlobalConst(0u, uint3(0u, 0u, 0u), 0); RWByteAddressBuffer bar : register(u0); cbuffer baz : register(b1) { Baz baz; } @@ -201,10 +183,10 @@ void test_matrix_within_array_within_struct_accesses() int _expr58 = idx_1; int _expr60 = idx_1; float unnamed_14 = __get_col_of_mat4x2(nested_mat_cx2_.am[0], _expr58)[_expr60]; - t_1 = ConstructMatCx2InArray(Constructarray2_float4x2_(float4x2(float2(0.0, 0.0), float2(0.0, 0.0), float2(0.0, 0.0), float2(0.0, 0.0)), float4x2(float2(0.0, 0.0), float2(0.0, 0.0), float2(0.0, 0.0), float2(0.0, 0.0)))); + t_1 = ConstructMatCx2InArray((float4x2[2])0); int _expr66 = idx_1; idx_1 = (_expr66 + 1); - t_1.am = (__mat4x2[2])Constructarray2_float4x2_(float4x2(float2(0.0, 0.0), float2(0.0, 0.0), float2(0.0, 0.0), float2(0.0, 0.0)), float4x2(float2(0.0, 0.0), float2(0.0, 0.0), float2(0.0, 0.0), float2(0.0, 0.0))); + t_1.am = (__mat4x2[2])(float4x2[2])0; t_1.am[0] = (__mat4x2)float4x2((8.0).xx, (7.0).xx, (6.0).xx, (5.0).xx); t_1.am[0]._0 = (9.0).xx; int _expr93 = idx_1; @@ -287,7 +269,7 @@ float4 foo_vert(uint vi : SV_VertexID) : SV_Position c2_ = Constructarray5_int_(a_1, int(b), 3, 4, 5); c2_[(vi + 1u)] = 42; int value = c2_[vi]; - const float _e48 = test_arr_as_arg(Constructarray5_array10_float__(Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), Constructarray10_float_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); + const float _e48 = test_arr_as_arg((float[5][10])0); return float4(mul(float4((value).xxxx), _matrix), 2.0); } @@ -307,7 +289,7 @@ float4 foo_frag() : SV_Target0 bar.Store2(144+8, asuint(_value2[1])); } bar.Store(0+8+160, asuint(1)); - qux.Store2(0, asuint(int2(0, 0))); + qux.Store2(0, asuint((int2)0)); return (0.0).xxxx; } diff --git a/tests/out/hlsl/globals.hlsl b/tests/out/hlsl/globals.hlsl index 273889fdbc..9d7eb2e99d 100644 --- a/tests/out/hlsl/globals.hlsl +++ b/tests/out/hlsl/globals.hlsl @@ -92,8 +92,8 @@ void test_msl_packed_vec3_() float3 unnamed = data.v3_; float2 unnamed_1 = data.v3_.zx; test_msl_packed_vec3_as_arg(data.v3_); - float3 unnamed_2 = mul(float3x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0)), data.v3_); - float3 unnamed_3 = mul(data.v3_, float3x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0))); + float3 unnamed_2 = mul((float3x3)0, data.v3_); + float3 unnamed_3 = mul(data.v3_, (float3x3)0); float3 unnamed_4 = (data.v3_ * 2.0); float3 unnamed_5 = (2.0 * data.v3_); } diff --git a/tests/out/hlsl/math-functions.hlsl b/tests/out/hlsl/math-functions.hlsl index 04a9843cb5..e3443604f1 100644 --- a/tests/out/hlsl/math-functions.hlsl +++ b/tests/out/hlsl/math-functions.hlsl @@ -8,7 +8,7 @@ void main() float4 d = radians(v); float4 e = saturate(v); float4 g = refract(v, v, 1.0); - int const_dot = dot(int2(0, 0), int2(0, 0)); + int const_dot = dot((int2)0, (int2)0); uint first_leading_bit_abs = firstbithigh(abs(0u)); int flb_a = asint(firstbithigh(-1)); int2 flb_b = asint(firstbithigh((-1).xx)); diff --git a/tests/out/hlsl/operators.hlsl b/tests/out/hlsl/operators.hlsl index 3136972d49..73d7211c35 100644 --- a/tests/out/hlsl/operators.hlsl +++ b/tests/out/hlsl/operators.hlsl @@ -11,19 +11,6 @@ struct Foo { int _end_pad_2; }; -Foo ConstructFoo(float4 arg0, int arg1) { - Foo ret = (Foo)0; - ret.a = arg0; - ret.b = arg1; - return ret; -} - -typedef Foo ret_Constructarray3_Foo_[3]; -ret_Constructarray3_Foo_ Constructarray3_Foo_(Foo arg0, Foo arg1, Foo arg2) { - Foo ret[3] = { arg0, arg1, arg2 }; - return ret; -} - float4 builtins() { int s1_ = (true ? 1 : 0); @@ -65,6 +52,13 @@ float3 bool_cast(float3 x) return float3(y); } +Foo ConstructFoo(float4 arg0, int arg1) { + Foo ret = (Foo)0; + ret.a = arg0; + ret.b = arg1; + return ret; +} + typedef int ret_Constructarray4_int_[4]; ret_Constructarray4_int_ Constructarray4_int_(int arg0, int arg1, int arg2, int arg3) { int ret[4] = { arg0, arg1, arg2, arg3 }; @@ -81,14 +75,14 @@ float constructors() uint2 unnamed = (0u).xx; float2x2 unnamed_1 = float2x2((0.0).xx, (0.0).xx); int unnamed_2[4] = Constructarray4_int_(0, 1, 2, 3); - bool unnamed_3 = bool(false); - int unnamed_4 = int(0); - uint unnamed_5 = uint(0u); - float unnamed_6 = float(0.0); - uint2 unnamed_7 = uint2(uint2(0u, 0u)); - float2x3 unnamed_8 = float2x3(float2x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0))); - uint2 unnamed_9 = asuint(uint2(0u, 0u)); - float2x3 unnamed_10 = asfloat(float2x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0))); + bool unnamed_3 = bool((bool)0); + int unnamed_4 = int((int)0); + uint unnamed_5 = uint((uint)0); + float unnamed_6 = float((float)0); + uint2 unnamed_7 = uint2((uint2)0); + float2x3 unnamed_8 = float2x3((float2x3)0); + uint2 unnamed_9 = asuint((uint2)0); + float2x3 unnamed_10 = asfloat((float2x3)0); float _expr71 = foo.a.x; return _expr71; } @@ -169,13 +163,13 @@ void arithmetic() uint2 unnamed_78 = ((2u).xx % (1u).xx); float2 unnamed_79 = fmod((2.0).xx, (1.0).xx); float2 unnamed_80 = fmod((2.0).xx, (1.0).xx); - float3x3 unnamed_81 = (float3x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0)) + float3x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0))); - float3x3 unnamed_82 = (float3x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0)) - float3x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0))); - float3x3 unnamed_83 = mul(1.0, float3x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0))); - float3x3 unnamed_84 = mul(float3x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0)), 2.0); - float3 unnamed_85 = mul((1.0).xxxx, float4x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0))); - float4 unnamed_86 = mul(float4x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0)), (2.0).xxx); - float3x3 unnamed_87 = mul(float3x4(float4(0.0, 0.0, 0.0, 0.0), float4(0.0, 0.0, 0.0, 0.0), float4(0.0, 0.0, 0.0, 0.0)), float4x3(float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0))); + float3x3 unnamed_81 = ((float3x3)0 + (float3x3)0); + float3x3 unnamed_82 = ((float3x3)0 - (float3x3)0); + float3x3 unnamed_83 = mul(1.0, (float3x3)0); + float3x3 unnamed_84 = mul((float3x3)0, 2.0); + float3 unnamed_85 = mul((1.0).xxxx, (float4x3)0); + float4 unnamed_86 = mul((float4x3)0, (2.0).xxx); + float3x3 unnamed_87 = mul((float3x4)0, (float4x3)0); } void bit() @@ -278,7 +272,7 @@ void assignment() a_1 = (_expr32 + 1); int _expr35 = a_1; a_1 = (_expr35 - 1); - vec0_ = int3(0, 0, 0); + vec0_ = (int3)0; int _expr42 = vec0_.y; vec0_.y = (_expr42 + 1); int _expr47 = vec0_.y; diff --git a/tests/out/ir/access.ron b/tests/out/ir/access.ron index 0c1f9df1cb..8b18746019 100644 --- a/tests/out/ir/access.ron +++ b/tests/out/ir/access.ron @@ -263,7 +263,7 @@ name: None, inner: Array( base: 24, - size: Constant(26), + size: Constant(22), stride: 40, ), ), @@ -290,7 +290,7 @@ name: None, inner: Array( base: 3, - size: Constant(26), + size: Constant(22), stride: 4, ), ), @@ -503,42 +503,7 @@ specialization: None, inner: Scalar( width: 4, - value: Float(0.0), - ), - ), - ( - name: None, - specialization: None, - inner: Composite( - ty: 18, - components: [ - 20, - 20, - ], - ), - ), - ( - name: None, - specialization: None, - inner: Composite( - ty: 19, - components: [ - 21, - 21, - 21, - 21, - ], - ), - ), - ( - name: None, - specialization: None, - inner: Composite( - ty: 20, - components: [ - 22, - 22, - ], + value: Float(8.0), ), ), ( @@ -546,7 +511,7 @@ specialization: None, inner: Scalar( width: 4, - value: Float(8.0), + value: Float(7.0), ), ), ( @@ -554,7 +519,7 @@ specialization: None, inner: Scalar( width: 4, - value: Float(7.0), + value: Sint(5), ), ), ( @@ -562,7 +527,7 @@ specialization: None, inner: Scalar( width: 4, - value: Sint(5), + value: Sint(4), ), ), ( @@ -570,7 +535,7 @@ specialization: None, inner: Scalar( width: 4, - value: Sint(4), + value: Sint(9), ), ), ( @@ -578,7 +543,7 @@ specialization: None, inner: Scalar( width: 4, - value: Sint(9), + value: Float(0.0), ), ), ( @@ -621,50 +586,6 @@ value: Sint(42), ), ), - ( - name: None, - specialization: None, - inner: Composite( - ty: 24, - components: [ - 20, - 20, - 20, - 20, - 20, - 20, - 20, - 20, - 20, - 20, - ], - ), - ), - ( - name: None, - specialization: None, - inner: Composite( - ty: 25, - components: [ - 34, - 34, - 34, - 34, - 34, - ], - ), - ), - ( - name: None, - specialization: None, - inner: Composite( - ty: 17, - components: [ - 3, - 3, - ], - ), - ), ( name: None, specialization: None, @@ -1430,7 +1351,7 @@ Load( pointer: 62, ), - Constant(23), + ZeroValue(20), Compose( ty: 21, components: [ @@ -1451,7 +1372,7 @@ base: 66, index: 0, ), - Constant(23), + ZeroValue(20), AccessIndex( base: 66, index: 0, @@ -1461,12 +1382,12 @@ base: 72, index: 0, ), - Constant(24), + Constant(20), Splat( size: Bi, value: 75, ), - Constant(25), + Constant(21), Splat( size: Bi, value: 77, @@ -1927,12 +1848,12 @@ local_variables: [], expressions: [ FunctionArgument(0), - Constant(27), + Constant(23), AccessIndex( base: 1, index: 4, ), - Constant(28), + Constant(24), AccessIndex( base: 3, index: 9, @@ -1968,7 +1889,7 @@ local_variables: [], expressions: [ FunctionArgument(0), - Constant(37), + Constant(31), ], named_expressions: { 1: "p", @@ -2071,7 +1992,7 @@ ], expressions: [ FunctionArgument(0), - Constant(20), + Constant(25), LocalVariable(1), Load( pointer: 3, @@ -2093,7 +2014,7 @@ Load( pointer: 10, ), - Constant(29), + Constant(26), GlobalVariable(2), AccessIndex( base: 13, @@ -2121,7 +2042,7 @@ index: 5, ), ArrayLength(21), - Constant(30), + Constant(27), Binary( op: Subtract, left: 22, @@ -2162,9 +2083,9 @@ kind: Sint, convert: Some(4), ), - Constant(31), - Constant(27), - Constant(26), + Constant(28), + Constant(23), + Constant(22), Compose( ty: 28, components: [ @@ -2176,7 +2097,7 @@ ], ), LocalVariable(2), - Constant(32), + Constant(29), Binary( op: Add, left: 1, @@ -2186,7 +2107,7 @@ base: 41, index: 43, ), - Constant(33), + Constant(30), Access( base: 41, index: 1, @@ -2194,7 +2115,7 @@ Load( pointer: 46, ), - Constant(35), + ZeroValue(25), CallResult(4), Splat( size: Quad, @@ -2381,7 +2302,7 @@ base: 7, index: 0, ), - Constant(20), + Constant(25), Splat( size: Tri, value: 9, @@ -2420,7 +2341,7 @@ size: Bi, value: 20, ), - Constant(32), + Constant(29), Splat( size: Bi, value: 22, @@ -2448,8 +2369,8 @@ ), Constant(7), GlobalVariable(4), - Constant(36), - Constant(20), + ZeroValue(17), + Constant(25), Splat( size: Quad, value: 33, @@ -2557,7 +2478,7 @@ size: Quad, value: 1, ), - Constant(25), + Constant(21), Splat( size: Quad, value: 3, diff --git a/tests/out/msl/access.msl b/tests/out/msl/access.msl index 4e51de80aa..2e9dc72f0e 100644 --- a/tests/out/msl/access.msl +++ b/tests/out/msl/access.msl @@ -59,12 +59,6 @@ struct type_26 { }; constant metal::uint3 const_type_1_ = {0u, 0u, 0u}; constant GlobalConst const_GlobalConst = {0u, {}, const_type_1_, 0}; -constant metal::float2 const_type_13_ = {0.0, 0.0}; -constant metal::float4x2 const_type_14_ = {const_type_13_, const_type_13_, const_type_13_, const_type_13_}; -constant type_15 const_type_15_ = {const_type_14_, const_type_14_}; -constant type_18 const_type_18_ = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; -constant type_19 const_type_19_ = {const_type_18_, const_type_18_, const_type_18_, const_type_18_, const_type_18_}; -constant metal::int2 const_type_12_ = {0, 0}; void test_matrix_within_struct_accesses( constant Baz& baz @@ -125,10 +119,10 @@ void test_matrix_within_array_within_struct_accesses( int _e58 = idx_1; int _e60 = idx_1; float unnamed_14 = nested_mat_cx2_.am.inner[0][_e58][_e60]; - t_1 = MatCx2InArray {const_type_15_}; + t_1 = MatCx2InArray {type_15 {}}; int _e66 = idx_1; idx_1 = _e66 + 1; - t_1.am = const_type_15_; + t_1.am = type_15 {}; t_1.am.inner[0] = metal::float4x2(metal::float2(8.0), metal::float2(7.0), metal::float2(6.0), metal::float2(5.0)); t_1.am.inner[0][0] = metal::float2(9.0); int _e93 = idx_1; @@ -200,7 +194,7 @@ vertex foo_vertOutput foo_vert( c2_ = type_22 {a_1, static_cast(b), 3, 4, 5}; c2_.inner[vi + 1u] = 42; int value = c2_.inner[vi]; - float _e48 = test_arr_as_arg(const_type_19_); + float _e48 = test_arr_as_arg(type_19 {}); return foo_vertOutput { metal::float4(_matrix * static_cast(metal::int4(value)), 2.0) }; } @@ -217,7 +211,7 @@ fragment foo_fragOutput foo_frag( bar._matrix = metal::float4x3(metal::float3(0.0), metal::float3(1.0), metal::float3(2.0), metal::float3(3.0)); bar.arr = type_9 {metal::uint2(0u), metal::uint2(1u)}; bar.data[1].value = 1; - qux = const_type_12_; + qux = metal::int2 {}; return foo_fragOutput { metal::float4(0.0) }; } diff --git a/tests/out/msl/bounds-check-image-restrict.msl b/tests/out/msl/bounds-check-image-restrict.msl index f52fc844e0..9f94ef0a6e 100644 --- a/tests/out/msl/bounds-check-image-restrict.msl +++ b/tests/out/msl/bounds-check-image-restrict.msl @@ -4,9 +4,6 @@ using metal::uint; -constant metal::int2 const_type_4_ = {0, 0}; -constant metal::int3 const_type_8_ = {0, 0, 0}; -constant metal::float4 const_type_2_ = {0.0, 0.0, 0.0, 0.0}; metal::float4 test_textureLoad_1d( int coords, @@ -171,15 +168,15 @@ fragment fragment_shaderOutput fragment_shader( , metal::texture3d image_storage_3d [[user(fake0)]] ) { metal::float4 _e2 = test_textureLoad_1d(0, 0, image_1d); - metal::float4 _e5 = test_textureLoad_2d(const_type_4_, 0, image_2d); - metal::float4 _e9 = test_textureLoad_2d_array_u(const_type_4_, 0u, 0, image_2d_array); - metal::float4 _e13 = test_textureLoad_2d_array_s(const_type_4_, 0, 0, image_2d_array); - metal::float4 _e16 = test_textureLoad_3d(const_type_8_, 0, image_3d); - metal::float4 _e19 = test_textureLoad_multisampled_2d(const_type_4_, 0, image_multisampled_2d); - test_textureStore_1d(0, const_type_2_, image_storage_1d); - test_textureStore_2d(const_type_4_, const_type_2_, image_storage_2d); - test_textureStore_2d_array_u(const_type_4_, 0u, const_type_2_, image_storage_2d_array); - test_textureStore_2d_array_s(const_type_4_, 0, const_type_2_, image_storage_2d_array); - test_textureStore_3d(const_type_8_, const_type_2_, image_storage_3d); + metal::float4 _e5 = test_textureLoad_2d(metal::int2 {}, 0, image_2d); + metal::float4 _e9 = test_textureLoad_2d_array_u(metal::int2 {}, 0u, 0, image_2d_array); + metal::float4 _e13 = test_textureLoad_2d_array_s(metal::int2 {}, 0, 0, image_2d_array); + metal::float4 _e16 = test_textureLoad_3d(metal::int3 {}, 0, image_3d); + metal::float4 _e19 = test_textureLoad_multisampled_2d(metal::int2 {}, 0, image_multisampled_2d); + test_textureStore_1d(0, metal::float4 {}, image_storage_1d); + test_textureStore_2d(metal::int2 {}, metal::float4 {}, image_storage_2d); + test_textureStore_2d_array_u(metal::int2 {}, 0u, metal::float4 {}, image_storage_2d_array); + test_textureStore_2d_array_s(metal::int2 {}, 0, metal::float4 {}, image_storage_2d_array); + test_textureStore_3d(metal::int3 {}, metal::float4 {}, image_storage_3d); return fragment_shaderOutput { metal::float4(0.0, 0.0, 0.0, 0.0) }; } diff --git a/tests/out/msl/bounds-check-image-rzsw.msl b/tests/out/msl/bounds-check-image-rzsw.msl index db631d7135..a93014cb27 100644 --- a/tests/out/msl/bounds-check-image-rzsw.msl +++ b/tests/out/msl/bounds-check-image-rzsw.msl @@ -10,9 +10,6 @@ struct DefaultConstructible { } }; -constant metal::int2 const_type_4_ = {0, 0}; -constant metal::int3 const_type_8_ = {0, 0, 0}; -constant metal::float4 const_type_2_ = {0.0, 0.0, 0.0, 0.0}; metal::float4 test_textureLoad_1d( int coords, @@ -180,15 +177,15 @@ fragment fragment_shaderOutput fragment_shader( , metal::texture3d image_storage_3d [[user(fake0)]] ) { metal::float4 _e2 = test_textureLoad_1d(0, 0, image_1d); - metal::float4 _e5 = test_textureLoad_2d(const_type_4_, 0, image_2d); - metal::float4 _e9 = test_textureLoad_2d_array_u(const_type_4_, 0u, 0, image_2d_array); - metal::float4 _e13 = test_textureLoad_2d_array_s(const_type_4_, 0, 0, image_2d_array); - metal::float4 _e16 = test_textureLoad_3d(const_type_8_, 0, image_3d); - metal::float4 _e19 = test_textureLoad_multisampled_2d(const_type_4_, 0, image_multisampled_2d); - test_textureStore_1d(0, const_type_2_, image_storage_1d); - test_textureStore_2d(const_type_4_, const_type_2_, image_storage_2d); - test_textureStore_2d_array_u(const_type_4_, 0u, const_type_2_, image_storage_2d_array); - test_textureStore_2d_array_s(const_type_4_, 0, const_type_2_, image_storage_2d_array); - test_textureStore_3d(const_type_8_, const_type_2_, image_storage_3d); + metal::float4 _e5 = test_textureLoad_2d(metal::int2 {}, 0, image_2d); + metal::float4 _e9 = test_textureLoad_2d_array_u(metal::int2 {}, 0u, 0, image_2d_array); + metal::float4 _e13 = test_textureLoad_2d_array_s(metal::int2 {}, 0, 0, image_2d_array); + metal::float4 _e16 = test_textureLoad_3d(metal::int3 {}, 0, image_3d); + metal::float4 _e19 = test_textureLoad_multisampled_2d(metal::int2 {}, 0, image_multisampled_2d); + test_textureStore_1d(0, metal::float4 {}, image_storage_1d); + test_textureStore_2d(metal::int2 {}, metal::float4 {}, image_storage_2d); + test_textureStore_2d_array_u(metal::int2 {}, 0u, metal::float4 {}, image_storage_2d_array); + test_textureStore_2d_array_s(metal::int2 {}, 0, metal::float4 {}, image_storage_2d_array); + test_textureStore_3d(metal::int3 {}, metal::float4 {}, image_storage_3d); return fragment_shaderOutput { metal::float4(0.0, 0.0, 0.0, 0.0) }; } diff --git a/tests/out/msl/globals.msl b/tests/out/msl/globals.msl index b57d094923..b2f4af0fcd 100644 --- a/tests/out/msl/globals.msl +++ b/tests/out/msl/globals.msl @@ -32,8 +32,6 @@ struct type_14 { struct type_15 { type_14 inner[2]; }; -constant metal::float3 const_type_4_ = {0.0, 0.0, 0.0}; -constant metal::float3x3 const_type_17_ = {const_type_4_, const_type_4_, const_type_4_}; void test_msl_packed_vec3_as_arg( metal::float3 arg @@ -55,8 +53,8 @@ void test_msl_packed_vec3_( metal::float3 unnamed = data.v3_; metal::float2 unnamed_1 = metal::float3(data.v3_).zx; test_msl_packed_vec3_as_arg(data.v3_); - metal::float3 unnamed_2 = metal::float3(data.v3_) * const_type_17_; - metal::float3 unnamed_3 = const_type_17_ * metal::float3(data.v3_); + metal::float3 unnamed_2 = metal::float3(data.v3_) * metal::float3x3 {}; + metal::float3 unnamed_3 = metal::float3x3 {} * metal::float3(data.v3_); metal::float3 unnamed_4 = data.v3_ * 2.0; metal::float3 unnamed_5 = 2.0 * data.v3_; } diff --git a/tests/out/msl/math-functions.msl b/tests/out/msl/math-functions.msl index 04eb9d85f8..120d526d44 100644 --- a/tests/out/msl/math-functions.msl +++ b/tests/out/msl/math-functions.msl @@ -4,7 +4,6 @@ using metal::uint; -constant metal::int2 const_type_1_ = {0, 0}; fragment void main_( ) { @@ -15,7 +14,7 @@ fragment void main_( metal::float4 d = ((v) * 0.017453292519943295474); metal::float4 e = metal::saturate(v); metal::float4 g = metal::refract(v, v, 1.0); - int const_dot = ( + const_type_1_.x * const_type_1_.x + const_type_1_.y * const_type_1_.y); + int const_dot = ( + metal::int2 {}.x * metal::int2 {}.x + metal::int2 {}.y * metal::int2 {}.y); uint _e13 = metal::abs(0u); uint first_leading_bit_abs = metal::select(31 - metal::clz(_e13), uint(-1), _e13 == 0 || _e13 == -1); int flb_a = metal::select(31 - metal::clz(metal::select(-1, ~-1, -1 < 0)), int(-1), -1 == 0 || -1 == -1); diff --git a/tests/out/msl/operators.msl b/tests/out/msl/operators.msl index 549ed49efe..e8ae513cba 100644 --- a/tests/out/msl/operators.msl +++ b/tests/out/msl/operators.msl @@ -18,18 +18,6 @@ constant metal::float4 v_f32_one = {1.0, 1.0, 1.0, 1.0}; constant metal::float4 v_f32_zero = {0.0, 0.0, 0.0, 0.0}; constant metal::float4 v_f32_half = {0.5, 0.5, 0.5, 0.5}; constant metal::int4 v_i32_one = {1, 1, 1, 1}; -constant metal::uint2 const_type_12_ = {0u, 0u}; -constant metal::float2 const_type_4_ = {0.0, 0.0}; -constant metal::float2x2 const_type_8_ = {const_type_4_, const_type_4_}; -constant metal::float4 const_type = {0.0, 0.0, 0.0, 0.0}; -constant Foo const_Foo = {const_type, 0}; -constant type_13 const_type_13_ = {const_Foo, const_Foo, const_Foo}; -constant metal::float3 const_type_5_ = {0.0, 0.0, 0.0}; -constant metal::float2x3 const_type_15_ = {const_type_5_, const_type_5_}; -constant metal::float3x3 const_type_16_ = {const_type_5_, const_type_5_, const_type_5_}; -constant metal::float4x3 const_type_17_ = {const_type_5_, const_type_5_, const_type_5_, const_type_5_}; -constant metal::float3x4 const_type_18_ = {const_type, const_type, const_type}; -constant metal::int3 const_type_19_ = {0, 0, 0}; metal::float4 builtins( ) { @@ -81,14 +69,14 @@ float constructors( metal::uint2 unnamed = metal::uint2(0u); metal::float2x2 unnamed_1 = metal::float2x2(metal::float2(0.0), metal::float2(0.0)); type_14 unnamed_2 = type_14 {0, 1, 2, 3}; - bool unnamed_3 = static_cast(false); - int unnamed_4 = static_cast(0); - uint unnamed_5 = static_cast(0u); - float unnamed_6 = static_cast(0.0); - metal::uint2 unnamed_7 = static_cast(const_type_12_); - metal::float2x3 unnamed_8 = metal::float2x3(const_type_15_); - metal::uint2 unnamed_9 = as_type(const_type_12_); - metal::float2x3 unnamed_10 = metal::float2x3(const_type_15_); + bool unnamed_3 = static_cast(bool {}); + int unnamed_4 = static_cast(int {}); + uint unnamed_5 = static_cast(uint {}); + float unnamed_6 = static_cast(float {}); + metal::uint2 unnamed_7 = static_cast(metal::uint2 {}); + metal::float2x3 unnamed_8 = metal::float2x3(metal::float2x3 {}); + metal::uint2 unnamed_9 = as_type(metal::uint2 {}); + metal::float2x3 unnamed_10 = metal::float2x3(metal::float2x3 {}); float _e71 = foo.a.x; return _e71; } @@ -169,13 +157,13 @@ void arithmetic( metal::uint2 unnamed_78 = metal::uint2(2u) % metal::uint2(1u); metal::float2 unnamed_79 = metal::fmod(metal::float2(2.0), metal::float2(1.0)); metal::float2 unnamed_80 = metal::fmod(metal::float2(2.0), metal::float2(1.0)); - metal::float3x3 unnamed_81 = const_type_16_ + const_type_16_; - metal::float3x3 unnamed_82 = const_type_16_ - const_type_16_; - metal::float3x3 unnamed_83 = const_type_16_ * 1.0; - metal::float3x3 unnamed_84 = 2.0 * const_type_16_; - metal::float3 unnamed_85 = const_type_17_ * metal::float4(1.0); - metal::float4 unnamed_86 = metal::float3(2.0) * const_type_17_; - metal::float3x3 unnamed_87 = const_type_17_ * const_type_18_; + metal::float3x3 unnamed_81 = metal::float3x3 {} + metal::float3x3 {}; + metal::float3x3 unnamed_82 = metal::float3x3 {} - metal::float3x3 {}; + metal::float3x3 unnamed_83 = metal::float3x3 {} * 1.0; + metal::float3x3 unnamed_84 = 2.0 * metal::float3x3 {}; + metal::float3 unnamed_85 = metal::float4x3 {} * metal::float4(1.0); + metal::float4 unnamed_86 = metal::float3(2.0) * metal::float4x3 {}; + metal::float3x3 unnamed_87 = metal::float4x3 {} * metal::float3x4 {}; } void bit( @@ -277,7 +265,7 @@ void assignment( a_1 = _e32 + 1; int _e35 = a_1; a_1 = _e35 - 1; - vec0_ = const_type_19_; + vec0_ = metal::int3 {}; int _e42 = vec0_.y; vec0_.y = _e42 + 1; int _e47 = vec0_.y; diff --git a/tests/out/spv/access.spvasm b/tests/out/spv/access.spvasm index fa828b4d88..18de89ac18 100644 --- a/tests/out/spv/access.spvasm +++ b/tests/out/spv/access.spvasm @@ -1,16 +1,16 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 328 +; Bound: 326 OpCapability Shader OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %247 "foo_vert" %242 %245 -OpEntryPoint Fragment %289 "foo_frag" %288 -OpEntryPoint GLCompute %308 "assign_through_ptr" %311 -OpExecutionMode %289 OriginUpperLeft -OpExecutionMode %308 LocalSize 1 1 1 +OpEntryPoint Vertex %243 "foo_vert" %238 %241 +OpEntryPoint Fragment %286 "foo_frag" %285 +OpEntryPoint GLCompute %306 "assign_through_ptr" %309 +OpExecutionMode %286 OriginUpperLeft +OpExecutionMode %306 LocalSize 1 1 1 OpSource GLSL 450 OpMemberName %36 0 "a" OpMemberName %36 1 "b" @@ -29,33 +29,33 @@ OpMemberName %49 0 "m" OpName %49 "Baz" OpMemberName %53 0 "am" OpName %53 "MatCx2InArray" -OpName %72 "global_const" -OpName %74 "bar" -OpName %76 "baz" -OpName %79 "qux" -OpName %82 "nested_mat_cx2" -OpName %85 "val" -OpName %86 "idx" -OpName %89 "t" -OpName %93 "test_matrix_within_struct_accesses" -OpName %150 "idx" -OpName %152 "t" -OpName %156 "test_matrix_within_array_within_struct_accesses" -OpName %211 "foo" -OpName %212 "read_from_private" -OpName %217 "a" -OpName %218 "test_arr_as_arg" -OpName %224 "p" -OpName %225 "assign_through_ptr_fn" -OpName %229 "foo" -OpName %230 "assign_array_through_ptr_fn" -OpName %236 "foo" -OpName %238 "c2" -OpName %242 "vi" -OpName %247 "foo_vert" -OpName %289 "foo_frag" -OpName %305 "arr" -OpName %308 "assign_through_ptr" +OpName %66 "global_const" +OpName %68 "bar" +OpName %70 "baz" +OpName %73 "qux" +OpName %76 "nested_mat_cx2" +OpName %79 "val" +OpName %80 "idx" +OpName %83 "t" +OpName %87 "test_matrix_within_struct_accesses" +OpName %144 "idx" +OpName %146 "t" +OpName %150 "test_matrix_within_array_within_struct_accesses" +OpName %207 "foo" +OpName %208 "read_from_private" +OpName %213 "a" +OpName %214 "test_arr_as_arg" +OpName %220 "p" +OpName %221 "assign_through_ptr_fn" +OpName %225 "foo" +OpName %226 "assign_array_through_ptr_fn" +OpName %232 "foo" +OpName %234 "c2" +OpName %238 "vi" +OpName %243 "foo_vert" +OpName %286 "foo_frag" +OpName %303 "arr" +OpName %306 "assign_through_ptr" OpMemberDecorate %36 0 Offset 0 OpMemberDecorate %36 1 Offset 16 OpMemberDecorate %36 2 Offset 28 @@ -85,25 +85,25 @@ OpDecorate %55 ArrayStride 4 OpDecorate %56 ArrayStride 40 OpDecorate %59 ArrayStride 4 OpDecorate %62 ArrayStride 16 -OpDecorate %74 DescriptorSet 0 -OpDecorate %74 Binding 0 +OpDecorate %68 DescriptorSet 0 +OpDecorate %68 Binding 0 OpDecorate %47 Block +OpDecorate %70 DescriptorSet 0 +OpDecorate %70 Binding 1 +OpDecorate %71 Block +OpMemberDecorate %71 0 Offset 0 +OpDecorate %73 DescriptorSet 0 +OpDecorate %73 Binding 2 +OpDecorate %74 Block +OpMemberDecorate %74 0 Offset 0 OpDecorate %76 DescriptorSet 0 -OpDecorate %76 Binding 1 +OpDecorate %76 Binding 3 OpDecorate %77 Block OpMemberDecorate %77 0 Offset 0 -OpDecorate %79 DescriptorSet 0 -OpDecorate %79 Binding 2 -OpDecorate %80 Block -OpMemberDecorate %80 0 Offset 0 -OpDecorate %82 DescriptorSet 0 -OpDecorate %82 Binding 3 -OpDecorate %83 Block -OpMemberDecorate %83 0 Offset 0 -OpDecorate %242 BuiltIn VertexIndex -OpDecorate %245 BuiltIn Position -OpDecorate %288 Location 0 -OpDecorate %311 BuiltIn LocalInvocationId +OpDecorate %238 BuiltIn VertexIndex +OpDecorate %241 BuiltIn Position +OpDecorate %285 Location 0 +OpDecorate %309 BuiltIn LocalInvocationId %2 = OpTypeVoid %4 = OpTypeInt 32 0 %3 = OpConstant %4 0 @@ -125,12 +125,12 @@ OpDecorate %311 BuiltIn LocalInvocationId %20 = OpConstant %11 20.0 %21 = OpConstant %11 30.0 %22 = OpConstant %11 40.0 -%23 = OpConstant %11 0.0 -%24 = OpConstant %11 8.0 -%25 = OpConstant %11 7.0 -%26 = OpConstant %6 5 -%27 = OpConstant %6 4 -%28 = OpConstant %6 9 +%23 = OpConstant %11 8.0 +%24 = OpConstant %11 7.0 +%25 = OpConstant %6 5 +%26 = OpConstant %6 4 +%27 = OpConstant %6 9 +%28 = OpConstant %11 0.0 %29 = OpConstant %4 3 %30 = OpConstant %4 2 %31 = OpConstant %6 3 @@ -158,345 +158,343 @@ OpDecorate %311 BuiltIn LocalInvocationId %53 = OpTypeStruct %52 %54 = OpTypePointer Function %11 %55 = OpTypeArray %11 %8 -%56 = OpTypeArray %55 %26 +%56 = OpTypeArray %55 %25 %57 = OpTypeVector %11 4 %58 = OpTypePointer StorageBuffer %6 -%59 = OpTypeArray %6 %26 +%59 = OpTypeArray %6 %25 %60 = OpTypeVector %6 4 %61 = OpTypePointer Workgroup %4 %62 = OpTypeArray %57 %7 %63 = OpTypePointer Function %62 %64 = OpConstantComposite %35 %3 %3 %3 %65 = OpConstantComposite %36 %3 %64 %5 -%66 = OpConstantComposite %41 %23 %23 -%67 = OpConstantComposite %51 %66 %66 %66 %66 -%68 = OpConstantComposite %52 %67 %67 -%69 = OpConstantComposite %55 %23 %23 %23 %23 %23 %23 %23 %23 %23 %23 -%70 = OpConstantComposite %56 %69 %69 %69 %69 %69 -%71 = OpConstantComposite %50 %5 %5 -%73 = OpTypePointer Private %36 -%72 = OpVariable %73 Private %65 -%75 = OpTypePointer StorageBuffer %47 -%74 = OpVariable %75 StorageBuffer -%77 = OpTypeStruct %49 +%67 = OpTypePointer Private %36 +%66 = OpVariable %67 Private %65 +%69 = OpTypePointer StorageBuffer %47 +%68 = OpVariable %69 StorageBuffer +%71 = OpTypeStruct %49 +%72 = OpTypePointer Uniform %71 +%70 = OpVariable %72 Uniform +%74 = OpTypeStruct %50 +%75 = OpTypePointer StorageBuffer %74 +%73 = OpVariable %75 StorageBuffer +%77 = OpTypeStruct %53 %78 = OpTypePointer Uniform %77 %76 = OpVariable %78 Uniform -%80 = OpTypeStruct %50 -%81 = OpTypePointer StorageBuffer %80 -%79 = OpVariable %81 StorageBuffer -%83 = OpTypeStruct %53 -%84 = OpTypePointer Uniform %83 -%82 = OpVariable %84 Uniform -%85 = OpVariable %61 Workgroup -%87 = OpTypePointer Function %6 -%88 = OpConstantNull %6 -%90 = OpTypePointer Function %49 -%91 = OpConstantNull %49 -%94 = OpTypeFunction %2 -%95 = OpTypePointer Uniform %49 -%100 = OpTypePointer Uniform %48 -%103 = OpTypePointer Uniform %41 -%109 = OpTypePointer Uniform %11 -%129 = OpTypePointer Function %48 -%135 = OpTypePointer Function %41 -%141 = OpTypePointer Function %11 -%151 = OpConstantNull %6 -%153 = OpTypePointer Function %53 -%154 = OpConstantNull %53 -%157 = OpTypePointer Uniform %53 -%162 = OpTypePointer Uniform %52 -%165 = OpTypePointer Uniform %51 -%188 = OpTypePointer Function %52 -%190 = OpTypePointer Function %51 -%213 = OpTypeFunction %11 %54 -%219 = OpTypeFunction %11 %56 -%226 = OpTypeFunction %2 %61 -%231 = OpTypeFunction %2 %63 -%237 = OpConstantNull %11 -%239 = OpTypePointer Function %59 -%240 = OpConstantNull %59 -%243 = OpTypePointer Input %4 -%242 = OpVariable %243 Input -%246 = OpTypePointer Output %57 -%245 = OpVariable %246 Output -%249 = OpTypePointer StorageBuffer %50 -%256 = OpTypePointer StorageBuffer %38 -%259 = OpTypePointer StorageBuffer %45 -%260 = OpConstant %4 4 -%263 = OpTypePointer StorageBuffer %39 -%264 = OpTypePointer StorageBuffer %11 -%267 = OpTypePointer StorageBuffer %46 -%270 = OpTypePointer StorageBuffer %37 -%271 = OpConstant %4 5 -%288 = OpVariable %246 Output -%306 = OpConstantNull %62 -%310 = OpConstantNull %4 -%312 = OpTypePointer Input %35 -%311 = OpVariable %312 Input -%314 = OpConstantNull %35 -%316 = OpTypeBool -%315 = OpTypeVector %316 3 -%321 = OpConstant %4 264 -%93 = OpFunction %2 None %94 -%92 = OpLabel -%86 = OpVariable %87 Function %88 -%89 = OpVariable %90 Function %91 -%96 = OpAccessChain %95 %76 %3 -OpBranch %97 -%97 = OpLabel -OpStore %86 %9 -%98 = OpLoad %6 %86 -%99 = OpISub %6 %98 %9 -OpStore %86 %99 -%101 = OpAccessChain %100 %96 %3 -%102 = OpLoad %48 %101 -%104 = OpAccessChain %103 %96 %3 %3 -%105 = OpLoad %41 %104 -%106 = OpLoad %6 %86 -%107 = OpAccessChain %103 %96 %3 %106 -%108 = OpLoad %41 %107 -%110 = OpAccessChain %109 %96 %3 %3 %32 +%79 = OpVariable %61 Workgroup +%81 = OpTypePointer Function %6 +%82 = OpConstantNull %6 +%84 = OpTypePointer Function %49 +%85 = OpConstantNull %49 +%88 = OpTypeFunction %2 +%89 = OpTypePointer Uniform %49 +%94 = OpTypePointer Uniform %48 +%97 = OpTypePointer Uniform %41 +%103 = OpTypePointer Uniform %11 +%123 = OpTypePointer Function %48 +%129 = OpTypePointer Function %41 +%135 = OpTypePointer Function %11 +%145 = OpConstantNull %6 +%147 = OpTypePointer Function %53 +%148 = OpConstantNull %53 +%151 = OpTypePointer Uniform %53 +%153 = OpConstantNull %52 +%154 = OpConstantNull %52 +%158 = OpTypePointer Uniform %52 +%161 = OpTypePointer Uniform %51 +%184 = OpTypePointer Function %52 +%186 = OpTypePointer Function %51 +%209 = OpTypeFunction %11 %54 +%215 = OpTypeFunction %11 %56 +%222 = OpTypeFunction %2 %61 +%227 = OpTypeFunction %2 %63 +%233 = OpConstantNull %11 +%235 = OpTypePointer Function %59 +%236 = OpConstantNull %59 +%239 = OpTypePointer Input %4 +%238 = OpVariable %239 Input +%242 = OpTypePointer Output %57 +%241 = OpVariable %242 Output +%245 = OpTypePointer StorageBuffer %50 +%248 = OpConstantNull %56 +%253 = OpTypePointer StorageBuffer %38 +%256 = OpTypePointer StorageBuffer %45 +%257 = OpConstant %4 4 +%260 = OpTypePointer StorageBuffer %39 +%261 = OpTypePointer StorageBuffer %11 +%264 = OpTypePointer StorageBuffer %46 +%267 = OpTypePointer StorageBuffer %37 +%268 = OpConstant %4 5 +%285 = OpVariable %242 Output +%288 = OpConstantNull %50 +%304 = OpConstantNull %62 +%308 = OpConstantNull %4 +%310 = OpTypePointer Input %35 +%309 = OpVariable %310 Input +%312 = OpConstantNull %35 +%314 = OpTypeBool +%313 = OpTypeVector %314 3 +%319 = OpConstant %4 264 +%87 = OpFunction %2 None %88 +%86 = OpLabel +%80 = OpVariable %81 Function %82 +%83 = OpVariable %84 Function %85 +%90 = OpAccessChain %89 %70 %3 +OpBranch %91 +%91 = OpLabel +OpStore %80 %9 +%92 = OpLoad %6 %80 +%93 = OpISub %6 %92 %9 +OpStore %80 %93 +%95 = OpAccessChain %94 %90 %3 +%96 = OpLoad %48 %95 +%98 = OpAccessChain %97 %90 %3 %3 +%99 = OpLoad %41 %98 +%100 = OpLoad %6 %80 +%101 = OpAccessChain %97 %90 %3 %100 +%102 = OpLoad %41 %101 +%104 = OpAccessChain %103 %90 %3 %3 %32 +%105 = OpLoad %11 %104 +%106 = OpLoad %6 %80 +%107 = OpAccessChain %103 %90 %3 %3 %106 +%108 = OpLoad %11 %107 +%109 = OpLoad %6 %80 +%110 = OpAccessChain %103 %90 %3 %109 %32 %111 = OpLoad %11 %110 -%112 = OpLoad %6 %86 -%113 = OpAccessChain %109 %96 %3 %3 %112 -%114 = OpLoad %11 %113 -%115 = OpLoad %6 %86 -%116 = OpAccessChain %109 %96 %3 %115 %32 -%117 = OpLoad %11 %116 -%118 = OpLoad %6 %86 -%119 = OpLoad %6 %86 -%120 = OpAccessChain %109 %96 %3 %118 %119 -%121 = OpLoad %11 %120 -%122 = OpCompositeConstruct %41 %10 %10 -%123 = OpCompositeConstruct %41 %12 %12 -%124 = OpCompositeConstruct %41 %13 %13 -%125 = OpCompositeConstruct %48 %122 %123 %124 -%126 = OpCompositeConstruct %49 %125 -OpStore %89 %126 -%127 = OpLoad %6 %86 -%128 = OpIAdd %6 %127 %9 -OpStore %86 %128 -%130 = OpCompositeConstruct %41 %14 %14 -%131 = OpCompositeConstruct %41 %15 %15 -%132 = OpCompositeConstruct %41 %16 %16 -%133 = OpCompositeConstruct %48 %130 %131 %132 -%134 = OpAccessChain %129 %89 %3 +%112 = OpLoad %6 %80 +%113 = OpLoad %6 %80 +%114 = OpAccessChain %103 %90 %3 %112 %113 +%115 = OpLoad %11 %114 +%116 = OpCompositeConstruct %41 %10 %10 +%117 = OpCompositeConstruct %41 %12 %12 +%118 = OpCompositeConstruct %41 %13 %13 +%119 = OpCompositeConstruct %48 %116 %117 %118 +%120 = OpCompositeConstruct %49 %119 +OpStore %83 %120 +%121 = OpLoad %6 %80 +%122 = OpIAdd %6 %121 %9 +OpStore %80 %122 +%124 = OpCompositeConstruct %41 %14 %14 +%125 = OpCompositeConstruct %41 %15 %15 +%126 = OpCompositeConstruct %41 %16 %16 +%127 = OpCompositeConstruct %48 %124 %125 %126 +%128 = OpAccessChain %123 %83 %3 +OpStore %128 %127 +%130 = OpCompositeConstruct %41 %17 %17 +%131 = OpAccessChain %129 %83 %3 %3 +OpStore %131 %130 +%132 = OpLoad %6 %80 +%133 = OpCompositeConstruct %41 %18 %18 +%134 = OpAccessChain %129 %83 %3 %132 OpStore %134 %133 -%136 = OpCompositeConstruct %41 %17 %17 -%137 = OpAccessChain %135 %89 %3 %3 -OpStore %137 %136 -%138 = OpLoad %6 %86 -%139 = OpCompositeConstruct %41 %18 %18 -%140 = OpAccessChain %135 %89 %3 %138 -OpStore %140 %139 -%142 = OpAccessChain %141 %89 %3 %3 %32 -OpStore %142 %19 -%143 = OpLoad %6 %86 -%144 = OpAccessChain %141 %89 %3 %3 %143 -OpStore %144 %20 -%145 = OpLoad %6 %86 -%146 = OpAccessChain %141 %89 %3 %145 %32 -OpStore %146 %21 -%147 = OpLoad %6 %86 -%148 = OpLoad %6 %86 -%149 = OpAccessChain %141 %89 %3 %147 %148 -OpStore %149 %22 +%136 = OpAccessChain %135 %83 %3 %3 %32 +OpStore %136 %19 +%137 = OpLoad %6 %80 +%138 = OpAccessChain %135 %83 %3 %3 %137 +OpStore %138 %20 +%139 = OpLoad %6 %80 +%140 = OpAccessChain %135 %83 %3 %139 %32 +OpStore %140 %21 +%141 = OpLoad %6 %80 +%142 = OpLoad %6 %80 +%143 = OpAccessChain %135 %83 %3 %141 %142 +OpStore %143 %22 OpReturn OpFunctionEnd -%156 = OpFunction %2 None %94 +%150 = OpFunction %2 None %88 +%149 = OpLabel +%144 = OpVariable %81 Function %145 +%146 = OpVariable %147 Function %148 +%152 = OpAccessChain %151 %76 %3 +OpBranch %155 %155 = OpLabel -%150 = OpVariable %87 Function %151 -%152 = OpVariable %153 Function %154 -%158 = OpAccessChain %157 %82 %3 -OpBranch %159 -%159 = OpLabel -OpStore %150 %9 -%160 = OpLoad %6 %150 -%161 = OpISub %6 %160 %9 -OpStore %150 %161 -%163 = OpAccessChain %162 %158 %3 -%164 = OpLoad %52 %163 -%166 = OpAccessChain %165 %158 %3 %3 -%167 = OpLoad %51 %166 -%168 = OpAccessChain %103 %158 %3 %3 %3 -%169 = OpLoad %41 %168 -%170 = OpLoad %6 %150 -%171 = OpAccessChain %103 %158 %3 %3 %170 -%172 = OpLoad %41 %171 -%173 = OpAccessChain %109 %158 %3 %3 %3 %32 -%174 = OpLoad %11 %173 -%175 = OpLoad %6 %150 -%176 = OpAccessChain %109 %158 %3 %3 %3 %175 -%177 = OpLoad %11 %176 -%178 = OpLoad %6 %150 -%179 = OpAccessChain %109 %158 %3 %3 %178 %32 +OpStore %144 %9 +%156 = OpLoad %6 %144 +%157 = OpISub %6 %156 %9 +OpStore %144 %157 +%159 = OpAccessChain %158 %152 %3 +%160 = OpLoad %52 %159 +%162 = OpAccessChain %161 %152 %3 %3 +%163 = OpLoad %51 %162 +%164 = OpAccessChain %97 %152 %3 %3 %3 +%165 = OpLoad %41 %164 +%166 = OpLoad %6 %144 +%167 = OpAccessChain %97 %152 %3 %3 %166 +%168 = OpLoad %41 %167 +%169 = OpAccessChain %103 %152 %3 %3 %3 %32 +%170 = OpLoad %11 %169 +%171 = OpLoad %6 %144 +%172 = OpAccessChain %103 %152 %3 %3 %3 %171 +%173 = OpLoad %11 %172 +%174 = OpLoad %6 %144 +%175 = OpAccessChain %103 %152 %3 %3 %174 %32 +%176 = OpLoad %11 %175 +%177 = OpLoad %6 %144 +%178 = OpLoad %6 %144 +%179 = OpAccessChain %103 %152 %3 %3 %177 %178 %180 = OpLoad %11 %179 -%181 = OpLoad %6 %150 -%182 = OpLoad %6 %150 -%183 = OpAccessChain %109 %158 %3 %3 %181 %182 -%184 = OpLoad %11 %183 -%185 = OpCompositeConstruct %53 %68 -OpStore %152 %185 -%186 = OpLoad %6 %150 -%187 = OpIAdd %6 %186 %9 -OpStore %150 %187 -%189 = OpAccessChain %188 %152 %3 -OpStore %189 %68 -%191 = OpCompositeConstruct %41 %24 %24 -%192 = OpCompositeConstruct %41 %25 %25 -%193 = OpCompositeConstruct %41 %14 %14 -%194 = OpCompositeConstruct %41 %15 %15 -%195 = OpCompositeConstruct %51 %191 %192 %193 %194 -%196 = OpAccessChain %190 %152 %3 %3 -OpStore %196 %195 -%197 = OpCompositeConstruct %41 %17 %17 -%198 = OpAccessChain %135 %152 %3 %3 %3 -OpStore %198 %197 -%199 = OpLoad %6 %150 -%200 = OpCompositeConstruct %41 %18 %18 -%201 = OpAccessChain %135 %152 %3 %3 %199 -OpStore %201 %200 -%202 = OpAccessChain %141 %152 %3 %3 %3 %32 -OpStore %202 %19 -%203 = OpLoad %6 %150 -%204 = OpAccessChain %141 %152 %3 %3 %3 %203 -OpStore %204 %20 -%205 = OpLoad %6 %150 -%206 = OpAccessChain %141 %152 %3 %3 %205 %32 -OpStore %206 %21 -%207 = OpLoad %6 %150 -%208 = OpLoad %6 %150 -%209 = OpAccessChain %141 %152 %3 %3 %207 %208 -OpStore %209 %22 +%181 = OpCompositeConstruct %53 %153 +OpStore %146 %181 +%182 = OpLoad %6 %144 +%183 = OpIAdd %6 %182 %9 +OpStore %144 %183 +%185 = OpAccessChain %184 %146 %3 +OpStore %185 %154 +%187 = OpCompositeConstruct %41 %23 %23 +%188 = OpCompositeConstruct %41 %24 %24 +%189 = OpCompositeConstruct %41 %14 %14 +%190 = OpCompositeConstruct %41 %15 %15 +%191 = OpCompositeConstruct %51 %187 %188 %189 %190 +%192 = OpAccessChain %186 %146 %3 %3 +OpStore %192 %191 +%193 = OpCompositeConstruct %41 %17 %17 +%194 = OpAccessChain %129 %146 %3 %3 %3 +OpStore %194 %193 +%195 = OpLoad %6 %144 +%196 = OpCompositeConstruct %41 %18 %18 +%197 = OpAccessChain %129 %146 %3 %3 %195 +OpStore %197 %196 +%198 = OpAccessChain %135 %146 %3 %3 %3 %32 +OpStore %198 %19 +%199 = OpLoad %6 %144 +%200 = OpAccessChain %135 %146 %3 %3 %3 %199 +OpStore %200 %20 +%201 = OpLoad %6 %144 +%202 = OpAccessChain %135 %146 %3 %3 %201 %32 +OpStore %202 %21 +%203 = OpLoad %6 %144 +%204 = OpLoad %6 %144 +%205 = OpAccessChain %135 %146 %3 %3 %203 %204 +OpStore %205 %22 OpReturn OpFunctionEnd -%212 = OpFunction %11 None %213 -%211 = OpFunctionParameter %54 +%208 = OpFunction %11 None %209 +%207 = OpFunctionParameter %54 +%206 = OpLabel +OpBranch %210 %210 = OpLabel -OpBranch %214 -%214 = OpLabel -%215 = OpLoad %11 %211 -OpReturnValue %215 +%211 = OpLoad %11 %207 +OpReturnValue %211 OpFunctionEnd -%218 = OpFunction %11 None %219 -%217 = OpFunctionParameter %56 +%214 = OpFunction %11 None %215 +%213 = OpFunctionParameter %56 +%212 = OpLabel +OpBranch %216 %216 = OpLabel -OpBranch %220 -%220 = OpLabel -%221 = OpCompositeExtract %55 %217 4 -%222 = OpCompositeExtract %11 %221 9 -OpReturnValue %222 +%217 = OpCompositeExtract %55 %213 4 +%218 = OpCompositeExtract %11 %217 9 +OpReturnValue %218 OpFunctionEnd -%225 = OpFunction %2 None %226 -%224 = OpFunctionParameter %61 +%221 = OpFunction %2 None %222 +%220 = OpFunctionParameter %61 +%219 = OpLabel +OpBranch %223 %223 = OpLabel -OpBranch %227 -%227 = OpLabel -OpStore %224 %34 +OpStore %220 %34 OpReturn OpFunctionEnd -%230 = OpFunction %2 None %231 -%229 = OpFunctionParameter %63 +%226 = OpFunction %2 None %227 +%225 = OpFunctionParameter %63 +%224 = OpLabel +OpBranch %228 %228 = OpLabel -OpBranch %232 -%232 = OpLabel -%233 = OpCompositeConstruct %57 %10 %10 %10 %10 -%234 = OpCompositeConstruct %57 %12 %12 %12 %12 -%235 = OpCompositeConstruct %62 %233 %234 -OpStore %229 %235 +%229 = OpCompositeConstruct %57 %10 %10 %10 %10 +%230 = OpCompositeConstruct %57 %12 %12 %12 %12 +%231 = OpCompositeConstruct %62 %229 %230 +OpStore %225 %231 OpReturn OpFunctionEnd -%247 = OpFunction %2 None %94 -%241 = OpLabel -%236 = OpVariable %54 Function %237 -%238 = OpVariable %239 Function %240 -%244 = OpLoad %4 %242 -%248 = OpAccessChain %95 %76 %3 -%250 = OpAccessChain %249 %79 %3 -%251 = OpAccessChain %157 %82 %3 -OpBranch %252 -%252 = OpLabel -OpStore %236 %23 -%253 = OpLoad %11 %236 -OpStore %236 %10 -%254 = OpFunctionCall %2 %93 -%255 = OpFunctionCall %2 %156 -%257 = OpAccessChain %256 %74 %3 -%258 = OpLoad %38 %257 -%261 = OpAccessChain %259 %74 %260 -%262 = OpLoad %45 %261 -%265 = OpAccessChain %264 %74 %3 %29 %3 -%266 = OpLoad %11 %265 -%268 = OpArrayLength %4 %74 5 -%269 = OpISub %4 %268 %30 -%272 = OpAccessChain %58 %74 %271 %269 %3 -%273 = OpLoad %6 %272 -%274 = OpLoad %50 %250 -%275 = OpFunctionCall %11 %212 %236 -%276 = OpConvertFToS %6 %266 -%277 = OpCompositeConstruct %59 %273 %276 %31 %27 %26 -OpStore %238 %277 -%278 = OpIAdd %4 %244 %32 -%279 = OpAccessChain %87 %238 %278 -OpStore %279 %33 -%280 = OpAccessChain %87 %238 %244 -%281 = OpLoad %6 %280 -%282 = OpFunctionCall %11 %218 %70 -%283 = OpCompositeConstruct %60 %281 %281 %281 %281 -%284 = OpConvertSToF %57 %283 -%285 = OpMatrixTimesVector %39 %258 %284 -%286 = OpCompositeConstruct %57 %285 %12 -OpStore %245 %286 +%243 = OpFunction %2 None %88 +%237 = OpLabel +%232 = OpVariable %54 Function %233 +%234 = OpVariable %235 Function %236 +%240 = OpLoad %4 %238 +%244 = OpAccessChain %89 %70 %3 +%246 = OpAccessChain %245 %73 %3 +%247 = OpAccessChain %151 %76 %3 +OpBranch %249 +%249 = OpLabel +OpStore %232 %28 +%250 = OpLoad %11 %232 +OpStore %232 %10 +%251 = OpFunctionCall %2 %87 +%252 = OpFunctionCall %2 %150 +%254 = OpAccessChain %253 %68 %3 +%255 = OpLoad %38 %254 +%258 = OpAccessChain %256 %68 %257 +%259 = OpLoad %45 %258 +%262 = OpAccessChain %261 %68 %3 %29 %3 +%263 = OpLoad %11 %262 +%265 = OpArrayLength %4 %68 5 +%266 = OpISub %4 %265 %30 +%269 = OpAccessChain %58 %68 %268 %266 %3 +%270 = OpLoad %6 %269 +%271 = OpLoad %50 %246 +%272 = OpFunctionCall %11 %208 %232 +%273 = OpConvertFToS %6 %263 +%274 = OpCompositeConstruct %59 %270 %273 %31 %26 %25 +OpStore %234 %274 +%275 = OpIAdd %4 %240 %32 +%276 = OpAccessChain %81 %234 %275 +OpStore %276 %33 +%277 = OpAccessChain %81 %234 %240 +%278 = OpLoad %6 %277 +%279 = OpFunctionCall %11 %214 %248 +%280 = OpCompositeConstruct %60 %278 %278 %278 %278 +%281 = OpConvertSToF %57 %280 +%282 = OpMatrixTimesVector %39 %255 %281 +%283 = OpCompositeConstruct %57 %282 %12 +OpStore %241 %283 OpReturn OpFunctionEnd -%289 = OpFunction %2 None %94 -%287 = OpLabel -%290 = OpAccessChain %249 %79 %3 -OpBranch %291 -%291 = OpLabel -%292 = OpAccessChain %264 %74 %3 %32 %30 -OpStore %292 %10 -%293 = OpCompositeConstruct %39 %23 %23 %23 -%294 = OpCompositeConstruct %39 %10 %10 %10 -%295 = OpCompositeConstruct %39 %12 %12 %12 -%296 = OpCompositeConstruct %39 %13 %13 %13 -%297 = OpCompositeConstruct %38 %293 %294 %295 %296 -%298 = OpAccessChain %256 %74 %3 -OpStore %298 %297 -%299 = OpCompositeConstruct %44 %3 %3 -%300 = OpCompositeConstruct %44 %32 %32 -%301 = OpCompositeConstruct %45 %299 %300 -%302 = OpAccessChain %259 %74 %260 -OpStore %302 %301 -%303 = OpAccessChain %58 %74 %271 %32 %3 -OpStore %303 %9 -OpStore %290 %71 -%304 = OpCompositeConstruct %57 %23 %23 %23 %23 -OpStore %288 %304 +%286 = OpFunction %2 None %88 +%284 = OpLabel +%287 = OpAccessChain %245 %73 %3 +OpBranch %289 +%289 = OpLabel +%290 = OpAccessChain %261 %68 %3 %32 %30 +OpStore %290 %10 +%291 = OpCompositeConstruct %39 %28 %28 %28 +%292 = OpCompositeConstruct %39 %10 %10 %10 +%293 = OpCompositeConstruct %39 %12 %12 %12 +%294 = OpCompositeConstruct %39 %13 %13 %13 +%295 = OpCompositeConstruct %38 %291 %292 %293 %294 +%296 = OpAccessChain %253 %68 %3 +OpStore %296 %295 +%297 = OpCompositeConstruct %44 %3 %3 +%298 = OpCompositeConstruct %44 %32 %32 +%299 = OpCompositeConstruct %45 %297 %298 +%300 = OpAccessChain %256 %68 %257 +OpStore %300 %299 +%301 = OpAccessChain %58 %68 %268 %32 %3 +OpStore %301 %9 +OpStore %287 %288 +%302 = OpCompositeConstruct %57 %28 %28 %28 %28 +OpStore %285 %302 OpReturn OpFunctionEnd -%308 = OpFunction %2 None %94 +%306 = OpFunction %2 None %88 +%305 = OpLabel +%303 = OpVariable %63 Function %304 +OpBranch %307 %307 = OpLabel -%305 = OpVariable %63 Function %306 -OpBranch %309 -%309 = OpLabel -%313 = OpLoad %35 %311 -%317 = OpIEqual %315 %313 %314 -%318 = OpAll %316 %317 -OpSelectionMerge %319 None -OpBranchConditional %318 %320 %319 +%311 = OpLoad %35 %309 +%315 = OpIEqual %313 %311 %312 +%316 = OpAll %314 %315 +OpSelectionMerge %317 None +OpBranchConditional %316 %318 %317 +%318 = OpLabel +OpStore %79 %308 +OpBranch %317 +%317 = OpLabel +OpControlBarrier %30 %30 %319 +OpBranch %320 %320 = OpLabel -OpStore %85 %310 -OpBranch %319 -%319 = OpLabel -OpControlBarrier %30 %30 %321 -OpBranch %322 -%322 = OpLabel -%323 = OpCompositeConstruct %57 %14 %14 %14 %14 -%324 = OpCompositeConstruct %57 %25 %25 %25 %25 -%325 = OpCompositeConstruct %62 %323 %324 -OpStore %305 %325 -%326 = OpFunctionCall %2 %225 %85 -%327 = OpFunctionCall %2 %230 %305 +%321 = OpCompositeConstruct %57 %14 %14 %14 %14 +%322 = OpCompositeConstruct %57 %24 %24 %24 %24 +%323 = OpCompositeConstruct %62 %321 %322 +OpStore %303 %323 +%324 = OpFunctionCall %2 %221 %79 +%325 = OpFunctionCall %2 %226 %303 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/bounds-check-image-restrict.spvasm b/tests/out/spv/bounds-check-image-restrict.spvasm index 09d6ad2f40..33f900023f 100644 --- a/tests/out/spv/bounds-check-image-restrict.spvasm +++ b/tests/out/spv/bounds-check-image-restrict.spvasm @@ -1,109 +1,109 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 299 +; Bound: 310 OpCapability ImageQuery OpCapability Image1D OpCapability Shader OpCapability Sampled1D %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %275 "fragment_shader" %273 -OpExecutionMode %275 OriginUpperLeft +OpEntryPoint Fragment %272 "fragment_shader" %270 +OpExecutionMode %272 OriginUpperLeft OpSource GLSL 450 -OpName %27 "image_1d" -OpName %29 "image_2d" -OpName %31 "image_2d_array" -OpName %33 "image_3d" -OpName %35 "image_multisampled_2d" -OpName %37 "image_depth_2d" -OpName %39 "image_depth_2d_array" -OpName %41 "image_depth_multisampled_2d" -OpName %43 "image_storage_1d" -OpName %45 "image_storage_2d" -OpName %47 "image_storage_2d_array" -OpName %49 "image_storage_3d" -OpName %52 "coords" -OpName %53 "level" -OpName %54 "test_textureLoad_1d" -OpName %67 "coords" -OpName %68 "level" -OpName %69 "test_textureLoad_2d" -OpName %82 "coords" -OpName %83 "index" -OpName %84 "level" -OpName %85 "test_textureLoad_2d_array_u" -OpName %100 "coords" -OpName %101 "index" -OpName %102 "level" -OpName %103 "test_textureLoad_2d_array_s" -OpName %117 "coords" -OpName %118 "level" -OpName %119 "test_textureLoad_3d" -OpName %132 "coords" -OpName %133 "_sample" -OpName %134 "test_textureLoad_multisampled_2d" -OpName %146 "coords" -OpName %147 "level" -OpName %148 "test_textureLoad_depth_2d" -OpName %162 "coords" -OpName %163 "index" -OpName %164 "level" -OpName %165 "test_textureLoad_depth_2d_array_u" -OpName %181 "coords" -OpName %182 "index" -OpName %183 "level" -OpName %184 "test_textureLoad_depth_2d_array_s" -OpName %199 "coords" -OpName %200 "_sample" -OpName %201 "test_textureLoad_depth_multisampled_2d" -OpName %214 "coords" -OpName %215 "value" -OpName %216 "test_textureStore_1d" -OpName %224 "coords" -OpName %225 "value" -OpName %226 "test_textureStore_2d" -OpName %235 "coords" -OpName %236 "array_index" -OpName %237 "value" -OpName %238 "test_textureStore_2d_array_u" -OpName %249 "coords" -OpName %250 "array_index" -OpName %251 "value" -OpName %252 "test_textureStore_2d_array_s" -OpName %262 "coords" -OpName %263 "value" -OpName %264 "test_textureStore_3d" -OpName %275 "fragment_shader" -OpDecorate %27 DescriptorSet 0 -OpDecorate %27 Binding 0 -OpDecorate %29 DescriptorSet 0 -OpDecorate %29 Binding 1 -OpDecorate %31 DescriptorSet 0 -OpDecorate %31 Binding 2 -OpDecorate %33 DescriptorSet 0 -OpDecorate %33 Binding 3 -OpDecorate %35 DescriptorSet 0 -OpDecorate %35 Binding 4 -OpDecorate %37 DescriptorSet 0 -OpDecorate %37 Binding 5 -OpDecorate %39 DescriptorSet 0 -OpDecorate %39 Binding 6 -OpDecorate %41 DescriptorSet 0 -OpDecorate %41 Binding 7 -OpDecorate %43 NonReadable -OpDecorate %43 DescriptorSet 0 -OpDecorate %43 Binding 8 -OpDecorate %45 NonReadable -OpDecorate %45 DescriptorSet 0 -OpDecorate %45 Binding 9 -OpDecorate %47 NonReadable -OpDecorate %47 DescriptorSet 0 -OpDecorate %47 Binding 10 -OpDecorate %49 NonReadable -OpDecorate %49 DescriptorSet 0 -OpDecorate %49 Binding 11 -OpDecorate %273 Location 0 +OpName %24 "image_1d" +OpName %26 "image_2d" +OpName %28 "image_2d_array" +OpName %30 "image_3d" +OpName %32 "image_multisampled_2d" +OpName %34 "image_depth_2d" +OpName %36 "image_depth_2d_array" +OpName %38 "image_depth_multisampled_2d" +OpName %40 "image_storage_1d" +OpName %42 "image_storage_2d" +OpName %44 "image_storage_2d_array" +OpName %46 "image_storage_3d" +OpName %49 "coords" +OpName %50 "level" +OpName %51 "test_textureLoad_1d" +OpName %64 "coords" +OpName %65 "level" +OpName %66 "test_textureLoad_2d" +OpName %79 "coords" +OpName %80 "index" +OpName %81 "level" +OpName %82 "test_textureLoad_2d_array_u" +OpName %97 "coords" +OpName %98 "index" +OpName %99 "level" +OpName %100 "test_textureLoad_2d_array_s" +OpName %114 "coords" +OpName %115 "level" +OpName %116 "test_textureLoad_3d" +OpName %129 "coords" +OpName %130 "_sample" +OpName %131 "test_textureLoad_multisampled_2d" +OpName %143 "coords" +OpName %144 "level" +OpName %145 "test_textureLoad_depth_2d" +OpName %159 "coords" +OpName %160 "index" +OpName %161 "level" +OpName %162 "test_textureLoad_depth_2d_array_u" +OpName %178 "coords" +OpName %179 "index" +OpName %180 "level" +OpName %181 "test_textureLoad_depth_2d_array_s" +OpName %196 "coords" +OpName %197 "_sample" +OpName %198 "test_textureLoad_depth_multisampled_2d" +OpName %211 "coords" +OpName %212 "value" +OpName %213 "test_textureStore_1d" +OpName %221 "coords" +OpName %222 "value" +OpName %223 "test_textureStore_2d" +OpName %232 "coords" +OpName %233 "array_index" +OpName %234 "value" +OpName %235 "test_textureStore_2d_array_u" +OpName %246 "coords" +OpName %247 "array_index" +OpName %248 "value" +OpName %249 "test_textureStore_2d_array_s" +OpName %259 "coords" +OpName %260 "value" +OpName %261 "test_textureStore_3d" +OpName %272 "fragment_shader" +OpDecorate %24 DescriptorSet 0 +OpDecorate %24 Binding 0 +OpDecorate %26 DescriptorSet 0 +OpDecorate %26 Binding 1 +OpDecorate %28 DescriptorSet 0 +OpDecorate %28 Binding 2 +OpDecorate %30 DescriptorSet 0 +OpDecorate %30 Binding 3 +OpDecorate %32 DescriptorSet 0 +OpDecorate %32 Binding 4 +OpDecorate %34 DescriptorSet 0 +OpDecorate %34 Binding 5 +OpDecorate %36 DescriptorSet 0 +OpDecorate %36 Binding 6 +OpDecorate %38 DescriptorSet 0 +OpDecorate %38 Binding 7 +OpDecorate %40 NonReadable +OpDecorate %40 DescriptorSet 0 +OpDecorate %40 Binding 8 +OpDecorate %42 NonReadable +OpDecorate %42 DescriptorSet 0 +OpDecorate %42 Binding 9 +OpDecorate %44 NonReadable +OpDecorate %44 DescriptorSet 0 +OpDecorate %44 Binding 10 +OpDecorate %46 NonReadable +OpDecorate %46 DescriptorSet 0 +OpDecorate %46 Binding 11 +OpDecorate %270 Location 0 %2 = OpTypeVoid %4 = OpTypeInt 32 1 %3 = OpConstant %4 0 @@ -126,332 +126,343 @@ OpDecorate %273 Location 0 %21 = OpTypeImage %8 2D 0 0 0 2 Rgba8 %22 = OpTypeImage %8 2D 0 1 0 2 Rgba8 %23 = OpTypeImage %8 3D 0 0 0 2 Rgba8 -%24 = OpConstantComposite %12 %3 %3 -%25 = OpConstantComposite %15 %3 %3 %3 -%26 = OpConstantComposite %10 %7 %7 %7 %7 -%28 = OpTypePointer UniformConstant %9 -%27 = OpVariable %28 UniformConstant -%30 = OpTypePointer UniformConstant %11 -%29 = OpVariable %30 UniformConstant -%32 = OpTypePointer UniformConstant %13 -%31 = OpVariable %32 UniformConstant -%34 = OpTypePointer UniformConstant %14 -%33 = OpVariable %34 UniformConstant -%36 = OpTypePointer UniformConstant %16 -%35 = OpVariable %36 UniformConstant -%38 = OpTypePointer UniformConstant %17 -%37 = OpVariable %38 UniformConstant -%40 = OpTypePointer UniformConstant %18 -%39 = OpVariable %40 UniformConstant -%42 = OpTypePointer UniformConstant %19 -%41 = OpVariable %42 UniformConstant -%44 = OpTypePointer UniformConstant %20 -%43 = OpVariable %44 UniformConstant -%46 = OpTypePointer UniformConstant %21 -%45 = OpVariable %46 UniformConstant -%48 = OpTypePointer UniformConstant %22 -%47 = OpVariable %48 UniformConstant -%50 = OpTypePointer UniformConstant %23 -%49 = OpVariable %50 UniformConstant -%55 = OpTypeFunction %10 %4 %4 -%59 = OpConstant %4 1 -%70 = OpTypeFunction %10 %12 %4 -%77 = OpConstantComposite %12 %59 %59 -%86 = OpTypeFunction %10 %12 %6 %4 -%95 = OpConstantComposite %15 %59 %59 %59 -%104 = OpTypeFunction %10 %12 %4 %4 -%112 = OpConstantComposite %15 %59 %59 %59 -%120 = OpTypeFunction %10 %15 %4 -%127 = OpConstantComposite %15 %59 %59 %59 -%141 = OpConstantComposite %12 %59 %59 -%149 = OpTypeFunction %8 %12 %4 -%156 = OpConstantComposite %12 %59 %59 -%166 = OpTypeFunction %8 %12 %6 %4 -%175 = OpConstantComposite %15 %59 %59 %59 -%185 = OpTypeFunction %8 %12 %4 %4 -%193 = OpConstantComposite %15 %59 %59 %59 -%208 = OpConstantComposite %12 %59 %59 -%217 = OpTypeFunction %2 %4 %10 -%227 = OpTypeFunction %2 %12 %10 -%231 = OpConstantComposite %12 %59 %59 -%239 = OpTypeFunction %2 %12 %6 %10 -%245 = OpConstantComposite %15 %59 %59 %59 -%253 = OpTypeFunction %2 %12 %4 %10 -%258 = OpConstantComposite %15 %59 %59 %59 -%265 = OpTypeFunction %2 %15 %10 -%269 = OpConstantComposite %15 %59 %59 %59 -%274 = OpTypePointer Output %10 -%273 = OpVariable %274 Output -%276 = OpTypeFunction %2 -%54 = OpFunction %10 None %55 -%52 = OpFunctionParameter %4 -%53 = OpFunctionParameter %4 -%51 = OpLabel -%56 = OpLoad %9 %27 -OpBranch %57 -%57 = OpLabel -%58 = OpImageQueryLevels %4 %56 -%60 = OpISub %4 %58 %59 -%61 = OpExtInst %4 %1 UMin %53 %60 -%62 = OpImageQuerySizeLod %4 %56 %61 -%63 = OpISub %4 %62 %59 -%64 = OpExtInst %4 %1 UMin %52 %63 -%65 = OpImageFetch %10 %56 %64 Lod %61 -OpReturnValue %65 +%25 = OpTypePointer UniformConstant %9 +%24 = OpVariable %25 UniformConstant +%27 = OpTypePointer UniformConstant %11 +%26 = OpVariable %27 UniformConstant +%29 = OpTypePointer UniformConstant %13 +%28 = OpVariable %29 UniformConstant +%31 = OpTypePointer UniformConstant %14 +%30 = OpVariable %31 UniformConstant +%33 = OpTypePointer UniformConstant %16 +%32 = OpVariable %33 UniformConstant +%35 = OpTypePointer UniformConstant %17 +%34 = OpVariable %35 UniformConstant +%37 = OpTypePointer UniformConstant %18 +%36 = OpVariable %37 UniformConstant +%39 = OpTypePointer UniformConstant %19 +%38 = OpVariable %39 UniformConstant +%41 = OpTypePointer UniformConstant %20 +%40 = OpVariable %41 UniformConstant +%43 = OpTypePointer UniformConstant %21 +%42 = OpVariable %43 UniformConstant +%45 = OpTypePointer UniformConstant %22 +%44 = OpVariable %45 UniformConstant +%47 = OpTypePointer UniformConstant %23 +%46 = OpVariable %47 UniformConstant +%52 = OpTypeFunction %10 %4 %4 +%56 = OpConstant %4 1 +%67 = OpTypeFunction %10 %12 %4 +%74 = OpConstantComposite %12 %56 %56 +%83 = OpTypeFunction %10 %12 %6 %4 +%92 = OpConstantComposite %15 %56 %56 %56 +%101 = OpTypeFunction %10 %12 %4 %4 +%109 = OpConstantComposite %15 %56 %56 %56 +%117 = OpTypeFunction %10 %15 %4 +%124 = OpConstantComposite %15 %56 %56 %56 +%138 = OpConstantComposite %12 %56 %56 +%146 = OpTypeFunction %8 %12 %4 +%153 = OpConstantComposite %12 %56 %56 +%163 = OpTypeFunction %8 %12 %6 %4 +%172 = OpConstantComposite %15 %56 %56 %56 +%182 = OpTypeFunction %8 %12 %4 %4 +%190 = OpConstantComposite %15 %56 %56 %56 +%205 = OpConstantComposite %12 %56 %56 +%214 = OpTypeFunction %2 %4 %10 +%224 = OpTypeFunction %2 %12 %10 +%228 = OpConstantComposite %12 %56 %56 +%236 = OpTypeFunction %2 %12 %6 %10 +%242 = OpConstantComposite %15 %56 %56 %56 +%250 = OpTypeFunction %2 %12 %4 %10 +%255 = OpConstantComposite %15 %56 %56 %56 +%262 = OpTypeFunction %2 %15 %10 +%266 = OpConstantComposite %15 %56 %56 %56 +%271 = OpTypePointer Output %10 +%270 = OpVariable %271 Output +%273 = OpTypeFunction %2 +%283 = OpConstantNull %12 +%284 = OpConstantNull %12 +%285 = OpConstantNull %12 +%286 = OpConstantNull %15 +%287 = OpConstantNull %12 +%288 = OpConstantNull %10 +%289 = OpConstantNull %12 +%290 = OpConstantNull %10 +%291 = OpConstantNull %12 +%292 = OpConstantNull %10 +%293 = OpConstantNull %12 +%294 = OpConstantNull %10 +%295 = OpConstantNull %15 +%296 = OpConstantNull %10 +%51 = OpFunction %10 None %52 +%49 = OpFunctionParameter %4 +%50 = OpFunctionParameter %4 +%48 = OpLabel +%53 = OpLoad %9 %24 +OpBranch %54 +%54 = OpLabel +%55 = OpImageQueryLevels %4 %53 +%57 = OpISub %4 %55 %56 +%58 = OpExtInst %4 %1 UMin %50 %57 +%59 = OpImageQuerySizeLod %4 %53 %58 +%60 = OpISub %4 %59 %56 +%61 = OpExtInst %4 %1 UMin %49 %60 +%62 = OpImageFetch %10 %53 %61 Lod %58 +OpReturnValue %62 OpFunctionEnd -%69 = OpFunction %10 None %70 -%67 = OpFunctionParameter %12 -%68 = OpFunctionParameter %4 -%66 = OpLabel -%71 = OpLoad %11 %29 -OpBranch %72 -%72 = OpLabel -%73 = OpImageQueryLevels %4 %71 -%74 = OpISub %4 %73 %59 -%75 = OpExtInst %4 %1 UMin %68 %74 -%76 = OpImageQuerySizeLod %12 %71 %75 -%78 = OpISub %12 %76 %77 -%79 = OpExtInst %12 %1 UMin %67 %78 -%80 = OpImageFetch %10 %71 %79 Lod %75 -OpReturnValue %80 +%66 = OpFunction %10 None %67 +%64 = OpFunctionParameter %12 +%65 = OpFunctionParameter %4 +%63 = OpLabel +%68 = OpLoad %11 %26 +OpBranch %69 +%69 = OpLabel +%70 = OpImageQueryLevels %4 %68 +%71 = OpISub %4 %70 %56 +%72 = OpExtInst %4 %1 UMin %65 %71 +%73 = OpImageQuerySizeLod %12 %68 %72 +%75 = OpISub %12 %73 %74 +%76 = OpExtInst %12 %1 UMin %64 %75 +%77 = OpImageFetch %10 %68 %76 Lod %72 +OpReturnValue %77 OpFunctionEnd -%85 = OpFunction %10 None %86 -%82 = OpFunctionParameter %12 -%83 = OpFunctionParameter %6 -%84 = OpFunctionParameter %4 -%81 = OpLabel -%87 = OpLoad %13 %31 -OpBranch %88 -%88 = OpLabel -%89 = OpBitcast %4 %83 -%90 = OpCompositeConstruct %15 %82 %89 -%91 = OpImageQueryLevels %4 %87 -%92 = OpISub %4 %91 %59 -%93 = OpExtInst %4 %1 UMin %84 %92 -%94 = OpImageQuerySizeLod %15 %87 %93 -%96 = OpISub %15 %94 %95 -%97 = OpExtInst %15 %1 UMin %90 %96 -%98 = OpImageFetch %10 %87 %97 Lod %93 -OpReturnValue %98 +%82 = OpFunction %10 None %83 +%79 = OpFunctionParameter %12 +%80 = OpFunctionParameter %6 +%81 = OpFunctionParameter %4 +%78 = OpLabel +%84 = OpLoad %13 %28 +OpBranch %85 +%85 = OpLabel +%86 = OpBitcast %4 %80 +%87 = OpCompositeConstruct %15 %79 %86 +%88 = OpImageQueryLevels %4 %84 +%89 = OpISub %4 %88 %56 +%90 = OpExtInst %4 %1 UMin %81 %89 +%91 = OpImageQuerySizeLod %15 %84 %90 +%93 = OpISub %15 %91 %92 +%94 = OpExtInst %15 %1 UMin %87 %93 +%95 = OpImageFetch %10 %84 %94 Lod %90 +OpReturnValue %95 OpFunctionEnd -%103 = OpFunction %10 None %104 -%100 = OpFunctionParameter %12 -%101 = OpFunctionParameter %4 -%102 = OpFunctionParameter %4 -%99 = OpLabel -%105 = OpLoad %13 %31 -OpBranch %106 -%106 = OpLabel -%107 = OpCompositeConstruct %15 %100 %101 -%108 = OpImageQueryLevels %4 %105 -%109 = OpISub %4 %108 %59 -%110 = OpExtInst %4 %1 UMin %102 %109 -%111 = OpImageQuerySizeLod %15 %105 %110 -%113 = OpISub %15 %111 %112 -%114 = OpExtInst %15 %1 UMin %107 %113 -%115 = OpImageFetch %10 %105 %114 Lod %110 -OpReturnValue %115 +%100 = OpFunction %10 None %101 +%97 = OpFunctionParameter %12 +%98 = OpFunctionParameter %4 +%99 = OpFunctionParameter %4 +%96 = OpLabel +%102 = OpLoad %13 %28 +OpBranch %103 +%103 = OpLabel +%104 = OpCompositeConstruct %15 %97 %98 +%105 = OpImageQueryLevels %4 %102 +%106 = OpISub %4 %105 %56 +%107 = OpExtInst %4 %1 UMin %99 %106 +%108 = OpImageQuerySizeLod %15 %102 %107 +%110 = OpISub %15 %108 %109 +%111 = OpExtInst %15 %1 UMin %104 %110 +%112 = OpImageFetch %10 %102 %111 Lod %107 +OpReturnValue %112 OpFunctionEnd -%119 = OpFunction %10 None %120 -%117 = OpFunctionParameter %15 -%118 = OpFunctionParameter %4 -%116 = OpLabel -%121 = OpLoad %14 %33 -OpBranch %122 -%122 = OpLabel -%123 = OpImageQueryLevels %4 %121 -%124 = OpISub %4 %123 %59 -%125 = OpExtInst %4 %1 UMin %118 %124 -%126 = OpImageQuerySizeLod %15 %121 %125 -%128 = OpISub %15 %126 %127 -%129 = OpExtInst %15 %1 UMin %117 %128 -%130 = OpImageFetch %10 %121 %129 Lod %125 -OpReturnValue %130 +%116 = OpFunction %10 None %117 +%114 = OpFunctionParameter %15 +%115 = OpFunctionParameter %4 +%113 = OpLabel +%118 = OpLoad %14 %30 +OpBranch %119 +%119 = OpLabel +%120 = OpImageQueryLevels %4 %118 +%121 = OpISub %4 %120 %56 +%122 = OpExtInst %4 %1 UMin %115 %121 +%123 = OpImageQuerySizeLod %15 %118 %122 +%125 = OpISub %15 %123 %124 +%126 = OpExtInst %15 %1 UMin %114 %125 +%127 = OpImageFetch %10 %118 %126 Lod %122 +OpReturnValue %127 OpFunctionEnd -%134 = OpFunction %10 None %70 -%132 = OpFunctionParameter %12 -%133 = OpFunctionParameter %4 -%131 = OpLabel -%135 = OpLoad %16 %35 -OpBranch %136 -%136 = OpLabel -%137 = OpImageQuerySamples %4 %135 -%138 = OpISub %4 %137 %59 -%139 = OpExtInst %4 %1 UMin %133 %138 -%140 = OpImageQuerySize %12 %135 -%142 = OpISub %12 %140 %141 -%143 = OpExtInst %12 %1 UMin %132 %142 -%144 = OpImageFetch %10 %135 %143 Sample %139 -OpReturnValue %144 +%131 = OpFunction %10 None %67 +%129 = OpFunctionParameter %12 +%130 = OpFunctionParameter %4 +%128 = OpLabel +%132 = OpLoad %16 %32 +OpBranch %133 +%133 = OpLabel +%134 = OpImageQuerySamples %4 %132 +%135 = OpISub %4 %134 %56 +%136 = OpExtInst %4 %1 UMin %130 %135 +%137 = OpImageQuerySize %12 %132 +%139 = OpISub %12 %137 %138 +%140 = OpExtInst %12 %1 UMin %129 %139 +%141 = OpImageFetch %10 %132 %140 Sample %136 +OpReturnValue %141 OpFunctionEnd -%148 = OpFunction %8 None %149 -%146 = OpFunctionParameter %12 -%147 = OpFunctionParameter %4 -%145 = OpLabel -%150 = OpLoad %17 %37 -OpBranch %151 -%151 = OpLabel -%152 = OpImageQueryLevels %4 %150 -%153 = OpISub %4 %152 %59 -%154 = OpExtInst %4 %1 UMin %147 %153 -%155 = OpImageQuerySizeLod %12 %150 %154 -%157 = OpISub %12 %155 %156 -%158 = OpExtInst %12 %1 UMin %146 %157 -%159 = OpImageFetch %10 %150 %158 Lod %154 -%160 = OpCompositeExtract %8 %159 0 -OpReturnValue %160 +%145 = OpFunction %8 None %146 +%143 = OpFunctionParameter %12 +%144 = OpFunctionParameter %4 +%142 = OpLabel +%147 = OpLoad %17 %34 +OpBranch %148 +%148 = OpLabel +%149 = OpImageQueryLevels %4 %147 +%150 = OpISub %4 %149 %56 +%151 = OpExtInst %4 %1 UMin %144 %150 +%152 = OpImageQuerySizeLod %12 %147 %151 +%154 = OpISub %12 %152 %153 +%155 = OpExtInst %12 %1 UMin %143 %154 +%156 = OpImageFetch %10 %147 %155 Lod %151 +%157 = OpCompositeExtract %8 %156 0 +OpReturnValue %157 OpFunctionEnd -%165 = OpFunction %8 None %166 -%162 = OpFunctionParameter %12 -%163 = OpFunctionParameter %6 -%164 = OpFunctionParameter %4 -%161 = OpLabel -%167 = OpLoad %18 %39 -OpBranch %168 -%168 = OpLabel -%169 = OpBitcast %4 %163 -%170 = OpCompositeConstruct %15 %162 %169 -%171 = OpImageQueryLevels %4 %167 -%172 = OpISub %4 %171 %59 -%173 = OpExtInst %4 %1 UMin %164 %172 -%174 = OpImageQuerySizeLod %15 %167 %173 -%176 = OpISub %15 %174 %175 -%177 = OpExtInst %15 %1 UMin %170 %176 -%178 = OpImageFetch %10 %167 %177 Lod %173 -%179 = OpCompositeExtract %8 %178 0 -OpReturnValue %179 +%162 = OpFunction %8 None %163 +%159 = OpFunctionParameter %12 +%160 = OpFunctionParameter %6 +%161 = OpFunctionParameter %4 +%158 = OpLabel +%164 = OpLoad %18 %36 +OpBranch %165 +%165 = OpLabel +%166 = OpBitcast %4 %160 +%167 = OpCompositeConstruct %15 %159 %166 +%168 = OpImageQueryLevels %4 %164 +%169 = OpISub %4 %168 %56 +%170 = OpExtInst %4 %1 UMin %161 %169 +%171 = OpImageQuerySizeLod %15 %164 %170 +%173 = OpISub %15 %171 %172 +%174 = OpExtInst %15 %1 UMin %167 %173 +%175 = OpImageFetch %10 %164 %174 Lod %170 +%176 = OpCompositeExtract %8 %175 0 +OpReturnValue %176 OpFunctionEnd -%184 = OpFunction %8 None %185 -%181 = OpFunctionParameter %12 -%182 = OpFunctionParameter %4 -%183 = OpFunctionParameter %4 -%180 = OpLabel -%186 = OpLoad %18 %39 -OpBranch %187 -%187 = OpLabel -%188 = OpCompositeConstruct %15 %181 %182 -%189 = OpImageQueryLevels %4 %186 -%190 = OpISub %4 %189 %59 -%191 = OpExtInst %4 %1 UMin %183 %190 -%192 = OpImageQuerySizeLod %15 %186 %191 -%194 = OpISub %15 %192 %193 -%195 = OpExtInst %15 %1 UMin %188 %194 -%196 = OpImageFetch %10 %186 %195 Lod %191 -%197 = OpCompositeExtract %8 %196 0 -OpReturnValue %197 +%181 = OpFunction %8 None %182 +%178 = OpFunctionParameter %12 +%179 = OpFunctionParameter %4 +%180 = OpFunctionParameter %4 +%177 = OpLabel +%183 = OpLoad %18 %36 +OpBranch %184 +%184 = OpLabel +%185 = OpCompositeConstruct %15 %178 %179 +%186 = OpImageQueryLevels %4 %183 +%187 = OpISub %4 %186 %56 +%188 = OpExtInst %4 %1 UMin %180 %187 +%189 = OpImageQuerySizeLod %15 %183 %188 +%191 = OpISub %15 %189 %190 +%192 = OpExtInst %15 %1 UMin %185 %191 +%193 = OpImageFetch %10 %183 %192 Lod %188 +%194 = OpCompositeExtract %8 %193 0 +OpReturnValue %194 OpFunctionEnd -%201 = OpFunction %8 None %149 -%199 = OpFunctionParameter %12 -%200 = OpFunctionParameter %4 -%198 = OpLabel -%202 = OpLoad %19 %41 -OpBranch %203 -%203 = OpLabel -%204 = OpImageQuerySamples %4 %202 -%205 = OpISub %4 %204 %59 -%206 = OpExtInst %4 %1 UMin %200 %205 -%207 = OpImageQuerySize %12 %202 -%209 = OpISub %12 %207 %208 -%210 = OpExtInst %12 %1 UMin %199 %209 -%211 = OpImageFetch %10 %202 %210 Sample %206 -%212 = OpCompositeExtract %8 %211 0 -OpReturnValue %212 +%198 = OpFunction %8 None %146 +%196 = OpFunctionParameter %12 +%197 = OpFunctionParameter %4 +%195 = OpLabel +%199 = OpLoad %19 %38 +OpBranch %200 +%200 = OpLabel +%201 = OpImageQuerySamples %4 %199 +%202 = OpISub %4 %201 %56 +%203 = OpExtInst %4 %1 UMin %197 %202 +%204 = OpImageQuerySize %12 %199 +%206 = OpISub %12 %204 %205 +%207 = OpExtInst %12 %1 UMin %196 %206 +%208 = OpImageFetch %10 %199 %207 Sample %203 +%209 = OpCompositeExtract %8 %208 0 +OpReturnValue %209 OpFunctionEnd -%216 = OpFunction %2 None %217 -%214 = OpFunctionParameter %4 -%215 = OpFunctionParameter %10 -%213 = OpLabel -%218 = OpLoad %20 %43 -OpBranch %219 -%219 = OpLabel -%220 = OpImageQuerySize %4 %218 -%221 = OpISub %4 %220 %59 -%222 = OpExtInst %4 %1 UMin %214 %221 -OpImageWrite %218 %222 %215 +%213 = OpFunction %2 None %214 +%211 = OpFunctionParameter %4 +%212 = OpFunctionParameter %10 +%210 = OpLabel +%215 = OpLoad %20 %40 +OpBranch %216 +%216 = OpLabel +%217 = OpImageQuerySize %4 %215 +%218 = OpISub %4 %217 %56 +%219 = OpExtInst %4 %1 UMin %211 %218 +OpImageWrite %215 %219 %212 OpReturn OpFunctionEnd -%226 = OpFunction %2 None %227 -%224 = OpFunctionParameter %12 -%225 = OpFunctionParameter %10 -%223 = OpLabel -%228 = OpLoad %21 %45 -OpBranch %229 -%229 = OpLabel -%230 = OpImageQuerySize %12 %228 -%232 = OpISub %12 %230 %231 -%233 = OpExtInst %12 %1 UMin %224 %232 -OpImageWrite %228 %233 %225 +%223 = OpFunction %2 None %224 +%221 = OpFunctionParameter %12 +%222 = OpFunctionParameter %10 +%220 = OpLabel +%225 = OpLoad %21 %42 +OpBranch %226 +%226 = OpLabel +%227 = OpImageQuerySize %12 %225 +%229 = OpISub %12 %227 %228 +%230 = OpExtInst %12 %1 UMin %221 %229 +OpImageWrite %225 %230 %222 OpReturn OpFunctionEnd -%238 = OpFunction %2 None %239 -%235 = OpFunctionParameter %12 -%236 = OpFunctionParameter %6 -%237 = OpFunctionParameter %10 -%234 = OpLabel -%240 = OpLoad %22 %47 -OpBranch %241 -%241 = OpLabel -%242 = OpBitcast %4 %236 -%243 = OpCompositeConstruct %15 %235 %242 -%244 = OpImageQuerySize %15 %240 -%246 = OpISub %15 %244 %245 -%247 = OpExtInst %15 %1 UMin %243 %246 -OpImageWrite %240 %247 %237 +%235 = OpFunction %2 None %236 +%232 = OpFunctionParameter %12 +%233 = OpFunctionParameter %6 +%234 = OpFunctionParameter %10 +%231 = OpLabel +%237 = OpLoad %22 %44 +OpBranch %238 +%238 = OpLabel +%239 = OpBitcast %4 %233 +%240 = OpCompositeConstruct %15 %232 %239 +%241 = OpImageQuerySize %15 %237 +%243 = OpISub %15 %241 %242 +%244 = OpExtInst %15 %1 UMin %240 %243 +OpImageWrite %237 %244 %234 OpReturn OpFunctionEnd -%252 = OpFunction %2 None %253 -%249 = OpFunctionParameter %12 -%250 = OpFunctionParameter %4 -%251 = OpFunctionParameter %10 -%248 = OpLabel -%254 = OpLoad %22 %47 -OpBranch %255 -%255 = OpLabel -%256 = OpCompositeConstruct %15 %249 %250 -%257 = OpImageQuerySize %15 %254 -%259 = OpISub %15 %257 %258 -%260 = OpExtInst %15 %1 UMin %256 %259 -OpImageWrite %254 %260 %251 +%249 = OpFunction %2 None %250 +%246 = OpFunctionParameter %12 +%247 = OpFunctionParameter %4 +%248 = OpFunctionParameter %10 +%245 = OpLabel +%251 = OpLoad %22 %44 +OpBranch %252 +%252 = OpLabel +%253 = OpCompositeConstruct %15 %246 %247 +%254 = OpImageQuerySize %15 %251 +%256 = OpISub %15 %254 %255 +%257 = OpExtInst %15 %1 UMin %253 %256 +OpImageWrite %251 %257 %248 OpReturn OpFunctionEnd -%264 = OpFunction %2 None %265 -%262 = OpFunctionParameter %15 -%263 = OpFunctionParameter %10 -%261 = OpLabel -%266 = OpLoad %23 %49 -OpBranch %267 -%267 = OpLabel -%268 = OpImageQuerySize %15 %266 -%270 = OpISub %15 %268 %269 -%271 = OpExtInst %15 %1 UMin %262 %270 -OpImageWrite %266 %271 %263 +%261 = OpFunction %2 None %262 +%259 = OpFunctionParameter %15 +%260 = OpFunctionParameter %10 +%258 = OpLabel +%263 = OpLoad %23 %46 +OpBranch %264 +%264 = OpLabel +%265 = OpImageQuerySize %15 %263 +%267 = OpISub %15 %265 %266 +%268 = OpExtInst %15 %1 UMin %259 %267 +OpImageWrite %263 %268 %260 OpReturn OpFunctionEnd -%275 = OpFunction %2 None %276 -%272 = OpLabel -%277 = OpLoad %9 %27 -%278 = OpLoad %11 %29 -%279 = OpLoad %13 %31 -%280 = OpLoad %14 %33 -%281 = OpLoad %16 %35 -%282 = OpLoad %20 %43 -%283 = OpLoad %21 %45 -%284 = OpLoad %22 %47 -%285 = OpLoad %23 %49 -OpBranch %286 -%286 = OpLabel -%287 = OpFunctionCall %10 %54 %3 %3 -%288 = OpFunctionCall %10 %69 %24 %3 -%289 = OpFunctionCall %10 %85 %24 %5 %3 -%290 = OpFunctionCall %10 %103 %24 %3 %3 -%291 = OpFunctionCall %10 %119 %25 %3 -%292 = OpFunctionCall %10 %134 %24 %3 -%293 = OpFunctionCall %2 %216 %3 %26 -%294 = OpFunctionCall %2 %226 %24 %26 -%295 = OpFunctionCall %2 %238 %24 %5 %26 -%296 = OpFunctionCall %2 %252 %24 %3 %26 -%297 = OpFunctionCall %2 %264 %25 %26 -%298 = OpCompositeConstruct %10 %7 %7 %7 %7 -OpStore %273 %298 +%272 = OpFunction %2 None %273 +%269 = OpLabel +%274 = OpLoad %9 %24 +%275 = OpLoad %11 %26 +%276 = OpLoad %13 %28 +%277 = OpLoad %14 %30 +%278 = OpLoad %16 %32 +%279 = OpLoad %20 %40 +%280 = OpLoad %21 %42 +%281 = OpLoad %22 %44 +%282 = OpLoad %23 %46 +OpBranch %297 +%297 = OpLabel +%298 = OpFunctionCall %10 %51 %3 %3 +%299 = OpFunctionCall %10 %66 %283 %3 +%300 = OpFunctionCall %10 %82 %284 %5 %3 +%301 = OpFunctionCall %10 %100 %285 %3 %3 +%302 = OpFunctionCall %10 %116 %286 %3 +%303 = OpFunctionCall %10 %131 %287 %3 +%304 = OpFunctionCall %2 %213 %3 %288 +%305 = OpFunctionCall %2 %223 %289 %290 +%306 = OpFunctionCall %2 %235 %291 %5 %292 +%307 = OpFunctionCall %2 %249 %293 %3 %294 +%308 = OpFunctionCall %2 %261 %295 %296 +%309 = OpCompositeConstruct %10 %7 %7 %7 %7 +OpStore %270 %309 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/bounds-check-image-rzsw.spvasm b/tests/out/spv/bounds-check-image-rzsw.spvasm index ce64a3dfc5..29a132a221 100644 --- a/tests/out/spv/bounds-check-image-rzsw.spvasm +++ b/tests/out/spv/bounds-check-image-rzsw.spvasm @@ -1,109 +1,109 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 336 +; Bound: 347 OpCapability ImageQuery OpCapability Image1D OpCapability Shader OpCapability Sampled1D %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %312 "fragment_shader" %310 -OpExecutionMode %312 OriginUpperLeft +OpEntryPoint Fragment %309 "fragment_shader" %307 +OpExecutionMode %309 OriginUpperLeft OpSource GLSL 450 -OpName %27 "image_1d" -OpName %29 "image_2d" -OpName %31 "image_2d_array" -OpName %33 "image_3d" -OpName %35 "image_multisampled_2d" -OpName %37 "image_depth_2d" -OpName %39 "image_depth_2d_array" -OpName %41 "image_depth_multisampled_2d" -OpName %43 "image_storage_1d" -OpName %45 "image_storage_2d" -OpName %47 "image_storage_2d_array" -OpName %49 "image_storage_3d" -OpName %52 "coords" -OpName %53 "level" -OpName %54 "test_textureLoad_1d" -OpName %70 "coords" -OpName %71 "level" -OpName %72 "test_textureLoad_2d" -OpName %89 "coords" -OpName %90 "index" -OpName %91 "level" -OpName %92 "test_textureLoad_2d_array_u" -OpName %111 "coords" -OpName %112 "index" -OpName %113 "level" -OpName %114 "test_textureLoad_2d_array_s" -OpName %131 "coords" -OpName %132 "level" -OpName %133 "test_textureLoad_3d" -OpName %149 "coords" -OpName %150 "_sample" -OpName %151 "test_textureLoad_multisampled_2d" -OpName %166 "coords" -OpName %167 "level" -OpName %168 "test_textureLoad_depth_2d" -OpName %185 "coords" -OpName %186 "index" -OpName %187 "level" -OpName %188 "test_textureLoad_depth_2d_array_u" -OpName %207 "coords" -OpName %208 "index" -OpName %209 "level" -OpName %210 "test_textureLoad_depth_2d_array_s" -OpName %228 "coords" -OpName %229 "_sample" -OpName %230 "test_textureLoad_depth_multisampled_2d" -OpName %246 "coords" -OpName %247 "value" -OpName %248 "test_textureStore_1d" -OpName %257 "coords" -OpName %258 "value" -OpName %259 "test_textureStore_2d" -OpName %269 "coords" -OpName %270 "array_index" -OpName %271 "value" -OpName %272 "test_textureStore_2d_array_u" -OpName %284 "coords" -OpName %285 "array_index" -OpName %286 "value" -OpName %287 "test_textureStore_2d_array_s" -OpName %298 "coords" -OpName %299 "value" -OpName %300 "test_textureStore_3d" -OpName %312 "fragment_shader" -OpDecorate %27 DescriptorSet 0 -OpDecorate %27 Binding 0 -OpDecorate %29 DescriptorSet 0 -OpDecorate %29 Binding 1 -OpDecorate %31 DescriptorSet 0 -OpDecorate %31 Binding 2 -OpDecorate %33 DescriptorSet 0 -OpDecorate %33 Binding 3 -OpDecorate %35 DescriptorSet 0 -OpDecorate %35 Binding 4 -OpDecorate %37 DescriptorSet 0 -OpDecorate %37 Binding 5 -OpDecorate %39 DescriptorSet 0 -OpDecorate %39 Binding 6 -OpDecorate %41 DescriptorSet 0 -OpDecorate %41 Binding 7 -OpDecorate %43 NonReadable -OpDecorate %43 DescriptorSet 0 -OpDecorate %43 Binding 8 -OpDecorate %45 NonReadable -OpDecorate %45 DescriptorSet 0 -OpDecorate %45 Binding 9 -OpDecorate %47 NonReadable -OpDecorate %47 DescriptorSet 0 -OpDecorate %47 Binding 10 -OpDecorate %49 NonReadable -OpDecorate %49 DescriptorSet 0 -OpDecorate %49 Binding 11 -OpDecorate %310 Location 0 +OpName %24 "image_1d" +OpName %26 "image_2d" +OpName %28 "image_2d_array" +OpName %30 "image_3d" +OpName %32 "image_multisampled_2d" +OpName %34 "image_depth_2d" +OpName %36 "image_depth_2d_array" +OpName %38 "image_depth_multisampled_2d" +OpName %40 "image_storage_1d" +OpName %42 "image_storage_2d" +OpName %44 "image_storage_2d_array" +OpName %46 "image_storage_3d" +OpName %49 "coords" +OpName %50 "level" +OpName %51 "test_textureLoad_1d" +OpName %67 "coords" +OpName %68 "level" +OpName %69 "test_textureLoad_2d" +OpName %86 "coords" +OpName %87 "index" +OpName %88 "level" +OpName %89 "test_textureLoad_2d_array_u" +OpName %108 "coords" +OpName %109 "index" +OpName %110 "level" +OpName %111 "test_textureLoad_2d_array_s" +OpName %128 "coords" +OpName %129 "level" +OpName %130 "test_textureLoad_3d" +OpName %146 "coords" +OpName %147 "_sample" +OpName %148 "test_textureLoad_multisampled_2d" +OpName %163 "coords" +OpName %164 "level" +OpName %165 "test_textureLoad_depth_2d" +OpName %182 "coords" +OpName %183 "index" +OpName %184 "level" +OpName %185 "test_textureLoad_depth_2d_array_u" +OpName %204 "coords" +OpName %205 "index" +OpName %206 "level" +OpName %207 "test_textureLoad_depth_2d_array_s" +OpName %225 "coords" +OpName %226 "_sample" +OpName %227 "test_textureLoad_depth_multisampled_2d" +OpName %243 "coords" +OpName %244 "value" +OpName %245 "test_textureStore_1d" +OpName %254 "coords" +OpName %255 "value" +OpName %256 "test_textureStore_2d" +OpName %266 "coords" +OpName %267 "array_index" +OpName %268 "value" +OpName %269 "test_textureStore_2d_array_u" +OpName %281 "coords" +OpName %282 "array_index" +OpName %283 "value" +OpName %284 "test_textureStore_2d_array_s" +OpName %295 "coords" +OpName %296 "value" +OpName %297 "test_textureStore_3d" +OpName %309 "fragment_shader" +OpDecorate %24 DescriptorSet 0 +OpDecorate %24 Binding 0 +OpDecorate %26 DescriptorSet 0 +OpDecorate %26 Binding 1 +OpDecorate %28 DescriptorSet 0 +OpDecorate %28 Binding 2 +OpDecorate %30 DescriptorSet 0 +OpDecorate %30 Binding 3 +OpDecorate %32 DescriptorSet 0 +OpDecorate %32 Binding 4 +OpDecorate %34 DescriptorSet 0 +OpDecorate %34 Binding 5 +OpDecorate %36 DescriptorSet 0 +OpDecorate %36 Binding 6 +OpDecorate %38 DescriptorSet 0 +OpDecorate %38 Binding 7 +OpDecorate %40 NonReadable +OpDecorate %40 DescriptorSet 0 +OpDecorate %40 Binding 8 +OpDecorate %42 NonReadable +OpDecorate %42 DescriptorSet 0 +OpDecorate %42 Binding 9 +OpDecorate %44 NonReadable +OpDecorate %44 DescriptorSet 0 +OpDecorate %44 Binding 10 +OpDecorate %46 NonReadable +OpDecorate %46 DescriptorSet 0 +OpDecorate %46 Binding 11 +OpDecorate %307 Location 0 %2 = OpTypeVoid %4 = OpTypeInt 32 1 %3 = OpConstant %4 0 @@ -126,424 +126,435 @@ OpDecorate %310 Location 0 %21 = OpTypeImage %8 2D 0 0 0 2 Rgba8 %22 = OpTypeImage %8 2D 0 1 0 2 Rgba8 %23 = OpTypeImage %8 3D 0 0 0 2 Rgba8 -%24 = OpConstantComposite %12 %3 %3 -%25 = OpConstantComposite %15 %3 %3 %3 -%26 = OpConstantComposite %10 %7 %7 %7 %7 -%28 = OpTypePointer UniformConstant %9 -%27 = OpVariable %28 UniformConstant -%30 = OpTypePointer UniformConstant %11 -%29 = OpVariable %30 UniformConstant -%32 = OpTypePointer UniformConstant %13 -%31 = OpVariable %32 UniformConstant -%34 = OpTypePointer UniformConstant %14 -%33 = OpVariable %34 UniformConstant -%36 = OpTypePointer UniformConstant %16 -%35 = OpVariable %36 UniformConstant -%38 = OpTypePointer UniformConstant %17 -%37 = OpVariable %38 UniformConstant -%40 = OpTypePointer UniformConstant %18 -%39 = OpVariable %40 UniformConstant -%42 = OpTypePointer UniformConstant %19 -%41 = OpVariable %42 UniformConstant -%44 = OpTypePointer UniformConstant %20 -%43 = OpVariable %44 UniformConstant -%46 = OpTypePointer UniformConstant %21 -%45 = OpVariable %46 UniformConstant -%48 = OpTypePointer UniformConstant %22 -%47 = OpVariable %48 UniformConstant -%50 = OpTypePointer UniformConstant %23 -%49 = OpVariable %50 UniformConstant -%55 = OpTypeFunction %10 %4 %4 -%58 = OpTypeBool -%59 = OpConstantNull %10 -%73 = OpTypeFunction %10 %12 %4 -%76 = OpConstantNull %10 -%82 = OpTypeVector %58 2 -%93 = OpTypeFunction %10 %12 %6 %4 -%98 = OpConstantNull %10 -%104 = OpTypeVector %58 3 -%115 = OpTypeFunction %10 %12 %4 %4 -%119 = OpConstantNull %10 -%134 = OpTypeFunction %10 %15 %4 -%137 = OpConstantNull %10 -%154 = OpConstantNull %10 -%169 = OpTypeFunction %8 %12 %4 -%172 = OpConstantNull %10 -%189 = OpTypeFunction %8 %12 %6 %4 -%194 = OpConstantNull %10 -%211 = OpTypeFunction %8 %12 %4 %4 -%215 = OpConstantNull %10 -%233 = OpConstantNull %10 -%249 = OpTypeFunction %2 %4 %10 -%260 = OpTypeFunction %2 %12 %10 -%273 = OpTypeFunction %2 %12 %6 %10 -%288 = OpTypeFunction %2 %12 %4 %10 -%301 = OpTypeFunction %2 %15 %10 -%311 = OpTypePointer Output %10 -%310 = OpVariable %311 Output -%313 = OpTypeFunction %2 -%54 = OpFunction %10 None %55 -%52 = OpFunctionParameter %4 -%53 = OpFunctionParameter %4 -%51 = OpLabel -%56 = OpLoad %9 %27 -OpBranch %57 -%57 = OpLabel -%60 = OpImageQueryLevels %4 %56 -%61 = OpULessThan %58 %53 %60 -OpSelectionMerge %62 None -OpBranchConditional %61 %63 %62 +%25 = OpTypePointer UniformConstant %9 +%24 = OpVariable %25 UniformConstant +%27 = OpTypePointer UniformConstant %11 +%26 = OpVariable %27 UniformConstant +%29 = OpTypePointer UniformConstant %13 +%28 = OpVariable %29 UniformConstant +%31 = OpTypePointer UniformConstant %14 +%30 = OpVariable %31 UniformConstant +%33 = OpTypePointer UniformConstant %16 +%32 = OpVariable %33 UniformConstant +%35 = OpTypePointer UniformConstant %17 +%34 = OpVariable %35 UniformConstant +%37 = OpTypePointer UniformConstant %18 +%36 = OpVariable %37 UniformConstant +%39 = OpTypePointer UniformConstant %19 +%38 = OpVariable %39 UniformConstant +%41 = OpTypePointer UniformConstant %20 +%40 = OpVariable %41 UniformConstant +%43 = OpTypePointer UniformConstant %21 +%42 = OpVariable %43 UniformConstant +%45 = OpTypePointer UniformConstant %22 +%44 = OpVariable %45 UniformConstant +%47 = OpTypePointer UniformConstant %23 +%46 = OpVariable %47 UniformConstant +%52 = OpTypeFunction %10 %4 %4 +%55 = OpTypeBool +%56 = OpConstantNull %10 +%70 = OpTypeFunction %10 %12 %4 +%73 = OpConstantNull %10 +%79 = OpTypeVector %55 2 +%90 = OpTypeFunction %10 %12 %6 %4 +%95 = OpConstantNull %10 +%101 = OpTypeVector %55 3 +%112 = OpTypeFunction %10 %12 %4 %4 +%116 = OpConstantNull %10 +%131 = OpTypeFunction %10 %15 %4 +%134 = OpConstantNull %10 +%151 = OpConstantNull %10 +%166 = OpTypeFunction %8 %12 %4 +%169 = OpConstantNull %10 +%186 = OpTypeFunction %8 %12 %6 %4 +%191 = OpConstantNull %10 +%208 = OpTypeFunction %8 %12 %4 %4 +%212 = OpConstantNull %10 +%230 = OpConstantNull %10 +%246 = OpTypeFunction %2 %4 %10 +%257 = OpTypeFunction %2 %12 %10 +%270 = OpTypeFunction %2 %12 %6 %10 +%285 = OpTypeFunction %2 %12 %4 %10 +%298 = OpTypeFunction %2 %15 %10 +%308 = OpTypePointer Output %10 +%307 = OpVariable %308 Output +%310 = OpTypeFunction %2 +%320 = OpConstantNull %12 +%321 = OpConstantNull %12 +%322 = OpConstantNull %12 +%323 = OpConstantNull %15 +%324 = OpConstantNull %12 +%325 = OpConstantNull %10 +%326 = OpConstantNull %12 +%327 = OpConstantNull %10 +%328 = OpConstantNull %12 +%329 = OpConstantNull %10 +%330 = OpConstantNull %12 +%331 = OpConstantNull %10 +%332 = OpConstantNull %15 +%333 = OpConstantNull %10 +%51 = OpFunction %10 None %52 +%49 = OpFunctionParameter %4 +%50 = OpFunctionParameter %4 +%48 = OpLabel +%53 = OpLoad %9 %24 +OpBranch %54 +%54 = OpLabel +%57 = OpImageQueryLevels %4 %53 +%58 = OpULessThan %55 %50 %57 +OpSelectionMerge %59 None +OpBranchConditional %58 %60 %59 +%60 = OpLabel +%61 = OpImageQuerySizeLod %4 %53 %50 +%62 = OpULessThan %55 %49 %61 +OpBranchConditional %62 %63 %59 %63 = OpLabel -%64 = OpImageQuerySizeLod %4 %56 %53 -%65 = OpULessThan %58 %52 %64 -OpBranchConditional %65 %66 %62 +%64 = OpImageFetch %10 %53 %49 Lod %50 +OpBranch %59 +%59 = OpLabel +%65 = OpPhi %10 %56 %54 %56 %60 %64 %63 +OpReturnValue %65 +OpFunctionEnd +%69 = OpFunction %10 None %70 +%67 = OpFunctionParameter %12 +%68 = OpFunctionParameter %4 %66 = OpLabel -%67 = OpImageFetch %10 %56 %52 Lod %53 -OpBranch %62 -%62 = OpLabel -%68 = OpPhi %10 %59 %57 %59 %63 %67 %66 -OpReturnValue %68 +%71 = OpLoad %11 %26 +OpBranch %72 +%72 = OpLabel +%74 = OpImageQueryLevels %4 %71 +%75 = OpULessThan %55 %68 %74 +OpSelectionMerge %76 None +OpBranchConditional %75 %77 %76 +%77 = OpLabel +%78 = OpImageQuerySizeLod %12 %71 %68 +%80 = OpULessThan %79 %67 %78 +%81 = OpAll %55 %80 +OpBranchConditional %81 %82 %76 +%82 = OpLabel +%83 = OpImageFetch %10 %71 %67 Lod %68 +OpBranch %76 +%76 = OpLabel +%84 = OpPhi %10 %73 %72 %73 %77 %83 %82 +OpReturnValue %84 OpFunctionEnd -%72 = OpFunction %10 None %73 -%70 = OpFunctionParameter %12 -%71 = OpFunctionParameter %4 -%69 = OpLabel -%74 = OpLoad %11 %29 -OpBranch %75 -%75 = OpLabel -%77 = OpImageQueryLevels %4 %74 -%78 = OpULessThan %58 %71 %77 -OpSelectionMerge %79 None -OpBranchConditional %78 %80 %79 -%80 = OpLabel -%81 = OpImageQuerySizeLod %12 %74 %71 -%83 = OpULessThan %82 %70 %81 -%84 = OpAll %58 %83 -OpBranchConditional %84 %85 %79 +%89 = OpFunction %10 None %90 +%86 = OpFunctionParameter %12 +%87 = OpFunctionParameter %6 +%88 = OpFunctionParameter %4 %85 = OpLabel -%86 = OpImageFetch %10 %74 %70 Lod %71 -OpBranch %79 -%79 = OpLabel -%87 = OpPhi %10 %76 %75 %76 %80 %86 %85 -OpReturnValue %87 +%91 = OpLoad %13 %28 +OpBranch %92 +%92 = OpLabel +%93 = OpBitcast %4 %87 +%94 = OpCompositeConstruct %15 %86 %93 +%96 = OpImageQueryLevels %4 %91 +%97 = OpULessThan %55 %88 %96 +OpSelectionMerge %98 None +OpBranchConditional %97 %99 %98 +%99 = OpLabel +%100 = OpImageQuerySizeLod %15 %91 %88 +%102 = OpULessThan %101 %94 %100 +%103 = OpAll %55 %102 +OpBranchConditional %103 %104 %98 +%104 = OpLabel +%105 = OpImageFetch %10 %91 %94 Lod %88 +OpBranch %98 +%98 = OpLabel +%106 = OpPhi %10 %95 %92 %95 %99 %105 %104 +OpReturnValue %106 OpFunctionEnd -%92 = OpFunction %10 None %93 -%89 = OpFunctionParameter %12 -%90 = OpFunctionParameter %6 -%91 = OpFunctionParameter %4 -%88 = OpLabel -%94 = OpLoad %13 %31 -OpBranch %95 -%95 = OpLabel -%96 = OpBitcast %4 %90 -%97 = OpCompositeConstruct %15 %89 %96 -%99 = OpImageQueryLevels %4 %94 -%100 = OpULessThan %58 %91 %99 -OpSelectionMerge %101 None -OpBranchConditional %100 %102 %101 -%102 = OpLabel -%103 = OpImageQuerySizeLod %15 %94 %91 -%105 = OpULessThan %104 %97 %103 -%106 = OpAll %58 %105 -OpBranchConditional %106 %107 %101 +%111 = OpFunction %10 None %112 +%108 = OpFunctionParameter %12 +%109 = OpFunctionParameter %4 +%110 = OpFunctionParameter %4 %107 = OpLabel -%108 = OpImageFetch %10 %94 %97 Lod %91 -OpBranch %101 -%101 = OpLabel -%109 = OpPhi %10 %98 %95 %98 %102 %108 %107 -OpReturnValue %109 +%113 = OpLoad %13 %28 +OpBranch %114 +%114 = OpLabel +%115 = OpCompositeConstruct %15 %108 %109 +%117 = OpImageQueryLevels %4 %113 +%118 = OpULessThan %55 %110 %117 +OpSelectionMerge %119 None +OpBranchConditional %118 %120 %119 +%120 = OpLabel +%121 = OpImageQuerySizeLod %15 %113 %110 +%122 = OpULessThan %101 %115 %121 +%123 = OpAll %55 %122 +OpBranchConditional %123 %124 %119 +%124 = OpLabel +%125 = OpImageFetch %10 %113 %115 Lod %110 +OpBranch %119 +%119 = OpLabel +%126 = OpPhi %10 %116 %114 %116 %120 %125 %124 +OpReturnValue %126 OpFunctionEnd -%114 = OpFunction %10 None %115 -%111 = OpFunctionParameter %12 -%112 = OpFunctionParameter %4 -%113 = OpFunctionParameter %4 -%110 = OpLabel -%116 = OpLoad %13 %31 -OpBranch %117 -%117 = OpLabel -%118 = OpCompositeConstruct %15 %111 %112 -%120 = OpImageQueryLevels %4 %116 -%121 = OpULessThan %58 %113 %120 -OpSelectionMerge %122 None -OpBranchConditional %121 %123 %122 -%123 = OpLabel -%124 = OpImageQuerySizeLod %15 %116 %113 -%125 = OpULessThan %104 %118 %124 -%126 = OpAll %58 %125 -OpBranchConditional %126 %127 %122 +%130 = OpFunction %10 None %131 +%128 = OpFunctionParameter %15 +%129 = OpFunctionParameter %4 %127 = OpLabel -%128 = OpImageFetch %10 %116 %118 Lod %113 -OpBranch %122 -%122 = OpLabel -%129 = OpPhi %10 %119 %117 %119 %123 %128 %127 -OpReturnValue %129 +%132 = OpLoad %14 %30 +OpBranch %133 +%133 = OpLabel +%135 = OpImageQueryLevels %4 %132 +%136 = OpULessThan %55 %129 %135 +OpSelectionMerge %137 None +OpBranchConditional %136 %138 %137 +%138 = OpLabel +%139 = OpImageQuerySizeLod %15 %132 %129 +%140 = OpULessThan %101 %128 %139 +%141 = OpAll %55 %140 +OpBranchConditional %141 %142 %137 +%142 = OpLabel +%143 = OpImageFetch %10 %132 %128 Lod %129 +OpBranch %137 +%137 = OpLabel +%144 = OpPhi %10 %134 %133 %134 %138 %143 %142 +OpReturnValue %144 OpFunctionEnd -%133 = OpFunction %10 None %134 -%131 = OpFunctionParameter %15 -%132 = OpFunctionParameter %4 -%130 = OpLabel -%135 = OpLoad %14 %33 -OpBranch %136 -%136 = OpLabel -%138 = OpImageQueryLevels %4 %135 -%139 = OpULessThan %58 %132 %138 -OpSelectionMerge %140 None -OpBranchConditional %139 %141 %140 -%141 = OpLabel -%142 = OpImageQuerySizeLod %15 %135 %132 -%143 = OpULessThan %104 %131 %142 -%144 = OpAll %58 %143 -OpBranchConditional %144 %145 %140 +%148 = OpFunction %10 None %70 +%146 = OpFunctionParameter %12 +%147 = OpFunctionParameter %4 %145 = OpLabel -%146 = OpImageFetch %10 %135 %131 Lod %132 -OpBranch %140 -%140 = OpLabel -%147 = OpPhi %10 %137 %136 %137 %141 %146 %145 -OpReturnValue %147 +%149 = OpLoad %16 %32 +OpBranch %150 +%150 = OpLabel +%152 = OpImageQuerySamples %4 %149 +%153 = OpULessThan %55 %147 %152 +OpSelectionMerge %154 None +OpBranchConditional %153 %155 %154 +%155 = OpLabel +%156 = OpImageQuerySize %12 %149 +%157 = OpULessThan %79 %146 %156 +%158 = OpAll %55 %157 +OpBranchConditional %158 %159 %154 +%159 = OpLabel +%160 = OpImageFetch %10 %149 %146 Sample %147 +OpBranch %154 +%154 = OpLabel +%161 = OpPhi %10 %151 %150 %151 %155 %160 %159 +OpReturnValue %161 OpFunctionEnd -%151 = OpFunction %10 None %73 -%149 = OpFunctionParameter %12 -%150 = OpFunctionParameter %4 -%148 = OpLabel -%152 = OpLoad %16 %35 -OpBranch %153 -%153 = OpLabel -%155 = OpImageQuerySamples %4 %152 -%156 = OpULessThan %58 %150 %155 -OpSelectionMerge %157 None -OpBranchConditional %156 %158 %157 -%158 = OpLabel -%159 = OpImageQuerySize %12 %152 -%160 = OpULessThan %82 %149 %159 -%161 = OpAll %58 %160 -OpBranchConditional %161 %162 %157 +%165 = OpFunction %8 None %166 +%163 = OpFunctionParameter %12 +%164 = OpFunctionParameter %4 %162 = OpLabel -%163 = OpImageFetch %10 %152 %149 Sample %150 -OpBranch %157 -%157 = OpLabel -%164 = OpPhi %10 %154 %153 %154 %158 %163 %162 -OpReturnValue %164 -OpFunctionEnd -%168 = OpFunction %8 None %169 -%166 = OpFunctionParameter %12 -%167 = OpFunctionParameter %4 -%165 = OpLabel -%170 = OpLoad %17 %37 -OpBranch %171 -%171 = OpLabel -%173 = OpImageQueryLevels %4 %170 -%174 = OpULessThan %58 %167 %173 -OpSelectionMerge %175 None -OpBranchConditional %174 %176 %175 -%176 = OpLabel -%177 = OpImageQuerySizeLod %12 %170 %167 -%178 = OpULessThan %82 %166 %177 -%179 = OpAll %58 %178 -OpBranchConditional %179 %180 %175 -%180 = OpLabel -%181 = OpImageFetch %10 %170 %166 Lod %167 -OpBranch %175 -%175 = OpLabel -%182 = OpPhi %10 %172 %171 %172 %176 %181 %180 -%183 = OpCompositeExtract %8 %182 0 -OpReturnValue %183 +%167 = OpLoad %17 %34 +OpBranch %168 +%168 = OpLabel +%170 = OpImageQueryLevels %4 %167 +%171 = OpULessThan %55 %164 %170 +OpSelectionMerge %172 None +OpBranchConditional %171 %173 %172 +%173 = OpLabel +%174 = OpImageQuerySizeLod %12 %167 %164 +%175 = OpULessThan %79 %163 %174 +%176 = OpAll %55 %175 +OpBranchConditional %176 %177 %172 +%177 = OpLabel +%178 = OpImageFetch %10 %167 %163 Lod %164 +OpBranch %172 +%172 = OpLabel +%179 = OpPhi %10 %169 %168 %169 %173 %178 %177 +%180 = OpCompositeExtract %8 %179 0 +OpReturnValue %180 OpFunctionEnd -%188 = OpFunction %8 None %189 -%185 = OpFunctionParameter %12 -%186 = OpFunctionParameter %6 -%187 = OpFunctionParameter %4 -%184 = OpLabel -%190 = OpLoad %18 %39 -OpBranch %191 -%191 = OpLabel -%192 = OpBitcast %4 %186 -%193 = OpCompositeConstruct %15 %185 %192 -%195 = OpImageQueryLevels %4 %190 -%196 = OpULessThan %58 %187 %195 -OpSelectionMerge %197 None -OpBranchConditional %196 %198 %197 -%198 = OpLabel -%199 = OpImageQuerySizeLod %15 %190 %187 -%200 = OpULessThan %104 %193 %199 -%201 = OpAll %58 %200 -OpBranchConditional %201 %202 %197 -%202 = OpLabel -%203 = OpImageFetch %10 %190 %193 Lod %187 -OpBranch %197 -%197 = OpLabel -%204 = OpPhi %10 %194 %191 %194 %198 %203 %202 -%205 = OpCompositeExtract %8 %204 0 -OpReturnValue %205 +%185 = OpFunction %8 None %186 +%182 = OpFunctionParameter %12 +%183 = OpFunctionParameter %6 +%184 = OpFunctionParameter %4 +%181 = OpLabel +%187 = OpLoad %18 %36 +OpBranch %188 +%188 = OpLabel +%189 = OpBitcast %4 %183 +%190 = OpCompositeConstruct %15 %182 %189 +%192 = OpImageQueryLevels %4 %187 +%193 = OpULessThan %55 %184 %192 +OpSelectionMerge %194 None +OpBranchConditional %193 %195 %194 +%195 = OpLabel +%196 = OpImageQuerySizeLod %15 %187 %184 +%197 = OpULessThan %101 %190 %196 +%198 = OpAll %55 %197 +OpBranchConditional %198 %199 %194 +%199 = OpLabel +%200 = OpImageFetch %10 %187 %190 Lod %184 +OpBranch %194 +%194 = OpLabel +%201 = OpPhi %10 %191 %188 %191 %195 %200 %199 +%202 = OpCompositeExtract %8 %201 0 +OpReturnValue %202 OpFunctionEnd -%210 = OpFunction %8 None %211 -%207 = OpFunctionParameter %12 -%208 = OpFunctionParameter %4 -%209 = OpFunctionParameter %4 -%206 = OpLabel -%212 = OpLoad %18 %39 -OpBranch %213 -%213 = OpLabel -%214 = OpCompositeConstruct %15 %207 %208 -%216 = OpImageQueryLevels %4 %212 -%217 = OpULessThan %58 %209 %216 -OpSelectionMerge %218 None -OpBranchConditional %217 %219 %218 -%219 = OpLabel -%220 = OpImageQuerySizeLod %15 %212 %209 -%221 = OpULessThan %104 %214 %220 -%222 = OpAll %58 %221 -OpBranchConditional %222 %223 %218 -%223 = OpLabel -%224 = OpImageFetch %10 %212 %214 Lod %209 -OpBranch %218 -%218 = OpLabel -%225 = OpPhi %10 %215 %213 %215 %219 %224 %223 -%226 = OpCompositeExtract %8 %225 0 -OpReturnValue %226 +%207 = OpFunction %8 None %208 +%204 = OpFunctionParameter %12 +%205 = OpFunctionParameter %4 +%206 = OpFunctionParameter %4 +%203 = OpLabel +%209 = OpLoad %18 %36 +OpBranch %210 +%210 = OpLabel +%211 = OpCompositeConstruct %15 %204 %205 +%213 = OpImageQueryLevels %4 %209 +%214 = OpULessThan %55 %206 %213 +OpSelectionMerge %215 None +OpBranchConditional %214 %216 %215 +%216 = OpLabel +%217 = OpImageQuerySizeLod %15 %209 %206 +%218 = OpULessThan %101 %211 %217 +%219 = OpAll %55 %218 +OpBranchConditional %219 %220 %215 +%220 = OpLabel +%221 = OpImageFetch %10 %209 %211 Lod %206 +OpBranch %215 +%215 = OpLabel +%222 = OpPhi %10 %212 %210 %212 %216 %221 %220 +%223 = OpCompositeExtract %8 %222 0 +OpReturnValue %223 OpFunctionEnd -%230 = OpFunction %8 None %169 -%228 = OpFunctionParameter %12 -%229 = OpFunctionParameter %4 -%227 = OpLabel -%231 = OpLoad %19 %41 -OpBranch %232 -%232 = OpLabel -%234 = OpImageQuerySamples %4 %231 -%235 = OpULessThan %58 %229 %234 -OpSelectionMerge %236 None -OpBranchConditional %235 %237 %236 -%237 = OpLabel -%238 = OpImageQuerySize %12 %231 -%239 = OpULessThan %82 %228 %238 -%240 = OpAll %58 %239 -OpBranchConditional %240 %241 %236 -%241 = OpLabel -%242 = OpImageFetch %10 %231 %228 Sample %229 -OpBranch %236 -%236 = OpLabel -%243 = OpPhi %10 %233 %232 %233 %237 %242 %241 -%244 = OpCompositeExtract %8 %243 0 -OpReturnValue %244 +%227 = OpFunction %8 None %166 +%225 = OpFunctionParameter %12 +%226 = OpFunctionParameter %4 +%224 = OpLabel +%228 = OpLoad %19 %38 +OpBranch %229 +%229 = OpLabel +%231 = OpImageQuerySamples %4 %228 +%232 = OpULessThan %55 %226 %231 +OpSelectionMerge %233 None +OpBranchConditional %232 %234 %233 +%234 = OpLabel +%235 = OpImageQuerySize %12 %228 +%236 = OpULessThan %79 %225 %235 +%237 = OpAll %55 %236 +OpBranchConditional %237 %238 %233 +%238 = OpLabel +%239 = OpImageFetch %10 %228 %225 Sample %226 +OpBranch %233 +%233 = OpLabel +%240 = OpPhi %10 %230 %229 %230 %234 %239 %238 +%241 = OpCompositeExtract %8 %240 0 +OpReturnValue %241 OpFunctionEnd -%248 = OpFunction %2 None %249 -%246 = OpFunctionParameter %4 -%247 = OpFunctionParameter %10 -%245 = OpLabel -%250 = OpLoad %20 %43 +%245 = OpFunction %2 None %246 +%243 = OpFunctionParameter %4 +%244 = OpFunctionParameter %10 +%242 = OpLabel +%247 = OpLoad %20 %40 +OpBranch %248 +%248 = OpLabel +%249 = OpImageQuerySize %4 %247 +%250 = OpULessThan %55 %243 %249 +OpSelectionMerge %251 None +OpBranchConditional %250 %252 %251 +%252 = OpLabel +OpImageWrite %247 %243 %244 OpBranch %251 %251 = OpLabel -%252 = OpImageQuerySize %4 %250 -%253 = OpULessThan %58 %246 %252 -OpSelectionMerge %254 None -OpBranchConditional %253 %255 %254 -%255 = OpLabel -OpImageWrite %250 %246 %247 -OpBranch %254 -%254 = OpLabel OpReturn OpFunctionEnd -%259 = OpFunction %2 None %260 -%257 = OpFunctionParameter %12 -%258 = OpFunctionParameter %10 -%256 = OpLabel -%261 = OpLoad %21 %45 -OpBranch %262 -%262 = OpLabel -%263 = OpImageQuerySize %12 %261 -%264 = OpULessThan %82 %257 %263 -%265 = OpAll %58 %264 -OpSelectionMerge %266 None -OpBranchConditional %265 %267 %266 -%267 = OpLabel -OpImageWrite %261 %257 %258 -OpBranch %266 -%266 = OpLabel +%256 = OpFunction %2 None %257 +%254 = OpFunctionParameter %12 +%255 = OpFunctionParameter %10 +%253 = OpLabel +%258 = OpLoad %21 %42 +OpBranch %259 +%259 = OpLabel +%260 = OpImageQuerySize %12 %258 +%261 = OpULessThan %79 %254 %260 +%262 = OpAll %55 %261 +OpSelectionMerge %263 None +OpBranchConditional %262 %264 %263 +%264 = OpLabel +OpImageWrite %258 %254 %255 +OpBranch %263 +%263 = OpLabel OpReturn OpFunctionEnd -%272 = OpFunction %2 None %273 -%269 = OpFunctionParameter %12 -%270 = OpFunctionParameter %6 -%271 = OpFunctionParameter %10 -%268 = OpLabel -%274 = OpLoad %22 %47 -OpBranch %275 -%275 = OpLabel -%276 = OpBitcast %4 %270 -%277 = OpCompositeConstruct %15 %269 %276 -%278 = OpImageQuerySize %15 %274 -%279 = OpULessThan %104 %277 %278 -%280 = OpAll %58 %279 -OpSelectionMerge %281 None -OpBranchConditional %280 %282 %281 -%282 = OpLabel -OpImageWrite %274 %277 %271 -OpBranch %281 -%281 = OpLabel +%269 = OpFunction %2 None %270 +%266 = OpFunctionParameter %12 +%267 = OpFunctionParameter %6 +%268 = OpFunctionParameter %10 +%265 = OpLabel +%271 = OpLoad %22 %44 +OpBranch %272 +%272 = OpLabel +%273 = OpBitcast %4 %267 +%274 = OpCompositeConstruct %15 %266 %273 +%275 = OpImageQuerySize %15 %271 +%276 = OpULessThan %101 %274 %275 +%277 = OpAll %55 %276 +OpSelectionMerge %278 None +OpBranchConditional %277 %279 %278 +%279 = OpLabel +OpImageWrite %271 %274 %268 +OpBranch %278 +%278 = OpLabel OpReturn OpFunctionEnd -%287 = OpFunction %2 None %288 -%284 = OpFunctionParameter %12 -%285 = OpFunctionParameter %4 -%286 = OpFunctionParameter %10 -%283 = OpLabel -%289 = OpLoad %22 %47 -OpBranch %290 -%290 = OpLabel -%291 = OpCompositeConstruct %15 %284 %285 -%292 = OpImageQuerySize %15 %289 -%293 = OpULessThan %104 %291 %292 -%294 = OpAll %58 %293 -OpSelectionMerge %295 None -OpBranchConditional %294 %296 %295 -%296 = OpLabel -OpImageWrite %289 %291 %286 -OpBranch %295 -%295 = OpLabel +%284 = OpFunction %2 None %285 +%281 = OpFunctionParameter %12 +%282 = OpFunctionParameter %4 +%283 = OpFunctionParameter %10 +%280 = OpLabel +%286 = OpLoad %22 %44 +OpBranch %287 +%287 = OpLabel +%288 = OpCompositeConstruct %15 %281 %282 +%289 = OpImageQuerySize %15 %286 +%290 = OpULessThan %101 %288 %289 +%291 = OpAll %55 %290 +OpSelectionMerge %292 None +OpBranchConditional %291 %293 %292 +%293 = OpLabel +OpImageWrite %286 %288 %283 +OpBranch %292 +%292 = OpLabel OpReturn OpFunctionEnd -%300 = OpFunction %2 None %301 -%298 = OpFunctionParameter %15 -%299 = OpFunctionParameter %10 -%297 = OpLabel -%302 = OpLoad %23 %49 -OpBranch %303 -%303 = OpLabel -%304 = OpImageQuerySize %15 %302 -%305 = OpULessThan %104 %298 %304 -%306 = OpAll %58 %305 -OpSelectionMerge %307 None -OpBranchConditional %306 %308 %307 -%308 = OpLabel -OpImageWrite %302 %298 %299 -OpBranch %307 -%307 = OpLabel +%297 = OpFunction %2 None %298 +%295 = OpFunctionParameter %15 +%296 = OpFunctionParameter %10 +%294 = OpLabel +%299 = OpLoad %23 %46 +OpBranch %300 +%300 = OpLabel +%301 = OpImageQuerySize %15 %299 +%302 = OpULessThan %101 %295 %301 +%303 = OpAll %55 %302 +OpSelectionMerge %304 None +OpBranchConditional %303 %305 %304 +%305 = OpLabel +OpImageWrite %299 %295 %296 +OpBranch %304 +%304 = OpLabel OpReturn OpFunctionEnd -%312 = OpFunction %2 None %313 -%309 = OpLabel -%314 = OpLoad %9 %27 -%315 = OpLoad %11 %29 -%316 = OpLoad %13 %31 -%317 = OpLoad %14 %33 -%318 = OpLoad %16 %35 -%319 = OpLoad %20 %43 -%320 = OpLoad %21 %45 -%321 = OpLoad %22 %47 -%322 = OpLoad %23 %49 -OpBranch %323 -%323 = OpLabel -%324 = OpFunctionCall %10 %54 %3 %3 -%325 = OpFunctionCall %10 %72 %24 %3 -%326 = OpFunctionCall %10 %92 %24 %5 %3 -%327 = OpFunctionCall %10 %114 %24 %3 %3 -%328 = OpFunctionCall %10 %133 %25 %3 -%329 = OpFunctionCall %10 %151 %24 %3 -%330 = OpFunctionCall %2 %248 %3 %26 -%331 = OpFunctionCall %2 %259 %24 %26 -%332 = OpFunctionCall %2 %272 %24 %5 %26 -%333 = OpFunctionCall %2 %287 %24 %3 %26 -%334 = OpFunctionCall %2 %300 %25 %26 -%335 = OpCompositeConstruct %10 %7 %7 %7 %7 -OpStore %310 %335 +%309 = OpFunction %2 None %310 +%306 = OpLabel +%311 = OpLoad %9 %24 +%312 = OpLoad %11 %26 +%313 = OpLoad %13 %28 +%314 = OpLoad %14 %30 +%315 = OpLoad %16 %32 +%316 = OpLoad %20 %40 +%317 = OpLoad %21 %42 +%318 = OpLoad %22 %44 +%319 = OpLoad %23 %46 +OpBranch %334 +%334 = OpLabel +%335 = OpFunctionCall %10 %51 %3 %3 +%336 = OpFunctionCall %10 %69 %320 %3 +%337 = OpFunctionCall %10 %89 %321 %5 %3 +%338 = OpFunctionCall %10 %111 %322 %3 %3 +%339 = OpFunctionCall %10 %130 %323 %3 +%340 = OpFunctionCall %10 %148 %324 %3 +%341 = OpFunctionCall %2 %245 %3 %325 +%342 = OpFunctionCall %2 %256 %326 %327 +%343 = OpFunctionCall %2 %269 %328 %5 %329 +%344 = OpFunctionCall %2 %284 %330 %3 %331 +%345 = OpFunctionCall %2 %297 %332 %333 +%346 = OpCompositeConstruct %10 %7 %7 %7 %7 +OpStore %307 %346 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/globals.spvasm b/tests/out/spv/globals.spvasm index a69852e7e4..5b801db0fb 100644 --- a/tests/out/spv/globals.spvasm +++ b/tests/out/spv/globals.spvasm @@ -1,54 +1,54 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 186 +; Bound: 185 OpCapability Shader OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %111 "main" %129 -OpExecutionMode %111 LocalSize 1 1 1 -OpDecorate %25 ArrayStride 4 -OpMemberDecorate %27 0 Offset 0 -OpMemberDecorate %27 1 Offset 12 -OpDecorate %29 ArrayStride 8 -OpDecorate %31 ArrayStride 16 -OpDecorate %34 ArrayStride 32 -OpDecorate %35 ArrayStride 64 -OpDecorate %37 ArrayStride 32 -OpDecorate %38 ArrayStride 64 +OpEntryPoint GLCompute %110 "main" %128 +OpExecutionMode %110 LocalSize 1 1 1 +OpDecorate %24 ArrayStride 4 +OpMemberDecorate %26 0 Offset 0 +OpMemberDecorate %26 1 Offset 12 +OpDecorate %28 ArrayStride 8 +OpDecorate %30 ArrayStride 16 +OpDecorate %33 ArrayStride 32 +OpDecorate %34 ArrayStride 64 +OpDecorate %36 ArrayStride 32 +OpDecorate %37 ArrayStride 64 +OpDecorate %43 DescriptorSet 0 +OpDecorate %43 Binding 1 +OpDecorate %44 Block +OpMemberDecorate %44 0 Offset 0 +OpDecorate %46 NonWritable OpDecorate %46 DescriptorSet 0 -OpDecorate %46 Binding 1 +OpDecorate %46 Binding 2 OpDecorate %47 Block OpMemberDecorate %47 0 Offset 0 -OpDecorate %49 NonWritable OpDecorate %49 DescriptorSet 0 -OpDecorate %49 Binding 2 +OpDecorate %49 Binding 3 OpDecorate %50 Block OpMemberDecorate %50 0 Offset 0 OpDecorate %52 DescriptorSet 0 -OpDecorate %52 Binding 3 +OpDecorate %52 Binding 4 OpDecorate %53 Block OpMemberDecorate %53 0 Offset 0 OpDecorate %55 DescriptorSet 0 -OpDecorate %55 Binding 4 +OpDecorate %55 Binding 5 OpDecorate %56 Block OpMemberDecorate %56 0 Offset 0 +OpMemberDecorate %56 0 ColMajor +OpMemberDecorate %56 0 MatrixStride 8 OpDecorate %58 DescriptorSet 0 -OpDecorate %58 Binding 5 +OpDecorate %58 Binding 6 OpDecorate %59 Block OpMemberDecorate %59 0 Offset 0 -OpMemberDecorate %59 0 ColMajor -OpMemberDecorate %59 0 MatrixStride 8 OpDecorate %61 DescriptorSet 0 -OpDecorate %61 Binding 6 +OpDecorate %61 Binding 7 OpDecorate %62 Block OpMemberDecorate %62 0 Offset 0 -OpDecorate %64 DescriptorSet 0 -OpDecorate %64 Binding 7 -OpDecorate %65 Block -OpMemberDecorate %65 0 Offset 0 -OpDecorate %129 BuiltIn LocalInvocationId +OpDecorate %128 BuiltIn LocalInvocationId %2 = OpTypeVoid %4 = OpTypeBool %3 = OpConstantTrue %4 @@ -63,205 +63,204 @@ OpDecorate %129 BuiltIn LocalInvocationId %13 = OpConstant %8 0 %14 = OpConstant %11 2.0 %15 = OpConstant %11 3.0 -%16 = OpConstant %11 0.0 -%17 = OpConstant %8 7 -%18 = OpConstant %8 6 -%19 = OpConstant %8 5 -%20 = OpConstant %8 4 -%21 = OpConstant %8 3 -%22 = OpConstant %11 4.0 -%23 = OpConstant %6 2 -%24 = OpConstantTrue %4 -%25 = OpTypeArray %11 %5 -%26 = OpTypeVector %11 3 -%27 = OpTypeStruct %26 %11 -%28 = OpTypeVector %11 2 -%29 = OpTypeRuntimeArray %28 -%30 = OpTypeVector %11 4 -%31 = OpTypeArray %30 %7 -%32 = OpTypeMatrix %28 3 -%33 = OpTypeMatrix %30 2 +%16 = OpConstant %8 7 +%17 = OpConstant %8 6 +%18 = OpConstant %8 5 +%19 = OpConstant %8 4 +%20 = OpConstant %8 3 +%21 = OpConstant %11 4.0 +%22 = OpConstant %6 2 +%23 = OpConstantTrue %4 +%24 = OpTypeArray %11 %5 +%25 = OpTypeVector %11 3 +%26 = OpTypeStruct %25 %11 +%27 = OpTypeVector %11 2 +%28 = OpTypeRuntimeArray %27 +%29 = OpTypeVector %11 4 +%30 = OpTypeArray %29 %7 +%31 = OpTypeMatrix %27 3 +%32 = OpTypeMatrix %29 2 +%33 = OpTypeArray %32 %9 %34 = OpTypeArray %33 %9 -%35 = OpTypeArray %34 %9 -%36 = OpTypeMatrix %28 4 +%35 = OpTypeMatrix %27 4 +%36 = OpTypeArray %35 %9 %37 = OpTypeArray %36 %9 -%38 = OpTypeArray %37 %9 -%39 = OpTypeMatrix %26 3 -%40 = OpConstantComposite %26 %16 %16 %16 -%41 = OpConstantComposite %39 %40 %40 %40 -%43 = OpTypePointer Workgroup %25 -%42 = OpVariable %43 Workgroup -%45 = OpTypePointer Workgroup %6 -%44 = OpVariable %45 Workgroup -%47 = OpTypeStruct %27 +%38 = OpTypeMatrix %25 3 +%40 = OpTypePointer Workgroup %24 +%39 = OpVariable %40 Workgroup +%42 = OpTypePointer Workgroup %6 +%41 = OpVariable %42 Workgroup +%44 = OpTypeStruct %26 +%45 = OpTypePointer StorageBuffer %44 +%43 = OpVariable %45 StorageBuffer +%47 = OpTypeStruct %28 %48 = OpTypePointer StorageBuffer %47 %46 = OpVariable %48 StorageBuffer -%50 = OpTypeStruct %29 -%51 = OpTypePointer StorageBuffer %50 -%49 = OpVariable %51 StorageBuffer -%53 = OpTypeStruct %31 +%50 = OpTypeStruct %30 +%51 = OpTypePointer Uniform %50 +%49 = OpVariable %51 Uniform +%53 = OpTypeStruct %25 %54 = OpTypePointer Uniform %53 %52 = OpVariable %54 Uniform -%56 = OpTypeStruct %26 +%56 = OpTypeStruct %31 %57 = OpTypePointer Uniform %56 %55 = OpVariable %57 Uniform -%59 = OpTypeStruct %32 +%59 = OpTypeStruct %34 %60 = OpTypePointer Uniform %59 %58 = OpVariable %60 Uniform -%62 = OpTypeStruct %35 +%62 = OpTypeStruct %37 %63 = OpTypePointer Uniform %62 %61 = OpVariable %63 Uniform -%65 = OpTypeStruct %38 -%66 = OpTypePointer Uniform %65 -%64 = OpVariable %66 Uniform -%70 = OpTypeFunction %2 %26 -%73 = OpTypePointer Function %8 -%74 = OpConstantNull %8 -%77 = OpTypeFunction %2 -%78 = OpTypePointer StorageBuffer %27 -%79 = OpConstant %6 0 -%82 = OpTypePointer StorageBuffer %26 -%85 = OpTypePointer StorageBuffer %11 -%105 = OpTypePointer Function %11 -%106 = OpConstantNull %11 -%108 = OpTypePointer Function %4 -%109 = OpConstantNull %4 -%113 = OpTypePointer StorageBuffer %29 -%115 = OpTypePointer Uniform %31 -%117 = OpTypePointer Uniform %26 -%119 = OpTypePointer Uniform %32 -%121 = OpTypePointer Uniform %35 -%123 = OpTypePointer Uniform %38 -%126 = OpConstantNull %25 -%127 = OpConstantNull %6 -%128 = OpTypeVector %6 3 -%130 = OpTypePointer Input %128 -%129 = OpVariable %130 Input -%132 = OpConstantNull %128 -%133 = OpTypeVector %4 3 -%138 = OpConstant %6 264 -%141 = OpTypePointer Workgroup %11 -%142 = OpTypePointer Uniform %37 -%143 = OpTypePointer Uniform %36 -%146 = OpTypePointer Uniform %34 -%147 = OpTypePointer Uniform %33 -%148 = OpTypePointer Uniform %30 -%153 = OpConstant %6 7 -%159 = OpConstant %6 6 -%161 = OpTypePointer StorageBuffer %28 -%162 = OpConstant %6 1 -%165 = OpConstant %6 5 -%167 = OpTypePointer Uniform %30 -%168 = OpTypePointer Uniform %11 -%169 = OpConstant %6 3 -%172 = OpConstant %6 4 -%174 = OpTypePointer StorageBuffer %11 -%185 = OpConstant %6 256 -%69 = OpFunction %2 None %70 -%68 = OpFunctionParameter %26 -%67 = OpLabel -OpBranch %71 -%71 = OpLabel +%67 = OpTypeFunction %2 %25 +%70 = OpTypePointer Function %8 +%71 = OpConstantNull %8 +%74 = OpTypeFunction %2 +%75 = OpTypePointer StorageBuffer %26 +%76 = OpConstant %6 0 +%78 = OpConstantNull %38 +%79 = OpConstantNull %38 +%81 = OpTypePointer StorageBuffer %25 +%84 = OpTypePointer StorageBuffer %11 +%104 = OpTypePointer Function %11 +%105 = OpConstantNull %11 +%107 = OpTypePointer Function %4 +%108 = OpConstantNull %4 +%112 = OpTypePointer StorageBuffer %28 +%114 = OpTypePointer Uniform %30 +%116 = OpTypePointer Uniform %25 +%118 = OpTypePointer Uniform %31 +%120 = OpTypePointer Uniform %34 +%122 = OpTypePointer Uniform %37 +%125 = OpConstantNull %24 +%126 = OpConstantNull %6 +%127 = OpTypeVector %6 3 +%129 = OpTypePointer Input %127 +%128 = OpVariable %129 Input +%131 = OpConstantNull %127 +%132 = OpTypeVector %4 3 +%137 = OpConstant %6 264 +%140 = OpTypePointer Workgroup %11 +%141 = OpTypePointer Uniform %36 +%142 = OpTypePointer Uniform %35 +%145 = OpTypePointer Uniform %33 +%146 = OpTypePointer Uniform %32 +%147 = OpTypePointer Uniform %29 +%152 = OpConstant %6 7 +%158 = OpConstant %6 6 +%160 = OpTypePointer StorageBuffer %27 +%161 = OpConstant %6 1 +%164 = OpConstant %6 5 +%166 = OpTypePointer Uniform %29 +%167 = OpTypePointer Uniform %11 +%168 = OpConstant %6 3 +%171 = OpConstant %6 4 +%173 = OpTypePointer StorageBuffer %11 +%184 = OpConstant %6 256 +%66 = OpFunction %2 None %67 +%65 = OpFunctionParameter %25 +%64 = OpLabel +OpBranch %68 +%68 = OpLabel OpReturn OpFunctionEnd -%76 = OpFunction %2 None %77 -%75 = OpLabel -%72 = OpVariable %73 Function %74 -%80 = OpAccessChain %78 %46 %79 -OpBranch %81 -%81 = OpLabel -%83 = OpCompositeConstruct %26 %10 %10 %10 -%84 = OpAccessChain %82 %80 %79 -OpStore %84 %83 -OpStore %72 %12 -%86 = OpAccessChain %85 %80 %79 %79 -OpStore %86 %10 -%87 = OpAccessChain %85 %80 %79 %79 -OpStore %87 %14 -%88 = OpLoad %8 %72 -%89 = OpAccessChain %85 %80 %79 %88 -OpStore %89 %15 -%90 = OpLoad %27 %80 -%91 = OpCompositeExtract %26 %90 0 -%92 = OpCompositeExtract %26 %90 0 -%93 = OpVectorShuffle %28 %92 %92 2 0 -%94 = OpCompositeExtract %26 %90 0 -%95 = OpFunctionCall %2 %69 %94 -%96 = OpCompositeExtract %26 %90 0 -%97 = OpVectorTimesMatrix %26 %96 %41 -%98 = OpCompositeExtract %26 %90 0 -%99 = OpMatrixTimesVector %26 %41 %98 -%100 = OpCompositeExtract %26 %90 0 -%101 = OpVectorTimesScalar %26 %100 %14 -%102 = OpCompositeExtract %26 %90 0 -%103 = OpVectorTimesScalar %26 %102 %14 +%73 = OpFunction %2 None %74 +%72 = OpLabel +%69 = OpVariable %70 Function %71 +%77 = OpAccessChain %75 %43 %76 +OpBranch %80 +%80 = OpLabel +%82 = OpCompositeConstruct %25 %10 %10 %10 +%83 = OpAccessChain %81 %77 %76 +OpStore %83 %82 +OpStore %69 %12 +%85 = OpAccessChain %84 %77 %76 %76 +OpStore %85 %10 +%86 = OpAccessChain %84 %77 %76 %76 +OpStore %86 %14 +%87 = OpLoad %8 %69 +%88 = OpAccessChain %84 %77 %76 %87 +OpStore %88 %15 +%89 = OpLoad %26 %77 +%90 = OpCompositeExtract %25 %89 0 +%91 = OpCompositeExtract %25 %89 0 +%92 = OpVectorShuffle %27 %91 %91 2 0 +%93 = OpCompositeExtract %25 %89 0 +%94 = OpFunctionCall %2 %66 %93 +%95 = OpCompositeExtract %25 %89 0 +%96 = OpVectorTimesMatrix %25 %95 %78 +%97 = OpCompositeExtract %25 %89 0 +%98 = OpMatrixTimesVector %25 %79 %97 +%99 = OpCompositeExtract %25 %89 0 +%100 = OpVectorTimesScalar %25 %99 %14 +%101 = OpCompositeExtract %25 %89 0 +%102 = OpVectorTimesScalar %25 %101 %14 OpReturn OpFunctionEnd -%111 = OpFunction %2 None %77 -%110 = OpLabel -%104 = OpVariable %105 Function %106 -%107 = OpVariable %108 Function %109 -%112 = OpAccessChain %78 %46 %79 -%114 = OpAccessChain %113 %49 %79 -%116 = OpAccessChain %115 %52 %79 -%118 = OpAccessChain %117 %55 %79 -%120 = OpAccessChain %119 %58 %79 -%122 = OpAccessChain %121 %61 %79 -%124 = OpAccessChain %123 %64 %79 -OpBranch %125 -%125 = OpLabel -%131 = OpLoad %128 %129 -%134 = OpIEqual %133 %131 %132 -%135 = OpAll %4 %134 -OpSelectionMerge %136 None -OpBranchConditional %135 %137 %136 -%137 = OpLabel -OpStore %42 %126 -OpStore %44 %127 -OpBranch %136 +%110 = OpFunction %2 None %74 +%109 = OpLabel +%103 = OpVariable %104 Function %105 +%106 = OpVariable %107 Function %108 +%111 = OpAccessChain %75 %43 %76 +%113 = OpAccessChain %112 %46 %76 +%115 = OpAccessChain %114 %49 %76 +%117 = OpAccessChain %116 %52 %76 +%119 = OpAccessChain %118 %55 %76 +%121 = OpAccessChain %120 %58 %76 +%123 = OpAccessChain %122 %61 %76 +OpBranch %124 +%124 = OpLabel +%130 = OpLoad %127 %128 +%133 = OpIEqual %132 %130 %131 +%134 = OpAll %4 %133 +OpSelectionMerge %135 None +OpBranchConditional %134 %136 %135 %136 = OpLabel -OpControlBarrier %23 %23 %138 -OpBranch %139 -%139 = OpLabel -%140 = OpFunctionCall %2 %76 -%144 = OpAccessChain %143 %124 %79 %79 -%145 = OpLoad %36 %144 -%149 = OpAccessChain %148 %122 %79 %79 %79 -%150 = OpLoad %30 %149 -%151 = OpMatrixTimesVector %28 %145 %150 -%152 = OpCompositeExtract %11 %151 0 -%154 = OpAccessChain %141 %42 %153 -OpStore %154 %152 -%155 = OpLoad %32 %120 -%156 = OpLoad %26 %118 -%157 = OpMatrixTimesVector %28 %155 %156 -%158 = OpCompositeExtract %11 %157 0 -%160 = OpAccessChain %141 %42 %159 -OpStore %160 %158 -%163 = OpAccessChain %85 %114 %162 %162 -%164 = OpLoad %11 %163 -%166 = OpAccessChain %141 %42 %165 -OpStore %166 %164 -%170 = OpAccessChain %168 %116 %79 %169 -%171 = OpLoad %11 %170 -%173 = OpAccessChain %141 %42 %172 -OpStore %173 %171 -%175 = OpAccessChain %174 %112 %162 -%176 = OpLoad %11 %175 -%177 = OpAccessChain %141 %42 %169 -OpStore %177 %176 -%178 = OpAccessChain %85 %112 %79 %79 -%179 = OpLoad %11 %178 -%180 = OpAccessChain %141 %42 %23 -OpStore %180 %179 -%181 = OpAccessChain %174 %112 %162 -OpStore %181 %22 -%182 = OpArrayLength %6 %49 0 -%183 = OpConvertUToF %11 %182 -%184 = OpAccessChain %141 %42 %162 -OpStore %184 %183 -OpAtomicStore %44 %9 %185 %23 -OpStore %104 %10 -OpStore %107 %24 +OpStore %39 %125 +OpStore %41 %126 +OpBranch %135 +%135 = OpLabel +OpControlBarrier %22 %22 %137 +OpBranch %138 +%138 = OpLabel +%139 = OpFunctionCall %2 %73 +%143 = OpAccessChain %142 %123 %76 %76 +%144 = OpLoad %35 %143 +%148 = OpAccessChain %147 %121 %76 %76 %76 +%149 = OpLoad %29 %148 +%150 = OpMatrixTimesVector %27 %144 %149 +%151 = OpCompositeExtract %11 %150 0 +%153 = OpAccessChain %140 %39 %152 +OpStore %153 %151 +%154 = OpLoad %31 %119 +%155 = OpLoad %25 %117 +%156 = OpMatrixTimesVector %27 %154 %155 +%157 = OpCompositeExtract %11 %156 0 +%159 = OpAccessChain %140 %39 %158 +OpStore %159 %157 +%162 = OpAccessChain %84 %113 %161 %161 +%163 = OpLoad %11 %162 +%165 = OpAccessChain %140 %39 %164 +OpStore %165 %163 +%169 = OpAccessChain %167 %115 %76 %168 +%170 = OpLoad %11 %169 +%172 = OpAccessChain %140 %39 %171 +OpStore %172 %170 +%174 = OpAccessChain %173 %111 %161 +%175 = OpLoad %11 %174 +%176 = OpAccessChain %140 %39 %168 +OpStore %176 %175 +%177 = OpAccessChain %84 %111 %76 %76 +%178 = OpLoad %11 %177 +%179 = OpAccessChain %140 %39 %22 +OpStore %179 %178 +%180 = OpAccessChain %173 %111 %161 +OpStore %180 %21 +%181 = OpArrayLength %6 %46 0 +%182 = OpConvertUToF %11 %181 +%183 = OpAccessChain %140 %39 %161 +OpStore %183 %182 +OpAtomicStore %41 %9 %184 %22 +OpStore %103 %10 +OpStore %106 %23 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/math-functions.spvasm b/tests/out/spv/math-functions.spvasm index 8dc763c0d3..ecf925bdd7 100644 --- a/tests/out/spv/math-functions.spvasm +++ b/tests/out/spv/math-functions.spvasm @@ -1,97 +1,98 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 87 +; Bound: 88 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %18 "main" -OpExecutionMode %18 OriginUpperLeft +OpEntryPoint Fragment %17 "main" +OpExecutionMode %17 OriginUpperLeft %2 = OpTypeVoid %4 = OpTypeFloat 32 %3 = OpConstant %4 1.0 %5 = OpConstant %4 0.0 -%7 = OpTypeInt 32 1 +%7 = OpTypeInt 32 0 %6 = OpConstant %7 0 -%9 = OpTypeInt 32 0 -%8 = OpConstant %9 0 -%10 = OpConstant %7 -1 -%11 = OpConstant %9 1 -%12 = OpConstant %9 4294967295 -%13 = OpConstant %7 1 +%9 = OpTypeInt 32 1 +%8 = OpConstant %9 -1 +%10 = OpConstant %7 1 +%11 = OpConstant %9 0 +%12 = OpConstant %7 4294967295 +%13 = OpConstant %9 1 %14 = OpTypeVector %4 4 -%15 = OpTypeVector %7 2 -%16 = OpConstantComposite %15 %6 %6 -%19 = OpTypeFunction %2 -%27 = OpConstantComposite %14 %5 %5 %5 %5 -%28 = OpConstantComposite %14 %3 %3 %3 %3 -%31 = OpConstantNull %7 -%44 = OpTypeVector %9 2 -%54 = OpConstant %9 32 -%64 = OpConstantComposite %44 %54 %54 -%76 = OpConstant %7 31 -%82 = OpConstantComposite %15 %76 %76 -%18 = OpFunction %2 None %19 -%17 = OpLabel -OpBranch %20 -%20 = OpLabel -%21 = OpCompositeConstruct %14 %5 %5 %5 %5 -%22 = OpExtInst %4 %1 Degrees %3 -%23 = OpExtInst %4 %1 Radians %3 -%24 = OpExtInst %14 %1 Degrees %21 -%25 = OpExtInst %14 %1 Radians %21 -%26 = OpExtInst %14 %1 FClamp %21 %27 %28 -%29 = OpExtInst %14 %1 Refract %21 %21 %3 -%32 = OpCompositeExtract %7 %16 0 -%33 = OpCompositeExtract %7 %16 0 -%34 = OpIMul %7 %32 %33 -%35 = OpIAdd %7 %31 %34 -%36 = OpCompositeExtract %7 %16 1 -%37 = OpCompositeExtract %7 %16 1 -%38 = OpIMul %7 %36 %37 -%30 = OpIAdd %7 %35 %38 -%39 = OpCopyObject %9 %8 -%40 = OpExtInst %9 %1 FindUMsb %39 -%41 = OpExtInst %7 %1 FindSMsb %10 -%42 = OpCompositeConstruct %15 %10 %10 -%43 = OpExtInst %15 %1 FindSMsb %42 -%45 = OpCompositeConstruct %44 %11 %11 -%46 = OpExtInst %44 %1 FindUMsb %45 -%47 = OpExtInst %7 %1 FindILsb %10 -%48 = OpExtInst %9 %1 FindILsb %11 -%49 = OpCompositeConstruct %15 %10 %10 -%50 = OpExtInst %15 %1 FindILsb %49 -%51 = OpCompositeConstruct %44 %11 %11 -%52 = OpExtInst %44 %1 FindILsb %51 -%55 = OpExtInst %9 %1 FindILsb %8 -%53 = OpExtInst %9 %1 UMin %54 %55 -%57 = OpExtInst %7 %1 FindILsb %6 -%56 = OpExtInst %7 %1 UMin %54 %57 -%59 = OpExtInst %9 %1 FindILsb %12 -%58 = OpExtInst %9 %1 UMin %54 %59 -%61 = OpExtInst %7 %1 FindILsb %10 -%60 = OpExtInst %7 %1 UMin %54 %61 -%62 = OpCompositeConstruct %44 %8 %8 -%65 = OpExtInst %44 %1 FindILsb %62 -%63 = OpExtInst %44 %1 UMin %64 %65 -%66 = OpCompositeConstruct %15 %6 %6 -%68 = OpExtInst %15 %1 FindILsb %66 -%67 = OpExtInst %15 %1 UMin %64 %68 -%69 = OpCompositeConstruct %44 %11 %11 -%71 = OpExtInst %44 %1 FindILsb %69 -%70 = OpExtInst %44 %1 UMin %64 %71 -%72 = OpCompositeConstruct %15 %13 %13 -%74 = OpExtInst %15 %1 FindILsb %72 -%73 = OpExtInst %15 %1 UMin %64 %74 -%77 = OpExtInst %7 %1 FindUMsb %10 -%75 = OpISub %7 %76 %77 -%79 = OpExtInst %7 %1 FindUMsb %11 -%78 = OpISub %9 %76 %79 -%80 = OpCompositeConstruct %15 %10 %10 -%83 = OpExtInst %15 %1 FindUMsb %80 -%81 = OpISub %15 %82 %83 -%84 = OpCompositeConstruct %44 %11 %11 -%86 = OpExtInst %15 %1 FindUMsb %84 -%85 = OpISub %44 %82 %86 +%15 = OpTypeVector %9 2 +%18 = OpTypeFunction %2 +%19 = OpConstantNull %15 +%20 = OpConstantNull %15 +%28 = OpConstantComposite %14 %5 %5 %5 %5 +%29 = OpConstantComposite %14 %3 %3 %3 %3 +%32 = OpConstantNull %9 +%45 = OpTypeVector %7 2 +%55 = OpConstant %7 32 +%65 = OpConstantComposite %45 %55 %55 +%77 = OpConstant %9 31 +%83 = OpConstantComposite %15 %77 %77 +%17 = OpFunction %2 None %18 +%16 = OpLabel +OpBranch %21 +%21 = OpLabel +%22 = OpCompositeConstruct %14 %5 %5 %5 %5 +%23 = OpExtInst %4 %1 Degrees %3 +%24 = OpExtInst %4 %1 Radians %3 +%25 = OpExtInst %14 %1 Degrees %22 +%26 = OpExtInst %14 %1 Radians %22 +%27 = OpExtInst %14 %1 FClamp %22 %28 %29 +%30 = OpExtInst %14 %1 Refract %22 %22 %3 +%33 = OpCompositeExtract %9 %19 0 +%34 = OpCompositeExtract %9 %20 0 +%35 = OpIMul %9 %33 %34 +%36 = OpIAdd %9 %32 %35 +%37 = OpCompositeExtract %9 %19 1 +%38 = OpCompositeExtract %9 %20 1 +%39 = OpIMul %9 %37 %38 +%31 = OpIAdd %9 %36 %39 +%40 = OpCopyObject %7 %6 +%41 = OpExtInst %7 %1 FindUMsb %40 +%42 = OpExtInst %9 %1 FindSMsb %8 +%43 = OpCompositeConstruct %15 %8 %8 +%44 = OpExtInst %15 %1 FindSMsb %43 +%46 = OpCompositeConstruct %45 %10 %10 +%47 = OpExtInst %45 %1 FindUMsb %46 +%48 = OpExtInst %9 %1 FindILsb %8 +%49 = OpExtInst %7 %1 FindILsb %10 +%50 = OpCompositeConstruct %15 %8 %8 +%51 = OpExtInst %15 %1 FindILsb %50 +%52 = OpCompositeConstruct %45 %10 %10 +%53 = OpExtInst %45 %1 FindILsb %52 +%56 = OpExtInst %7 %1 FindILsb %6 +%54 = OpExtInst %7 %1 UMin %55 %56 +%58 = OpExtInst %9 %1 FindILsb %11 +%57 = OpExtInst %9 %1 UMin %55 %58 +%60 = OpExtInst %7 %1 FindILsb %12 +%59 = OpExtInst %7 %1 UMin %55 %60 +%62 = OpExtInst %9 %1 FindILsb %8 +%61 = OpExtInst %9 %1 UMin %55 %62 +%63 = OpCompositeConstruct %45 %6 %6 +%66 = OpExtInst %45 %1 FindILsb %63 +%64 = OpExtInst %45 %1 UMin %65 %66 +%67 = OpCompositeConstruct %15 %11 %11 +%69 = OpExtInst %15 %1 FindILsb %67 +%68 = OpExtInst %15 %1 UMin %65 %69 +%70 = OpCompositeConstruct %45 %10 %10 +%72 = OpExtInst %45 %1 FindILsb %70 +%71 = OpExtInst %45 %1 UMin %65 %72 +%73 = OpCompositeConstruct %15 %13 %13 +%75 = OpExtInst %15 %1 FindILsb %73 +%74 = OpExtInst %15 %1 UMin %65 %75 +%78 = OpExtInst %9 %1 FindUMsb %8 +%76 = OpISub %9 %77 %78 +%80 = OpExtInst %9 %1 FindUMsb %10 +%79 = OpISub %7 %77 %80 +%81 = OpCompositeConstruct %15 %8 %8 +%84 = OpExtInst %15 %1 FindUMsb %81 +%82 = OpISub %15 %83 %84 +%85 = OpCompositeConstruct %45 %10 %10 +%87 = OpExtInst %15 %1 FindUMsb %85 +%86 = OpISub %45 %83 %87 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/operators.spvasm b/tests/out/spv/operators.spvasm index d3c595e67e..64a2ed2f45 100644 --- a/tests/out/spv/operators.spvasm +++ b/tests/out/spv/operators.spvasm @@ -1,12 +1,12 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 573 +; Bound: 588 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %561 "main" -OpExecutionMode %561 LocalSize 1 1 1 +OpEntryPoint GLCompute %576 "main" +OpExecutionMode %576 LocalSize 1 1 1 OpMemberDecorate %40 0 Offset 0 OpMemberDecorate %40 1 Offset 16 OpDecorate %44 ArrayStride 32 @@ -28,13 +28,13 @@ OpDecorate %45 ArrayStride 4 %16 = OpConstant %4 4.0 %17 = OpConstant %8 5 %18 = OpConstant %8 2 -%20 = OpTypeInt 32 0 -%19 = OpConstant %20 0 -%21 = OpConstant %8 3 -%22 = OpConstant %20 4 +%19 = OpConstant %8 3 +%21 = OpTypeInt 32 0 +%20 = OpConstant %21 0 +%22 = OpConstant %21 4 %23 = OpConstant %4 -1.0 -%24 = OpConstant %20 2 -%25 = OpConstant %20 1 +%24 = OpConstant %21 2 +%25 = OpConstant %21 1 %26 = OpConstant %8 -1 %27 = OpConstant %8 -2 %28 = OpConstant %8 -3 @@ -52,8 +52,8 @@ OpDecorate %45 ArrayStride 4 %40 = OpTypeStruct %34 %8 %41 = OpTypeMatrix %37 2 %42 = OpTypeMatrix %34 4 -%43 = OpTypeVector %20 2 -%44 = OpTypeArray %40 %21 +%43 = OpTypeVector %21 2 +%44 = OpTypeArray %40 %19 %45 = OpTypeArray %8 %22 %46 = OpTypeMatrix %38 2 %47 = OpTypeMatrix %38 3 @@ -64,572 +64,587 @@ OpDecorate %45 ArrayStride 4 %52 = OpConstantComposite %34 %5 %5 %5 %5 %53 = OpConstantComposite %34 %6 %6 %6 %6 %54 = OpConstantComposite %35 %7 %7 %7 %7 -%55 = OpConstantComposite %43 %19 %19 -%56 = OpConstantComposite %37 %5 %5 -%57 = OpConstantComposite %41 %56 %56 -%58 = OpConstantComposite %34 %5 %5 %5 %5 -%59 = OpConstantComposite %40 %58 %11 -%60 = OpConstantComposite %44 %59 %59 %59 -%61 = OpConstantComposite %38 %5 %5 %5 -%62 = OpConstantComposite %46 %61 %61 -%63 = OpConstantComposite %47 %61 %61 %61 -%64 = OpConstantComposite %48 %61 %61 %61 %61 -%65 = OpConstantComposite %49 %58 %58 %58 -%66 = OpConstantComposite %50 %11 %11 %11 -%69 = OpTypeFunction %34 -%109 = OpTypePointer Function %37 -%110 = OpConstantNull %37 -%113 = OpTypeFunction %37 -%129 = OpTypeFunction %38 %38 -%131 = OpConstantComposite %38 %5 %5 %5 -%133 = OpConstantComposite %38 %3 %3 %3 -%136 = OpTypePointer Function %40 -%137 = OpConstantNull %40 -%140 = OpTypeFunction %4 -%165 = OpTypePointer Function %34 -%166 = OpTypePointer Function %4 -%171 = OpTypeFunction %2 -%174 = OpTypeVector %10 2 -%190 = OpTypeVector %8 2 -%201 = OpTypeVector %20 3 -%496 = OpTypePointer Function %8 -%497 = OpConstantNull %8 -%499 = OpTypePointer Function %50 -%500 = OpConstantNull %50 -%530 = OpTypePointer Function %8 -%68 = OpFunction %34 None %69 -%67 = OpLabel -OpBranch %70 -%70 = OpLabel -%71 = OpSelect %8 %9 %7 %11 -%73 = OpCompositeConstruct %36 %9 %9 %9 %9 -%72 = OpSelect %34 %73 %51 %52 -%74 = OpCompositeConstruct %36 %12 %12 %12 %12 -%75 = OpSelect %34 %74 %52 %51 -%76 = OpExtInst %34 %1 FMix %52 %51 %53 -%78 = OpCompositeConstruct %34 %13 %13 %13 %13 -%77 = OpExtInst %34 %1 FMix %52 %51 %78 -%79 = OpCompositeExtract %8 %54 0 -%80 = OpBitcast %4 %79 -%81 = OpBitcast %34 %54 -%82 = OpConvertFToS %35 %52 -%83 = OpCompositeConstruct %35 %71 %71 %71 %71 -%84 = OpIAdd %35 %83 %82 -%85 = OpConvertSToF %34 %84 -%86 = OpFAdd %34 %85 %72 -%87 = OpFAdd %34 %86 %76 -%88 = OpFAdd %34 %87 %77 -%89 = OpCompositeConstruct %34 %80 %80 %80 %80 -%90 = OpFAdd %34 %88 %89 -%91 = OpFAdd %34 %90 %81 -OpReturnValue %91 +%57 = OpTypeFunction %34 +%97 = OpTypePointer Function %37 +%98 = OpConstantNull %37 +%101 = OpTypeFunction %37 +%117 = OpTypeFunction %38 %38 +%119 = OpConstantComposite %38 %5 %5 %5 +%121 = OpConstantComposite %38 %3 %3 %3 +%124 = OpTypePointer Function %40 +%125 = OpConstantNull %40 +%128 = OpTypeFunction %4 +%129 = OpConstantNull %10 +%130 = OpConstantNull %8 +%131 = OpConstantNull %21 +%132 = OpConstantNull %4 +%133 = OpConstantNull %43 +%134 = OpConstantNull %41 +%135 = OpConstantNull %44 +%136 = OpConstantNull %40 +%137 = OpConstantNull %10 +%138 = OpConstantNull %8 +%139 = OpConstantNull %21 +%140 = OpConstantNull %4 +%141 = OpConstantNull %43 +%142 = OpConstantNull %46 +%143 = OpConstantNull %43 +%144 = OpConstantNull %46 +%169 = OpTypePointer Function %34 +%170 = OpTypePointer Function %4 +%175 = OpTypeFunction %2 +%178 = OpTypeVector %10 2 +%193 = OpConstantNull %47 +%194 = OpConstantNull %47 +%195 = OpConstantNull %47 +%196 = OpConstantNull %47 +%197 = OpConstantNull %47 +%198 = OpConstantNull %47 +%199 = OpConstantNull %48 +%200 = OpConstantNull %48 +%201 = OpConstantNull %48 +%202 = OpConstantNull %49 +%204 = OpTypeVector %8 2 +%215 = OpTypeVector %21 3 +%510 = OpTypePointer Function %8 +%511 = OpConstantNull %8 +%513 = OpTypePointer Function %50 +%514 = OpConstantNull %50 +%517 = OpConstantNull %50 +%545 = OpTypePointer Function %8 +%56 = OpFunction %34 None %57 +%55 = OpLabel +OpBranch %58 +%58 = OpLabel +%59 = OpSelect %8 %9 %7 %11 +%61 = OpCompositeConstruct %36 %9 %9 %9 %9 +%60 = OpSelect %34 %61 %51 %52 +%62 = OpCompositeConstruct %36 %12 %12 %12 %12 +%63 = OpSelect %34 %62 %52 %51 +%64 = OpExtInst %34 %1 FMix %52 %51 %53 +%66 = OpCompositeConstruct %34 %13 %13 %13 %13 +%65 = OpExtInst %34 %1 FMix %52 %51 %66 +%67 = OpCompositeExtract %8 %54 0 +%68 = OpBitcast %4 %67 +%69 = OpBitcast %34 %54 +%70 = OpConvertFToS %35 %52 +%71 = OpCompositeConstruct %35 %59 %59 %59 %59 +%72 = OpIAdd %35 %71 %70 +%73 = OpConvertSToF %34 %72 +%74 = OpFAdd %34 %73 %60 +%75 = OpFAdd %34 %74 %64 +%76 = OpFAdd %34 %75 %65 +%77 = OpCompositeConstruct %34 %68 %68 %68 %68 +%78 = OpFAdd %34 %76 %77 +%79 = OpFAdd %34 %78 %69 +OpReturnValue %79 OpFunctionEnd -%93 = OpFunction %34 None %69 -%92 = OpLabel -OpBranch %94 -%94 = OpLabel -%95 = OpCompositeConstruct %37 %14 %14 -%96 = OpCompositeConstruct %37 %3 %3 -%97 = OpFAdd %37 %96 %95 -%98 = OpCompositeConstruct %37 %15 %15 -%99 = OpFSub %37 %97 %98 -%100 = OpCompositeConstruct %37 %16 %16 -%101 = OpFDiv %37 %99 %100 -%102 = OpCompositeConstruct %35 %17 %17 %17 %17 -%103 = OpCompositeConstruct %35 %18 %18 %18 %18 -%104 = OpSRem %35 %102 %103 -%105 = OpVectorShuffle %34 %101 %101 0 1 0 1 -%106 = OpConvertSToF %34 %104 -%107 = OpFAdd %34 %105 %106 -OpReturnValue %107 +%81 = OpFunction %34 None %57 +%80 = OpLabel +OpBranch %82 +%82 = OpLabel +%83 = OpCompositeConstruct %37 %14 %14 +%84 = OpCompositeConstruct %37 %3 %3 +%85 = OpFAdd %37 %84 %83 +%86 = OpCompositeConstruct %37 %15 %15 +%87 = OpFSub %37 %85 %86 +%88 = OpCompositeConstruct %37 %16 %16 +%89 = OpFDiv %37 %87 %88 +%90 = OpCompositeConstruct %35 %17 %17 %17 %17 +%91 = OpCompositeConstruct %35 %18 %18 %18 %18 +%92 = OpSRem %35 %90 %91 +%93 = OpVectorShuffle %34 %89 %89 0 1 0 1 +%94 = OpConvertSToF %34 %92 +%95 = OpFAdd %34 %93 %94 +OpReturnValue %95 OpFunctionEnd -%112 = OpFunction %37 None %113 -%111 = OpLabel -%108 = OpVariable %109 Function %110 -OpBranch %114 +%100 = OpFunction %37 None %101 +%99 = OpLabel +%96 = OpVariable %97 Function %98 +OpBranch %102 +%102 = OpLabel +%103 = OpCompositeConstruct %37 %14 %14 +OpStore %96 %103 +%104 = OpLoad %37 %96 +%105 = OpCompositeConstruct %37 %3 %3 +%106 = OpFAdd %37 %104 %105 +OpStore %96 %106 +%107 = OpLoad %37 %96 +%108 = OpCompositeConstruct %37 %15 %15 +%109 = OpFSub %37 %107 %108 +OpStore %96 %109 +%110 = OpLoad %37 %96 +%111 = OpCompositeConstruct %37 %16 %16 +%112 = OpFDiv %37 %110 %111 +OpStore %96 %112 +%113 = OpLoad %37 %96 +OpReturnValue %113 +OpFunctionEnd +%116 = OpFunction %38 None %117 +%115 = OpFunctionParameter %38 %114 = OpLabel -%115 = OpCompositeConstruct %37 %14 %14 -OpStore %108 %115 -%116 = OpLoad %37 %108 -%117 = OpCompositeConstruct %37 %3 %3 -%118 = OpFAdd %37 %116 %117 -OpStore %108 %118 -%119 = OpLoad %37 %108 -%120 = OpCompositeConstruct %37 %15 %15 -%121 = OpFSub %37 %119 %120 -OpStore %108 %121 -%122 = OpLoad %37 %108 -%123 = OpCompositeConstruct %37 %16 %16 -%124 = OpFDiv %37 %122 %123 -OpStore %108 %124 -%125 = OpLoad %37 %108 -OpReturnValue %125 +OpBranch %118 +%118 = OpLabel +%120 = OpFUnordNotEqual %39 %115 %119 +%122 = OpSelect %38 %120 %121 %119 +OpReturnValue %122 OpFunctionEnd -%128 = OpFunction %38 None %129 -%127 = OpFunctionParameter %38 +%127 = OpFunction %4 None %128 %126 = OpLabel -OpBranch %130 -%130 = OpLabel -%132 = OpFUnordNotEqual %39 %127 %131 -%134 = OpSelect %38 %132 %133 %131 -OpReturnValue %134 -OpFunctionEnd -%139 = OpFunction %4 None %140 -%138 = OpLabel -%135 = OpVariable %136 Function %137 -OpBranch %141 -%141 = OpLabel -%142 = OpCompositeConstruct %34 %3 %3 %3 %3 -%143 = OpCompositeConstruct %40 %142 %7 -OpStore %135 %143 -%144 = OpCompositeConstruct %37 %3 %5 -%145 = OpCompositeConstruct %37 %5 %3 -%146 = OpCompositeConstruct %41 %144 %145 -%147 = OpCompositeConstruct %34 %3 %5 %5 %5 -%148 = OpCompositeConstruct %34 %5 %3 %5 %5 -%149 = OpCompositeConstruct %34 %5 %5 %3 %5 -%150 = OpCompositeConstruct %34 %5 %5 %5 %3 -%151 = OpCompositeConstruct %42 %147 %148 %149 %150 -%152 = OpCompositeConstruct %43 %19 %19 -%153 = OpCompositeConstruct %37 %5 %5 -%154 = OpCompositeConstruct %37 %5 %5 -%155 = OpCompositeConstruct %41 %153 %154 -%156 = OpCompositeConstruct %45 %11 %7 %18 %21 -%162 = OpCopyObject %46 %62 -%164 = OpCopyObject %46 %62 -%167 = OpAccessChain %166 %135 %19 %19 -%168 = OpLoad %4 %167 -OpReturnValue %168 +%123 = OpVariable %124 Function %125 +OpBranch %145 +%145 = OpLabel +%146 = OpCompositeConstruct %34 %3 %3 %3 %3 +%147 = OpCompositeConstruct %40 %146 %7 +OpStore %123 %147 +%148 = OpCompositeConstruct %37 %3 %5 +%149 = OpCompositeConstruct %37 %5 %3 +%150 = OpCompositeConstruct %41 %148 %149 +%151 = OpCompositeConstruct %34 %3 %5 %5 %5 +%152 = OpCompositeConstruct %34 %5 %3 %5 %5 +%153 = OpCompositeConstruct %34 %5 %5 %3 %5 +%154 = OpCompositeConstruct %34 %5 %5 %5 %3 +%155 = OpCompositeConstruct %42 %151 %152 %153 %154 +%156 = OpCompositeConstruct %43 %20 %20 +%157 = OpCompositeConstruct %37 %5 %5 +%158 = OpCompositeConstruct %37 %5 %5 +%159 = OpCompositeConstruct %41 %157 %158 +%160 = OpCompositeConstruct %45 %11 %7 %18 %19 +%166 = OpCopyObject %46 %142 +%168 = OpCopyObject %46 %144 +%171 = OpAccessChain %170 %123 %20 %20 +%172 = OpLoad %4 %171 +OpReturnValue %172 OpFunctionEnd -%170 = OpFunction %2 None %171 -%169 = OpLabel -OpBranch %172 -%172 = OpLabel -%173 = OpLogicalNot %10 %9 -%175 = OpCompositeConstruct %174 %9 %9 -%176 = OpLogicalNot %174 %175 -%177 = OpLogicalOr %10 %9 %12 -%178 = OpLogicalAnd %10 %9 %12 -%179 = OpLogicalOr %10 %9 %12 -%180 = OpCompositeConstruct %39 %9 %9 %9 -%181 = OpCompositeConstruct %39 %12 %12 %12 -%182 = OpLogicalOr %39 %180 %181 -%183 = OpLogicalAnd %10 %9 %12 -%184 = OpCompositeConstruct %36 %9 %9 %9 %9 -%185 = OpCompositeConstruct %36 %12 %12 %12 %12 -%186 = OpLogicalAnd %36 %184 %185 +%174 = OpFunction %2 None %175 +%173 = OpLabel +OpBranch %176 +%176 = OpLabel +%177 = OpLogicalNot %10 %9 +%179 = OpCompositeConstruct %178 %9 %9 +%180 = OpLogicalNot %178 %179 +%181 = OpLogicalOr %10 %9 %12 +%182 = OpLogicalAnd %10 %9 %12 +%183 = OpLogicalOr %10 %9 %12 +%184 = OpCompositeConstruct %39 %9 %9 %9 +%185 = OpCompositeConstruct %39 %12 %12 %12 +%186 = OpLogicalOr %39 %184 %185 +%187 = OpLogicalAnd %10 %9 %12 +%188 = OpCompositeConstruct %36 %9 %9 %9 %9 +%189 = OpCompositeConstruct %36 %12 %12 %12 %12 +%190 = OpLogicalAnd %36 %188 %189 OpReturn OpFunctionEnd -%188 = OpFunction %2 None %171 -%187 = OpLabel -OpBranch %189 -%189 = OpLabel -%191 = OpCompositeConstruct %190 %7 %7 -%192 = OpSNegate %190 %191 -%193 = OpCompositeConstruct %37 %3 %3 -%194 = OpFNegate %37 %193 -%195 = OpIAdd %8 %18 %7 -%196 = OpIAdd %20 %24 %25 -%197 = OpFAdd %4 %14 %3 -%198 = OpCompositeConstruct %190 %18 %18 -%199 = OpCompositeConstruct %190 %7 %7 -%200 = OpIAdd %190 %198 %199 -%202 = OpCompositeConstruct %201 %24 %24 %24 -%203 = OpCompositeConstruct %201 %25 %25 %25 -%204 = OpIAdd %201 %202 %203 -%205 = OpCompositeConstruct %34 %14 %14 %14 %14 -%206 = OpCompositeConstruct %34 %3 %3 %3 %3 -%207 = OpFAdd %34 %205 %206 -%208 = OpISub %8 %18 %7 -%209 = OpISub %20 %24 %25 -%210 = OpFSub %4 %14 %3 -%211 = OpCompositeConstruct %190 %18 %18 -%212 = OpCompositeConstruct %190 %7 %7 -%213 = OpISub %190 %211 %212 -%214 = OpCompositeConstruct %201 %24 %24 %24 -%215 = OpCompositeConstruct %201 %25 %25 %25 -%216 = OpISub %201 %214 %215 -%217 = OpCompositeConstruct %34 %14 %14 %14 %14 -%218 = OpCompositeConstruct %34 %3 %3 %3 %3 -%219 = OpFSub %34 %217 %218 -%220 = OpIMul %8 %18 %7 -%221 = OpIMul %20 %24 %25 -%222 = OpFMul %4 %14 %3 -%223 = OpCompositeConstruct %190 %18 %18 -%224 = OpCompositeConstruct %190 %7 %7 -%225 = OpIMul %190 %223 %224 -%226 = OpCompositeConstruct %201 %24 %24 %24 -%227 = OpCompositeConstruct %201 %25 %25 %25 -%228 = OpIMul %201 %226 %227 -%229 = OpCompositeConstruct %34 %14 %14 %14 %14 -%230 = OpCompositeConstruct %34 %3 %3 %3 %3 -%231 = OpFMul %34 %229 %230 -%232 = OpSDiv %8 %18 %7 -%233 = OpUDiv %20 %24 %25 -%234 = OpFDiv %4 %14 %3 -%235 = OpCompositeConstruct %190 %18 %18 -%236 = OpCompositeConstruct %190 %7 %7 -%237 = OpSDiv %190 %235 %236 -%238 = OpCompositeConstruct %201 %24 %24 %24 -%239 = OpCompositeConstruct %201 %25 %25 %25 -%240 = OpUDiv %201 %238 %239 -%241 = OpCompositeConstruct %34 %14 %14 %14 %14 -%242 = OpCompositeConstruct %34 %3 %3 %3 %3 -%243 = OpFDiv %34 %241 %242 -%244 = OpSRem %8 %18 %7 -%245 = OpUMod %20 %24 %25 -%246 = OpFRem %4 %14 %3 -%247 = OpCompositeConstruct %190 %18 %18 -%248 = OpCompositeConstruct %190 %7 %7 -%249 = OpSRem %190 %247 %248 -%250 = OpCompositeConstruct %201 %24 %24 %24 -%251 = OpCompositeConstruct %201 %25 %25 %25 -%252 = OpUMod %201 %250 %251 -%253 = OpCompositeConstruct %34 %14 %14 %14 %14 -%254 = OpCompositeConstruct %34 %3 %3 %3 %3 -%255 = OpFRem %34 %253 %254 -%256 = OpCompositeConstruct %190 %18 %18 -%257 = OpCompositeConstruct %190 %7 %7 -%258 = OpIAdd %190 %256 %257 -%259 = OpCompositeConstruct %190 %7 %7 -%260 = OpCompositeConstruct %190 %18 %18 -%261 = OpIAdd %190 %260 %259 -%262 = OpCompositeConstruct %43 %24 %24 -%263 = OpCompositeConstruct %43 %25 %25 -%264 = OpIAdd %43 %262 %263 -%265 = OpCompositeConstruct %43 %25 %25 -%266 = OpCompositeConstruct %43 %24 %24 -%267 = OpIAdd %43 %266 %265 -%268 = OpCompositeConstruct %37 %14 %14 -%269 = OpCompositeConstruct %37 %3 %3 -%270 = OpFAdd %37 %268 %269 -%271 = OpCompositeConstruct %37 %3 %3 -%272 = OpCompositeConstruct %37 %14 %14 -%273 = OpFAdd %37 %272 %271 -%274 = OpCompositeConstruct %190 %18 %18 -%275 = OpCompositeConstruct %190 %7 %7 -%276 = OpISub %190 %274 %275 -%277 = OpCompositeConstruct %190 %7 %7 -%278 = OpCompositeConstruct %190 %18 %18 -%279 = OpISub %190 %278 %277 +%192 = OpFunction %2 None %175 +%191 = OpLabel +OpBranch %203 +%203 = OpLabel +%205 = OpCompositeConstruct %204 %7 %7 +%206 = OpSNegate %204 %205 +%207 = OpCompositeConstruct %37 %3 %3 +%208 = OpFNegate %37 %207 +%209 = OpIAdd %8 %18 %7 +%210 = OpIAdd %21 %24 %25 +%211 = OpFAdd %4 %14 %3 +%212 = OpCompositeConstruct %204 %18 %18 +%213 = OpCompositeConstruct %204 %7 %7 +%214 = OpIAdd %204 %212 %213 +%216 = OpCompositeConstruct %215 %24 %24 %24 +%217 = OpCompositeConstruct %215 %25 %25 %25 +%218 = OpIAdd %215 %216 %217 +%219 = OpCompositeConstruct %34 %14 %14 %14 %14 +%220 = OpCompositeConstruct %34 %3 %3 %3 %3 +%221 = OpFAdd %34 %219 %220 +%222 = OpISub %8 %18 %7 +%223 = OpISub %21 %24 %25 +%224 = OpFSub %4 %14 %3 +%225 = OpCompositeConstruct %204 %18 %18 +%226 = OpCompositeConstruct %204 %7 %7 +%227 = OpISub %204 %225 %226 +%228 = OpCompositeConstruct %215 %24 %24 %24 +%229 = OpCompositeConstruct %215 %25 %25 %25 +%230 = OpISub %215 %228 %229 +%231 = OpCompositeConstruct %34 %14 %14 %14 %14 +%232 = OpCompositeConstruct %34 %3 %3 %3 %3 +%233 = OpFSub %34 %231 %232 +%234 = OpIMul %8 %18 %7 +%235 = OpIMul %21 %24 %25 +%236 = OpFMul %4 %14 %3 +%237 = OpCompositeConstruct %204 %18 %18 +%238 = OpCompositeConstruct %204 %7 %7 +%239 = OpIMul %204 %237 %238 +%240 = OpCompositeConstruct %215 %24 %24 %24 +%241 = OpCompositeConstruct %215 %25 %25 %25 +%242 = OpIMul %215 %240 %241 +%243 = OpCompositeConstruct %34 %14 %14 %14 %14 +%244 = OpCompositeConstruct %34 %3 %3 %3 %3 +%245 = OpFMul %34 %243 %244 +%246 = OpSDiv %8 %18 %7 +%247 = OpUDiv %21 %24 %25 +%248 = OpFDiv %4 %14 %3 +%249 = OpCompositeConstruct %204 %18 %18 +%250 = OpCompositeConstruct %204 %7 %7 +%251 = OpSDiv %204 %249 %250 +%252 = OpCompositeConstruct %215 %24 %24 %24 +%253 = OpCompositeConstruct %215 %25 %25 %25 +%254 = OpUDiv %215 %252 %253 +%255 = OpCompositeConstruct %34 %14 %14 %14 %14 +%256 = OpCompositeConstruct %34 %3 %3 %3 %3 +%257 = OpFDiv %34 %255 %256 +%258 = OpSRem %8 %18 %7 +%259 = OpUMod %21 %24 %25 +%260 = OpFRem %4 %14 %3 +%261 = OpCompositeConstruct %204 %18 %18 +%262 = OpCompositeConstruct %204 %7 %7 +%263 = OpSRem %204 %261 %262 +%264 = OpCompositeConstruct %215 %24 %24 %24 +%265 = OpCompositeConstruct %215 %25 %25 %25 +%266 = OpUMod %215 %264 %265 +%267 = OpCompositeConstruct %34 %14 %14 %14 %14 +%268 = OpCompositeConstruct %34 %3 %3 %3 %3 +%269 = OpFRem %34 %267 %268 +%270 = OpCompositeConstruct %204 %18 %18 +%271 = OpCompositeConstruct %204 %7 %7 +%272 = OpIAdd %204 %270 %271 +%273 = OpCompositeConstruct %204 %7 %7 +%274 = OpCompositeConstruct %204 %18 %18 +%275 = OpIAdd %204 %274 %273 +%276 = OpCompositeConstruct %43 %24 %24 +%277 = OpCompositeConstruct %43 %25 %25 +%278 = OpIAdd %43 %276 %277 +%279 = OpCompositeConstruct %43 %25 %25 %280 = OpCompositeConstruct %43 %24 %24 -%281 = OpCompositeConstruct %43 %25 %25 -%282 = OpISub %43 %280 %281 -%283 = OpCompositeConstruct %43 %25 %25 -%284 = OpCompositeConstruct %43 %24 %24 -%285 = OpISub %43 %284 %283 +%281 = OpIAdd %43 %280 %279 +%282 = OpCompositeConstruct %37 %14 %14 +%283 = OpCompositeConstruct %37 %3 %3 +%284 = OpFAdd %37 %282 %283 +%285 = OpCompositeConstruct %37 %3 %3 %286 = OpCompositeConstruct %37 %14 %14 -%287 = OpCompositeConstruct %37 %3 %3 -%288 = OpFSub %37 %286 %287 -%289 = OpCompositeConstruct %37 %3 %3 -%290 = OpCompositeConstruct %37 %14 %14 -%291 = OpFSub %37 %290 %289 -%292 = OpCompositeConstruct %190 %18 %18 -%294 = OpCompositeConstruct %190 %7 %7 -%293 = OpIMul %190 %292 %294 -%295 = OpCompositeConstruct %190 %7 %7 -%297 = OpCompositeConstruct %190 %18 %18 -%296 = OpIMul %190 %295 %297 +%287 = OpFAdd %37 %286 %285 +%288 = OpCompositeConstruct %204 %18 %18 +%289 = OpCompositeConstruct %204 %7 %7 +%290 = OpISub %204 %288 %289 +%291 = OpCompositeConstruct %204 %7 %7 +%292 = OpCompositeConstruct %204 %18 %18 +%293 = OpISub %204 %292 %291 +%294 = OpCompositeConstruct %43 %24 %24 +%295 = OpCompositeConstruct %43 %25 %25 +%296 = OpISub %43 %294 %295 +%297 = OpCompositeConstruct %43 %25 %25 %298 = OpCompositeConstruct %43 %24 %24 -%300 = OpCompositeConstruct %43 %25 %25 -%299 = OpIMul %43 %298 %300 -%301 = OpCompositeConstruct %43 %25 %25 -%303 = OpCompositeConstruct %43 %24 %24 -%302 = OpIMul %43 %301 %303 +%299 = OpISub %43 %298 %297 +%300 = OpCompositeConstruct %37 %14 %14 +%301 = OpCompositeConstruct %37 %3 %3 +%302 = OpFSub %37 %300 %301 +%303 = OpCompositeConstruct %37 %3 %3 %304 = OpCompositeConstruct %37 %14 %14 -%305 = OpVectorTimesScalar %37 %304 %3 -%306 = OpCompositeConstruct %37 %3 %3 -%307 = OpVectorTimesScalar %37 %306 %14 -%308 = OpCompositeConstruct %190 %18 %18 -%309 = OpCompositeConstruct %190 %7 %7 -%310 = OpSDiv %190 %308 %309 -%311 = OpCompositeConstruct %190 %7 %7 -%312 = OpCompositeConstruct %190 %18 %18 -%313 = OpSDiv %190 %312 %311 -%314 = OpCompositeConstruct %43 %24 %24 +%305 = OpFSub %37 %304 %303 +%306 = OpCompositeConstruct %204 %18 %18 +%308 = OpCompositeConstruct %204 %7 %7 +%307 = OpIMul %204 %306 %308 +%309 = OpCompositeConstruct %204 %7 %7 +%311 = OpCompositeConstruct %204 %18 %18 +%310 = OpIMul %204 %309 %311 +%312 = OpCompositeConstruct %43 %24 %24 +%314 = OpCompositeConstruct %43 %25 %25 +%313 = OpIMul %43 %312 %314 %315 = OpCompositeConstruct %43 %25 %25 -%316 = OpUDiv %43 %314 %315 -%317 = OpCompositeConstruct %43 %25 %25 -%318 = OpCompositeConstruct %43 %24 %24 -%319 = OpUDiv %43 %318 %317 -%320 = OpCompositeConstruct %37 %14 %14 -%321 = OpCompositeConstruct %37 %3 %3 -%322 = OpFDiv %37 %320 %321 -%323 = OpCompositeConstruct %37 %3 %3 -%324 = OpCompositeConstruct %37 %14 %14 -%325 = OpFDiv %37 %324 %323 -%326 = OpCompositeConstruct %190 %18 %18 -%327 = OpCompositeConstruct %190 %7 %7 -%328 = OpSRem %190 %326 %327 -%329 = OpCompositeConstruct %190 %7 %7 -%330 = OpCompositeConstruct %190 %18 %18 -%331 = OpSRem %190 %330 %329 +%317 = OpCompositeConstruct %43 %24 %24 +%316 = OpIMul %43 %315 %317 +%318 = OpCompositeConstruct %37 %14 %14 +%319 = OpVectorTimesScalar %37 %318 %3 +%320 = OpCompositeConstruct %37 %3 %3 +%321 = OpVectorTimesScalar %37 %320 %14 +%322 = OpCompositeConstruct %204 %18 %18 +%323 = OpCompositeConstruct %204 %7 %7 +%324 = OpSDiv %204 %322 %323 +%325 = OpCompositeConstruct %204 %7 %7 +%326 = OpCompositeConstruct %204 %18 %18 +%327 = OpSDiv %204 %326 %325 +%328 = OpCompositeConstruct %43 %24 %24 +%329 = OpCompositeConstruct %43 %25 %25 +%330 = OpUDiv %43 %328 %329 +%331 = OpCompositeConstruct %43 %25 %25 %332 = OpCompositeConstruct %43 %24 %24 -%333 = OpCompositeConstruct %43 %25 %25 -%334 = OpUMod %43 %332 %333 -%335 = OpCompositeConstruct %43 %25 %25 -%336 = OpCompositeConstruct %43 %24 %24 -%337 = OpUMod %43 %336 %335 +%333 = OpUDiv %43 %332 %331 +%334 = OpCompositeConstruct %37 %14 %14 +%335 = OpCompositeConstruct %37 %3 %3 +%336 = OpFDiv %37 %334 %335 +%337 = OpCompositeConstruct %37 %3 %3 %338 = OpCompositeConstruct %37 %14 %14 -%339 = OpCompositeConstruct %37 %3 %3 -%340 = OpFRem %37 %338 %339 -%341 = OpCompositeConstruct %37 %3 %3 -%342 = OpCompositeConstruct %37 %14 %14 -%343 = OpFRem %37 %342 %341 -%345 = OpCompositeExtract %38 %63 0 -%346 = OpCompositeExtract %38 %63 0 -%347 = OpFAdd %38 %345 %346 -%348 = OpCompositeExtract %38 %63 1 -%349 = OpCompositeExtract %38 %63 1 -%350 = OpFAdd %38 %348 %349 -%351 = OpCompositeExtract %38 %63 2 -%352 = OpCompositeExtract %38 %63 2 -%353 = OpFAdd %38 %351 %352 -%344 = OpCompositeConstruct %47 %347 %350 %353 -%355 = OpCompositeExtract %38 %63 0 -%356 = OpCompositeExtract %38 %63 0 -%357 = OpFSub %38 %355 %356 -%358 = OpCompositeExtract %38 %63 1 -%359 = OpCompositeExtract %38 %63 1 -%360 = OpFSub %38 %358 %359 -%361 = OpCompositeExtract %38 %63 2 -%362 = OpCompositeExtract %38 %63 2 -%363 = OpFSub %38 %361 %362 -%354 = OpCompositeConstruct %47 %357 %360 %363 -%364 = OpMatrixTimesScalar %47 %63 %3 -%365 = OpMatrixTimesScalar %47 %63 %14 -%366 = OpCompositeConstruct %34 %3 %3 %3 %3 -%367 = OpMatrixTimesVector %38 %64 %366 -%368 = OpCompositeConstruct %38 %14 %14 %14 -%369 = OpVectorTimesMatrix %34 %368 %64 -%370 = OpMatrixTimesMatrix %47 %64 %65 +%339 = OpFDiv %37 %338 %337 +%340 = OpCompositeConstruct %204 %18 %18 +%341 = OpCompositeConstruct %204 %7 %7 +%342 = OpSRem %204 %340 %341 +%343 = OpCompositeConstruct %204 %7 %7 +%344 = OpCompositeConstruct %204 %18 %18 +%345 = OpSRem %204 %344 %343 +%346 = OpCompositeConstruct %43 %24 %24 +%347 = OpCompositeConstruct %43 %25 %25 +%348 = OpUMod %43 %346 %347 +%349 = OpCompositeConstruct %43 %25 %25 +%350 = OpCompositeConstruct %43 %24 %24 +%351 = OpUMod %43 %350 %349 +%352 = OpCompositeConstruct %37 %14 %14 +%353 = OpCompositeConstruct %37 %3 %3 +%354 = OpFRem %37 %352 %353 +%355 = OpCompositeConstruct %37 %3 %3 +%356 = OpCompositeConstruct %37 %14 %14 +%357 = OpFRem %37 %356 %355 +%359 = OpCompositeExtract %38 %193 0 +%360 = OpCompositeExtract %38 %194 0 +%361 = OpFAdd %38 %359 %360 +%362 = OpCompositeExtract %38 %193 1 +%363 = OpCompositeExtract %38 %194 1 +%364 = OpFAdd %38 %362 %363 +%365 = OpCompositeExtract %38 %193 2 +%366 = OpCompositeExtract %38 %194 2 +%367 = OpFAdd %38 %365 %366 +%358 = OpCompositeConstruct %47 %361 %364 %367 +%369 = OpCompositeExtract %38 %195 0 +%370 = OpCompositeExtract %38 %196 0 +%371 = OpFSub %38 %369 %370 +%372 = OpCompositeExtract %38 %195 1 +%373 = OpCompositeExtract %38 %196 1 +%374 = OpFSub %38 %372 %373 +%375 = OpCompositeExtract %38 %195 2 +%376 = OpCompositeExtract %38 %196 2 +%377 = OpFSub %38 %375 %376 +%368 = OpCompositeConstruct %47 %371 %374 %377 +%378 = OpMatrixTimesScalar %47 %197 %3 +%379 = OpMatrixTimesScalar %47 %198 %14 +%380 = OpCompositeConstruct %34 %3 %3 %3 %3 +%381 = OpMatrixTimesVector %38 %199 %380 +%382 = OpCompositeConstruct %38 %14 %14 %14 +%383 = OpVectorTimesMatrix %34 %382 %200 +%384 = OpMatrixTimesMatrix %47 %201 %202 OpReturn OpFunctionEnd -%372 = OpFunction %2 None %171 -%371 = OpLabel -OpBranch %373 -%373 = OpLabel -%374 = OpNot %8 %7 -%375 = OpNot %20 %25 -%376 = OpCompositeConstruct %190 %7 %7 -%377 = OpNot %190 %376 -%378 = OpCompositeConstruct %201 %25 %25 %25 -%379 = OpNot %201 %378 -%380 = OpBitwiseOr %8 %18 %7 -%381 = OpBitwiseOr %20 %24 %25 -%382 = OpCompositeConstruct %190 %18 %18 -%383 = OpCompositeConstruct %190 %7 %7 -%384 = OpBitwiseOr %190 %382 %383 -%385 = OpCompositeConstruct %201 %24 %24 %24 -%386 = OpCompositeConstruct %201 %25 %25 %25 -%387 = OpBitwiseOr %201 %385 %386 -%388 = OpBitwiseAnd %8 %18 %7 -%389 = OpBitwiseAnd %20 %24 %25 -%390 = OpCompositeConstruct %190 %18 %18 -%391 = OpCompositeConstruct %190 %7 %7 -%392 = OpBitwiseAnd %190 %390 %391 -%393 = OpCompositeConstruct %201 %24 %24 %24 -%394 = OpCompositeConstruct %201 %25 %25 %25 -%395 = OpBitwiseAnd %201 %393 %394 -%396 = OpBitwiseXor %8 %18 %7 -%397 = OpBitwiseXor %20 %24 %25 -%398 = OpCompositeConstruct %190 %18 %18 -%399 = OpCompositeConstruct %190 %7 %7 -%400 = OpBitwiseXor %190 %398 %399 -%401 = OpCompositeConstruct %201 %24 %24 %24 -%402 = OpCompositeConstruct %201 %25 %25 %25 -%403 = OpBitwiseXor %201 %401 %402 -%404 = OpShiftLeftLogical %8 %18 %25 -%405 = OpShiftLeftLogical %20 %24 %25 -%406 = OpCompositeConstruct %190 %18 %18 -%407 = OpCompositeConstruct %43 %25 %25 -%408 = OpShiftLeftLogical %190 %406 %407 -%409 = OpCompositeConstruct %201 %24 %24 %24 -%410 = OpCompositeConstruct %201 %25 %25 %25 -%411 = OpShiftLeftLogical %201 %409 %410 -%412 = OpShiftRightArithmetic %8 %18 %25 -%413 = OpShiftRightLogical %20 %24 %25 -%414 = OpCompositeConstruct %190 %18 %18 -%415 = OpCompositeConstruct %43 %25 %25 -%416 = OpShiftRightArithmetic %190 %414 %415 -%417 = OpCompositeConstruct %201 %24 %24 %24 -%418 = OpCompositeConstruct %201 %25 %25 %25 -%419 = OpShiftRightLogical %201 %417 %418 +%386 = OpFunction %2 None %175 +%385 = OpLabel +OpBranch %387 +%387 = OpLabel +%388 = OpNot %8 %7 +%389 = OpNot %21 %25 +%390 = OpCompositeConstruct %204 %7 %7 +%391 = OpNot %204 %390 +%392 = OpCompositeConstruct %215 %25 %25 %25 +%393 = OpNot %215 %392 +%394 = OpBitwiseOr %8 %18 %7 +%395 = OpBitwiseOr %21 %24 %25 +%396 = OpCompositeConstruct %204 %18 %18 +%397 = OpCompositeConstruct %204 %7 %7 +%398 = OpBitwiseOr %204 %396 %397 +%399 = OpCompositeConstruct %215 %24 %24 %24 +%400 = OpCompositeConstruct %215 %25 %25 %25 +%401 = OpBitwiseOr %215 %399 %400 +%402 = OpBitwiseAnd %8 %18 %7 +%403 = OpBitwiseAnd %21 %24 %25 +%404 = OpCompositeConstruct %204 %18 %18 +%405 = OpCompositeConstruct %204 %7 %7 +%406 = OpBitwiseAnd %204 %404 %405 +%407 = OpCompositeConstruct %215 %24 %24 %24 +%408 = OpCompositeConstruct %215 %25 %25 %25 +%409 = OpBitwiseAnd %215 %407 %408 +%410 = OpBitwiseXor %8 %18 %7 +%411 = OpBitwiseXor %21 %24 %25 +%412 = OpCompositeConstruct %204 %18 %18 +%413 = OpCompositeConstruct %204 %7 %7 +%414 = OpBitwiseXor %204 %412 %413 +%415 = OpCompositeConstruct %215 %24 %24 %24 +%416 = OpCompositeConstruct %215 %25 %25 %25 +%417 = OpBitwiseXor %215 %415 %416 +%418 = OpShiftLeftLogical %8 %18 %25 +%419 = OpShiftLeftLogical %21 %24 %25 +%420 = OpCompositeConstruct %204 %18 %18 +%421 = OpCompositeConstruct %43 %25 %25 +%422 = OpShiftLeftLogical %204 %420 %421 +%423 = OpCompositeConstruct %215 %24 %24 %24 +%424 = OpCompositeConstruct %215 %25 %25 %25 +%425 = OpShiftLeftLogical %215 %423 %424 +%426 = OpShiftRightArithmetic %8 %18 %25 +%427 = OpShiftRightLogical %21 %24 %25 +%428 = OpCompositeConstruct %204 %18 %18 +%429 = OpCompositeConstruct %43 %25 %25 +%430 = OpShiftRightArithmetic %204 %428 %429 +%431 = OpCompositeConstruct %215 %24 %24 %24 +%432 = OpCompositeConstruct %215 %25 %25 %25 +%433 = OpShiftRightLogical %215 %431 %432 OpReturn OpFunctionEnd -%421 = OpFunction %2 None %171 -%420 = OpLabel -OpBranch %422 -%422 = OpLabel -%423 = OpIEqual %10 %18 %7 -%424 = OpIEqual %10 %24 %25 -%425 = OpFOrdEqual %10 %14 %3 -%426 = OpCompositeConstruct %190 %18 %18 -%427 = OpCompositeConstruct %190 %7 %7 -%428 = OpIEqual %174 %426 %427 -%429 = OpCompositeConstruct %201 %24 %24 %24 -%430 = OpCompositeConstruct %201 %25 %25 %25 -%431 = OpIEqual %39 %429 %430 -%432 = OpCompositeConstruct %34 %14 %14 %14 %14 -%433 = OpCompositeConstruct %34 %3 %3 %3 %3 -%434 = OpFOrdEqual %36 %432 %433 -%435 = OpINotEqual %10 %18 %7 -%436 = OpINotEqual %10 %24 %25 -%437 = OpFOrdNotEqual %10 %14 %3 -%438 = OpCompositeConstruct %190 %18 %18 -%439 = OpCompositeConstruct %190 %7 %7 -%440 = OpINotEqual %174 %438 %439 -%441 = OpCompositeConstruct %201 %24 %24 %24 -%442 = OpCompositeConstruct %201 %25 %25 %25 -%443 = OpINotEqual %39 %441 %442 -%444 = OpCompositeConstruct %34 %14 %14 %14 %14 -%445 = OpCompositeConstruct %34 %3 %3 %3 %3 -%446 = OpFOrdNotEqual %36 %444 %445 -%447 = OpSLessThan %10 %18 %7 -%448 = OpULessThan %10 %24 %25 -%449 = OpFOrdLessThan %10 %14 %3 -%450 = OpCompositeConstruct %190 %18 %18 -%451 = OpCompositeConstruct %190 %7 %7 -%452 = OpSLessThan %174 %450 %451 -%453 = OpCompositeConstruct %201 %24 %24 %24 -%454 = OpCompositeConstruct %201 %25 %25 %25 -%455 = OpULessThan %39 %453 %454 -%456 = OpCompositeConstruct %34 %14 %14 %14 %14 -%457 = OpCompositeConstruct %34 %3 %3 %3 %3 -%458 = OpFOrdLessThan %36 %456 %457 -%459 = OpSLessThanEqual %10 %18 %7 -%460 = OpULessThanEqual %10 %24 %25 -%461 = OpFOrdLessThanEqual %10 %14 %3 -%462 = OpCompositeConstruct %190 %18 %18 -%463 = OpCompositeConstruct %190 %7 %7 -%464 = OpSLessThanEqual %174 %462 %463 -%465 = OpCompositeConstruct %201 %24 %24 %24 -%466 = OpCompositeConstruct %201 %25 %25 %25 -%467 = OpULessThanEqual %39 %465 %466 -%468 = OpCompositeConstruct %34 %14 %14 %14 %14 -%469 = OpCompositeConstruct %34 %3 %3 %3 %3 -%470 = OpFOrdLessThanEqual %36 %468 %469 -%471 = OpSGreaterThan %10 %18 %7 -%472 = OpUGreaterThan %10 %24 %25 -%473 = OpFOrdGreaterThan %10 %14 %3 -%474 = OpCompositeConstruct %190 %18 %18 -%475 = OpCompositeConstruct %190 %7 %7 -%476 = OpSGreaterThan %174 %474 %475 -%477 = OpCompositeConstruct %201 %24 %24 %24 -%478 = OpCompositeConstruct %201 %25 %25 %25 -%479 = OpUGreaterThan %39 %477 %478 -%480 = OpCompositeConstruct %34 %14 %14 %14 %14 -%481 = OpCompositeConstruct %34 %3 %3 %3 %3 -%482 = OpFOrdGreaterThan %36 %480 %481 -%483 = OpSGreaterThanEqual %10 %18 %7 -%484 = OpUGreaterThanEqual %10 %24 %25 -%485 = OpFOrdGreaterThanEqual %10 %14 %3 -%486 = OpCompositeConstruct %190 %18 %18 -%487 = OpCompositeConstruct %190 %7 %7 -%488 = OpSGreaterThanEqual %174 %486 %487 -%489 = OpCompositeConstruct %201 %24 %24 %24 -%490 = OpCompositeConstruct %201 %25 %25 %25 -%491 = OpUGreaterThanEqual %39 %489 %490 -%492 = OpCompositeConstruct %34 %14 %14 %14 %14 -%493 = OpCompositeConstruct %34 %3 %3 %3 %3 -%494 = OpFOrdGreaterThanEqual %36 %492 %493 +%435 = OpFunction %2 None %175 +%434 = OpLabel +OpBranch %436 +%436 = OpLabel +%437 = OpIEqual %10 %18 %7 +%438 = OpIEqual %10 %24 %25 +%439 = OpFOrdEqual %10 %14 %3 +%440 = OpCompositeConstruct %204 %18 %18 +%441 = OpCompositeConstruct %204 %7 %7 +%442 = OpIEqual %178 %440 %441 +%443 = OpCompositeConstruct %215 %24 %24 %24 +%444 = OpCompositeConstruct %215 %25 %25 %25 +%445 = OpIEqual %39 %443 %444 +%446 = OpCompositeConstruct %34 %14 %14 %14 %14 +%447 = OpCompositeConstruct %34 %3 %3 %3 %3 +%448 = OpFOrdEqual %36 %446 %447 +%449 = OpINotEqual %10 %18 %7 +%450 = OpINotEqual %10 %24 %25 +%451 = OpFOrdNotEqual %10 %14 %3 +%452 = OpCompositeConstruct %204 %18 %18 +%453 = OpCompositeConstruct %204 %7 %7 +%454 = OpINotEqual %178 %452 %453 +%455 = OpCompositeConstruct %215 %24 %24 %24 +%456 = OpCompositeConstruct %215 %25 %25 %25 +%457 = OpINotEqual %39 %455 %456 +%458 = OpCompositeConstruct %34 %14 %14 %14 %14 +%459 = OpCompositeConstruct %34 %3 %3 %3 %3 +%460 = OpFOrdNotEqual %36 %458 %459 +%461 = OpSLessThan %10 %18 %7 +%462 = OpULessThan %10 %24 %25 +%463 = OpFOrdLessThan %10 %14 %3 +%464 = OpCompositeConstruct %204 %18 %18 +%465 = OpCompositeConstruct %204 %7 %7 +%466 = OpSLessThan %178 %464 %465 +%467 = OpCompositeConstruct %215 %24 %24 %24 +%468 = OpCompositeConstruct %215 %25 %25 %25 +%469 = OpULessThan %39 %467 %468 +%470 = OpCompositeConstruct %34 %14 %14 %14 %14 +%471 = OpCompositeConstruct %34 %3 %3 %3 %3 +%472 = OpFOrdLessThan %36 %470 %471 +%473 = OpSLessThanEqual %10 %18 %7 +%474 = OpULessThanEqual %10 %24 %25 +%475 = OpFOrdLessThanEqual %10 %14 %3 +%476 = OpCompositeConstruct %204 %18 %18 +%477 = OpCompositeConstruct %204 %7 %7 +%478 = OpSLessThanEqual %178 %476 %477 +%479 = OpCompositeConstruct %215 %24 %24 %24 +%480 = OpCompositeConstruct %215 %25 %25 %25 +%481 = OpULessThanEqual %39 %479 %480 +%482 = OpCompositeConstruct %34 %14 %14 %14 %14 +%483 = OpCompositeConstruct %34 %3 %3 %3 %3 +%484 = OpFOrdLessThanEqual %36 %482 %483 +%485 = OpSGreaterThan %10 %18 %7 +%486 = OpUGreaterThan %10 %24 %25 +%487 = OpFOrdGreaterThan %10 %14 %3 +%488 = OpCompositeConstruct %204 %18 %18 +%489 = OpCompositeConstruct %204 %7 %7 +%490 = OpSGreaterThan %178 %488 %489 +%491 = OpCompositeConstruct %215 %24 %24 %24 +%492 = OpCompositeConstruct %215 %25 %25 %25 +%493 = OpUGreaterThan %39 %491 %492 +%494 = OpCompositeConstruct %34 %14 %14 %14 %14 +%495 = OpCompositeConstruct %34 %3 %3 %3 %3 +%496 = OpFOrdGreaterThan %36 %494 %495 +%497 = OpSGreaterThanEqual %10 %18 %7 +%498 = OpUGreaterThanEqual %10 %24 %25 +%499 = OpFOrdGreaterThanEqual %10 %14 %3 +%500 = OpCompositeConstruct %204 %18 %18 +%501 = OpCompositeConstruct %204 %7 %7 +%502 = OpSGreaterThanEqual %178 %500 %501 +%503 = OpCompositeConstruct %215 %24 %24 %24 +%504 = OpCompositeConstruct %215 %25 %25 %25 +%505 = OpUGreaterThanEqual %39 %503 %504 +%506 = OpCompositeConstruct %34 %14 %14 %14 %14 +%507 = OpCompositeConstruct %34 %3 %3 %3 %3 +%508 = OpFOrdGreaterThanEqual %36 %506 %507 OpReturn OpFunctionEnd -%502 = OpFunction %2 None %171 -%501 = OpLabel -%495 = OpVariable %496 Function %497 -%498 = OpVariable %499 Function %500 -OpBranch %503 -%503 = OpLabel -OpStore %495 %7 -%504 = OpLoad %8 %495 -%505 = OpIAdd %8 %504 %7 -OpStore %495 %505 -%506 = OpLoad %8 %495 -%507 = OpISub %8 %506 %7 -OpStore %495 %507 -%508 = OpLoad %8 %495 -%509 = OpLoad %8 %495 -%510 = OpIMul %8 %509 %508 -OpStore %495 %510 -%511 = OpLoad %8 %495 -%512 = OpLoad %8 %495 -%513 = OpSDiv %8 %512 %511 -OpStore %495 %513 -%514 = OpLoad %8 %495 -%515 = OpSRem %8 %514 %7 -OpStore %495 %515 -%516 = OpLoad %8 %495 -%517 = OpBitwiseAnd %8 %516 %11 -OpStore %495 %517 -%518 = OpLoad %8 %495 -%519 = OpBitwiseOr %8 %518 %11 -OpStore %495 %519 -%520 = OpLoad %8 %495 -%521 = OpBitwiseXor %8 %520 %11 -OpStore %495 %521 -%522 = OpLoad %8 %495 -%523 = OpShiftLeftLogical %8 %522 %24 -OpStore %495 %523 -%524 = OpLoad %8 %495 -%525 = OpShiftRightArithmetic %8 %524 %25 -OpStore %495 %525 -%526 = OpLoad %8 %495 -%527 = OpIAdd %8 %526 %7 -OpStore %495 %527 -%528 = OpLoad %8 %495 -%529 = OpISub %8 %528 %7 -OpStore %495 %529 -OpStore %498 %66 -%531 = OpAccessChain %530 %498 %25 -%532 = OpLoad %8 %531 -%533 = OpIAdd %8 %532 %7 -%534 = OpAccessChain %530 %498 %25 -OpStore %534 %533 -%535 = OpAccessChain %530 %498 %25 -%536 = OpLoad %8 %535 -%537 = OpISub %8 %536 %7 -%538 = OpAccessChain %530 %498 %25 -OpStore %538 %537 +%516 = OpFunction %2 None %175 +%515 = OpLabel +%509 = OpVariable %510 Function %511 +%512 = OpVariable %513 Function %514 +OpBranch %518 +%518 = OpLabel +OpStore %509 %7 +%519 = OpLoad %8 %509 +%520 = OpIAdd %8 %519 %7 +OpStore %509 %520 +%521 = OpLoad %8 %509 +%522 = OpISub %8 %521 %7 +OpStore %509 %522 +%523 = OpLoad %8 %509 +%524 = OpLoad %8 %509 +%525 = OpIMul %8 %524 %523 +OpStore %509 %525 +%526 = OpLoad %8 %509 +%527 = OpLoad %8 %509 +%528 = OpSDiv %8 %527 %526 +OpStore %509 %528 +%529 = OpLoad %8 %509 +%530 = OpSRem %8 %529 %7 +OpStore %509 %530 +%531 = OpLoad %8 %509 +%532 = OpBitwiseAnd %8 %531 %11 +OpStore %509 %532 +%533 = OpLoad %8 %509 +%534 = OpBitwiseOr %8 %533 %11 +OpStore %509 %534 +%535 = OpLoad %8 %509 +%536 = OpBitwiseXor %8 %535 %11 +OpStore %509 %536 +%537 = OpLoad %8 %509 +%538 = OpShiftLeftLogical %8 %537 %24 +OpStore %509 %538 +%539 = OpLoad %8 %509 +%540 = OpShiftRightArithmetic %8 %539 %25 +OpStore %509 %540 +%541 = OpLoad %8 %509 +%542 = OpIAdd %8 %541 %7 +OpStore %509 %542 +%543 = OpLoad %8 %509 +%544 = OpISub %8 %543 %7 +OpStore %509 %544 +OpStore %512 %517 +%546 = OpAccessChain %545 %512 %25 +%547 = OpLoad %8 %546 +%548 = OpIAdd %8 %547 %7 +%549 = OpAccessChain %545 %512 %25 +OpStore %549 %548 +%550 = OpAccessChain %545 %512 %25 +%551 = OpLoad %8 %550 +%552 = OpISub %8 %551 %7 +%553 = OpAccessChain %545 %512 %25 +OpStore %553 %552 OpReturn OpFunctionEnd -%540 = OpFunction %2 None %171 -%539 = OpLabel -OpBranch %541 -%541 = OpLabel -%542 = OpSNegate %8 %27 -%543 = OpSNegate %8 %28 -%544 = OpSNegate %8 %29 -%545 = OpSNegate %8 %544 -%546 = OpSNegate %8 %30 -%547 = OpSNegate %8 %546 -%548 = OpSNegate %8 %31 -%549 = OpSNegate %8 %548 -%550 = OpSNegate %8 %549 -%551 = OpSNegate %8 %550 -%552 = OpSNegate %8 %32 -%553 = OpSNegate %8 %552 -%554 = OpSNegate %8 %553 -%555 = OpSNegate %8 %554 -%556 = OpSNegate %8 %33 -%557 = OpSNegate %8 %556 -%558 = OpSNegate %8 %557 -%559 = OpSNegate %8 %558 +%555 = OpFunction %2 None %175 +%554 = OpLabel +OpBranch %556 +%556 = OpLabel +%557 = OpSNegate %8 %27 +%558 = OpSNegate %8 %28 +%559 = OpSNegate %8 %29 +%560 = OpSNegate %8 %559 +%561 = OpSNegate %8 %30 +%562 = OpSNegate %8 %561 +%563 = OpSNegate %8 %31 +%564 = OpSNegate %8 %563 +%565 = OpSNegate %8 %564 +%566 = OpSNegate %8 %565 +%567 = OpSNegate %8 %32 +%568 = OpSNegate %8 %567 +%569 = OpSNegate %8 %568 +%570 = OpSNegate %8 %569 +%571 = OpSNegate %8 %33 +%572 = OpSNegate %8 %571 +%573 = OpSNegate %8 %572 +%574 = OpSNegate %8 %573 OpReturn OpFunctionEnd -%561 = OpFunction %2 None %171 -%560 = OpLabel -OpBranch %562 -%562 = OpLabel -%563 = OpFunctionCall %34 %68 -%564 = OpFunctionCall %34 %93 -%565 = OpVectorShuffle %38 %51 %51 0 1 2 -%566 = OpFunctionCall %38 %128 %565 -%567 = OpFunctionCall %4 %139 -%568 = OpFunctionCall %2 %170 -%569 = OpFunctionCall %2 %188 -%570 = OpFunctionCall %2 %372 -%571 = OpFunctionCall %2 %421 -%572 = OpFunctionCall %2 %502 +%576 = OpFunction %2 None %175 +%575 = OpLabel +OpBranch %577 +%577 = OpLabel +%578 = OpFunctionCall %34 %56 +%579 = OpFunctionCall %34 %81 +%580 = OpVectorShuffle %38 %51 %51 0 1 2 +%581 = OpFunctionCall %38 %116 %580 +%582 = OpFunctionCall %4 %127 +%583 = OpFunctionCall %2 %174 +%584 = OpFunctionCall %2 %192 +%585 = OpFunctionCall %2 %386 +%586 = OpFunctionCall %2 %435 +%587 = OpFunctionCall %2 %516 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/wgsl/access.wgsl b/tests/out/wgsl/access.wgsl index 0bbd1a7759..f82521a756 100644 --- a/tests/out/wgsl/access.wgsl +++ b/tests/out/wgsl/access.wgsl @@ -93,10 +93,10 @@ fn test_matrix_within_array_within_struct_accesses() { let _e58 = idx_1; let _e60 = idx_1; _ = nested_mat_cx2_.am[0][_e58][_e60]; - t_1 = MatCx2InArray(array,2>(mat4x2(vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0)), mat4x2(vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0)))); + t_1 = MatCx2InArray(array,2>()); let _e66 = idx_1; idx_1 = (_e66 + 1); - t_1.am = array,2>(mat4x2(vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0)), mat4x2(vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0), vec2(0.0, 0.0))); + t_1.am = array,2>(); t_1.am[0] = mat4x2(vec2(8.0), vec2(7.0), vec2(6.0), vec2(5.0)); t_1.am[0][0] = vec2(9.0); let _e93 = idx_1; @@ -151,7 +151,7 @@ fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4 { c2_ = array(a_1, i32(b), 3, 4, 5); c2_[(vi + 1u)] = 42; let value = c2_[vi]; - let _e48 = test_arr_as_arg(array,5>(array(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), array(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), array(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), array(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), array(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); + let _e48 = test_arr_as_arg(array,5>()); return vec4((_matrix * vec4(vec4(value))), 2.0); } @@ -161,7 +161,7 @@ fn foo_frag() -> @location(0) vec4 { bar._matrix = mat4x3(vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0)); bar.arr = array,2>(vec2(0u), vec2(1u)); bar.data[1].value = 1; - qux = vec2(0, 0); + qux = vec2(); return vec4(0.0); } diff --git a/tests/out/wgsl/globals.wgsl b/tests/out/wgsl/globals.wgsl index d961db81b2..3ce0be8814 100644 --- a/tests/out/wgsl/globals.wgsl +++ b/tests/out/wgsl/globals.wgsl @@ -39,8 +39,8 @@ fn test_msl_packed_vec3_() { _ = data.v3_; _ = data.v3_.zx; test_msl_packed_vec3_as_arg(data.v3_); - _ = (data.v3_ * mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - _ = (mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) * data.v3_); + _ = (data.v3_ * mat3x3()); + _ = (mat3x3() * data.v3_); _ = (data.v3_ * 2.0); _ = (2.0 * data.v3_); } diff --git a/tests/out/wgsl/math-functions.wgsl b/tests/out/wgsl/math-functions.wgsl index acd925ac9a..5faccba7b8 100644 --- a/tests/out/wgsl/math-functions.wgsl +++ b/tests/out/wgsl/math-functions.wgsl @@ -7,7 +7,7 @@ fn main() { let d = radians(v); let e = saturate(v); let g = refract(v, v, 1.0); - let const_dot = dot(vec2(0, 0), vec2(0, 0)); + let const_dot = dot(vec2(), vec2()); let first_leading_bit_abs = firstLeadingBit(abs(0u)); let flb_a = firstLeadingBit(-1); let flb_b = firstLeadingBit(vec2(-1)); diff --git a/tests/out/wgsl/operators.wgsl b/tests/out/wgsl/operators.wgsl index 4877049274..11e7fd92da 100644 --- a/tests/out/wgsl/operators.wgsl +++ b/tests/out/wgsl/operators.wgsl @@ -53,14 +53,14 @@ fn constructors() -> f32 { _ = vec2(0u); _ = mat2x2(vec2(0.0), vec2(0.0)); _ = array(0, 1, 2, 3); - _ = bool(false); - _ = i32(0); - _ = u32(0u); - _ = f32(0.0); - _ = vec2(vec2(0u, 0u)); - _ = mat2x3(mat2x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - _ = bitcast>(vec2(0u, 0u)); - _ = mat2x3(mat2x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); + _ = bool(bool()); + _ = i32(i32()); + _ = u32(u32()); + _ = f32(f32()); + _ = vec2(vec2()); + _ = mat2x3(mat2x3()); + _ = bitcast>(vec2()); + _ = mat2x3(mat2x3()); let _e71 = foo.a.x; return _e71; } @@ -139,13 +139,13 @@ fn arithmetic() { _ = (vec2(2u) % vec2(1u)); _ = (vec2(2.0) % vec2(1.0)); _ = (vec2(2.0) % vec2(1.0)); - _ = (mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) + mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - _ = (mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) - mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - _ = (mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) * 1.0); - _ = (2.0 * mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - _ = (mat4x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) * vec4(1.0)); - _ = (vec3(2.0) * mat4x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0))); - _ = (mat4x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)) * mat3x4(vec4(0.0, 0.0, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0))); + _ = (mat3x3() + mat3x3()); + _ = (mat3x3() - mat3x3()); + _ = (mat3x3() * 1.0); + _ = (2.0 * mat3x3()); + _ = (mat4x3() * vec4(1.0)); + _ = (vec3(2.0) * mat4x3()); + _ = (mat4x3() * mat3x4()); } fn bit() { @@ -245,7 +245,7 @@ fn assignment() { a_1 = (_e32 + 1); let _e35 = a_1; a_1 = (_e35 - 1); - vec0_ = vec3(0, 0, 0); + vec0_ = vec3(); let _e42 = vec0_.y; vec0_.y = (_e42 + 1); let _e47 = vec0_.y;