From 7abbf53a30e9c03bf3a1119dfa139abf6cb4814d Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 3 Sep 2024 21:57:25 +0000 Subject: [PATCH] [glsl][ir] Add constructor support This Cl adds `Construct` support to the GLSL IR backend. Bug: 42251044 Change-Id: If1354edba3bbfdc6d37936be80a998f6c46da5de Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/204874 Reviewed-by: James Price Commit-Queue: dan sinclair --- src/tint/lang/glsl/writer/BUILD.bazel | 1 + src/tint/lang/glsl/writer/BUILD.cmake | 1 + src/tint/lang/glsl/writer/BUILD.gn | 1 + src/tint/lang/glsl/writer/constructor_test.cc | 655 ++++++++++++++++++ src/tint/lang/glsl/writer/printer/printer.cc | 39 +- .../access/let/vector.wgsl.expected.ir.glsl | 21 +- .../access/var/vector.wgsl.expected.ir.glsl | 21 +- ...function_return_type.wgsl.expected.ir.glsl | 31 +- .../type_initializer.wgsl.expected.ir.glsl | 30 +- .../to_builtin.wgsl.expected.ir.glsl | 21 +- .../to_builtin.wgsl.expected.ir.glsl | 22 +- .../to_builtin.wgsl.expected.ir.glsl | 21 +- .../to_builtin.wgsl.expected.ir.glsl | 22 +- .../to_builtin.wgsl.expected.ir.glsl | 21 +- .../to_builtin.wgsl.expected.ir.glsl | 21 +- .../to_builtin.wgsl.expected.ir.glsl | 21 +- .../to_builtin.wgsl.expected.ir.glsl | 22 +- .../to_builtin.wgsl.expected.ir.glsl | 21 +- .../to_builtin.wgsl.expected.ir.glsl | 22 +- .../to_builtin.wgsl.expected.ir.glsl | 21 +- .../to_builtin.wgsl.expected.ir.glsl | 22 +- .../to_builtin.wgsl.expected.ir.glsl | 21 +- .../chromium/335592006.wgsl.expected.ir.glsl | 18 +- .../bug/tint/1670.spvasm.expected.ir.glsl | 35 +- .../splat/call/bool.wgsl.expected.ir.glsl | 22 +- .../splat/call/f16.wgsl.expected.ir.glsl | 23 +- .../splat/call/f32.wgsl.expected.ir.glsl | 22 +- .../splat/call/i32.wgsl.expected.ir.glsl | 22 +- .../splat/call/u32.wgsl.expected.ir.glsl | 22 +- .../splat/var/bool.wgsl.expected.ir.glsl | 20 +- .../splat/var/f16.wgsl.expected.ir.glsl | 21 +- .../splat/var/f32.wgsl.expected.ir.glsl | 20 +- .../splat/var/i32.wgsl.expected.ir.glsl | 20 +- .../splat/var/u32.wgsl.expected.ir.glsl | 20 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../mat2x2/load/f16.wgsl.expected.ir.glsl | 18 +- .../mat2x2/load/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 22 +- .../identity/f32.wgsl.expected.ir.glsl | 21 +- .../identity/f16.wgsl.expected.ir.glsl | 22 +- .../identity/f32.wgsl.expected.ir.glsl | 21 +- .../mat2x3/load/f16.wgsl.expected.ir.glsl | 22 +- .../mat2x3/load/f32.wgsl.expected.ir.glsl | 21 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../mat2x4/load/f16.wgsl.expected.ir.glsl | 18 +- .../mat2x4/load/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../mat3x2/load/f16.wgsl.expected.ir.glsl | 18 +- .../mat3x2/load/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 23 +- .../identity/f32.wgsl.expected.ir.glsl | 22 +- .../identity/f16.wgsl.expected.ir.glsl | 23 +- .../identity/f32.wgsl.expected.ir.glsl | 22 +- .../mat3x3/load/f16.wgsl.expected.ir.glsl | 23 +- .../mat3x3/load/f32.wgsl.expected.ir.glsl | 22 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../mat3x4/load/f16.wgsl.expected.ir.glsl | 18 +- .../mat3x4/load/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../mat4x2/load/f16.wgsl.expected.ir.glsl | 18 +- .../mat4x2/load/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 24 +- .../identity/f32.wgsl.expected.ir.glsl | 23 +- .../identity/f16.wgsl.expected.ir.glsl | 24 +- .../identity/f32.wgsl.expected.ir.glsl | 23 +- .../mat4x3/load/f16.wgsl.expected.ir.glsl | 24 +- .../mat4x3/load/f32.wgsl.expected.ir.glsl | 23 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../identity/f16.wgsl.expected.ir.glsl | 18 +- .../identity/f32.wgsl.expected.ir.glsl | 17 +- .../mat4x4/load/f16.wgsl.expected.ir.glsl | 18 +- .../mat4x4/load/f32.wgsl.expected.ir.glsl | 17 +- .../mat2x2/stride/16.spvasm.expected.ir.glsl | 52 +- .../type_initializer.wgsl.expected.ir.glsl | 51 +- ...cope_var_conversions.wgsl.expected.ir.glsl | 39 +- ...Basic_OuterProduct.spvasm.expected.ir.glsl | 11 - 92 files changed, 1661 insertions(+), 870 deletions(-) create mode 100644 src/tint/lang/glsl/writer/constructor_test.cc delete mode 100644 test/tint/unittest/reader/spirv/SpvBinaryArithTestBasic_OuterProduct.spvasm.expected.ir.glsl diff --git a/src/tint/lang/glsl/writer/BUILD.bazel b/src/tint/lang/glsl/writer/BUILD.bazel index 1e57c221159..efd5afaf114 100644 --- a/src/tint/lang/glsl/writer/BUILD.bazel +++ b/src/tint/lang/glsl/writer/BUILD.bazel @@ -93,6 +93,7 @@ cc_library( "builtin_test.cc", "call_test.cc", "constant_test.cc", + "constructor_test.cc", "function_test.cc", "if_test.cc", "loop_test.cc", diff --git a/src/tint/lang/glsl/writer/BUILD.cmake b/src/tint/lang/glsl/writer/BUILD.cmake index e19245c92fb..32548c9c7f8 100644 --- a/src/tint/lang/glsl/writer/BUILD.cmake +++ b/src/tint/lang/glsl/writer/BUILD.cmake @@ -107,6 +107,7 @@ tint_add_target(tint_lang_glsl_writer_test test lang/glsl/writer/builtin_test.cc lang/glsl/writer/call_test.cc lang/glsl/writer/constant_test.cc + lang/glsl/writer/constructor_test.cc lang/glsl/writer/function_test.cc lang/glsl/writer/if_test.cc lang/glsl/writer/loop_test.cc diff --git a/src/tint/lang/glsl/writer/BUILD.gn b/src/tint/lang/glsl/writer/BUILD.gn index edef5337356..4d63f4b0c63 100644 --- a/src/tint/lang/glsl/writer/BUILD.gn +++ b/src/tint/lang/glsl/writer/BUILD.gn @@ -97,6 +97,7 @@ if (tint_build_unittests) { "builtin_test.cc", "call_test.cc", "constant_test.cc", + "constructor_test.cc", "function_test.cc", "if_test.cc", "loop_test.cc", diff --git a/src/tint/lang/glsl/writer/constructor_test.cc b/src/tint/lang/glsl/writer/constructor_test.cc new file mode 100644 index 00000000000..3b23d700397 --- /dev/null +++ b/src/tint/lang/glsl/writer/constructor_test.cc @@ -0,0 +1,655 @@ +// Copyright 2024 The Dawn & Tint Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "gmock/gmock.h" +#include "src/tint/lang/glsl/writer/helper_test.h" + +namespace tint::glsl::writer { +namespace { + +using namespace tint::core::fluent_types; // NOLINT +using namespace tint::core::number_suffixes; // NOLINT + +TEST_F(GlslWriterTest, Constructor_Type_Float_Large) { + auto* func = b.Function("a", ty.f32()); + b.Append(func->Block(), [&] { // + // Use a number close to 1<<30 but whose decimal representation ends in 0. + b.Return(func, b.Construct(ty.f32(), f32((1 << 30) - 4))); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +float a() { + return float(1073741824.0f); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Float) { + auto* func = b.Function("a", ty.f32()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.f32(), -1.2e-5_f)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +float a() { + return float(-0.00001200000042445026f); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_F16_Large) { + auto* func = b.Function("a", ty.f16()); + b.Append(func->Block(), [&] { // + // Use a number close to 1<<16 but whose decimal representation ends in 0. + b.Return(func, b.Construct(ty.f16(), f16((1 << 15) - 8))); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +float16_t a() { + return float16_t(32752.0hf); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_F16) { + auto* func = b.Function("a", ty.f16()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.f16(), -1.2e-3_h)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +float16_t a() { + return float16_t(-0.0011997222900390625hf); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Bool_False) { + auto* func = b.Function("a", ty.bool_()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.bool_(), false)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +bool a() { + return bool(false); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Bool_True) { + auto* func = b.Function("a", ty.bool_()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.bool_(), true)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +bool a() { + return bool(true); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Int) { + auto* func = b.Function("a", ty.i32()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.i32(), -12345_i)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +int a() { + return int(-12345); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Uint) { + auto* func = b.Function("a", ty.u32()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.u32(), 12345_u)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +uint a() { + return uint(12345u); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_F32) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.vec3(), 1.0_f, 2.0_f, 3.0_f)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +vec3 a() { + return vec3(1.0f, 2.0f, 3.0f); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_F16) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.vec3(), 1_h, 2_h, 3_h)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +f16vec3 a() { + return f16vec3(1.0hf, 2.0hf, 3.0hf); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_Empty_F32) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.vec3())); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +vec3 a() { + return vec3(0.0f); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_Empty_F16) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.vec3())); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +f16vec3 a() { + return f16vec3(0.0hf); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_SingleScalar_F32_Literal) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Splat(ty.vec3(), 2_f)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +vec3 a() { + return vec3(2.0f); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_SingleScalar_F16_Literal) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Splat(ty.vec3(), 2_h)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +f16vec3 a() { + return f16vec3(2.0hf); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_SingleScalar_F32_Var) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + auto* v = b.Var("v", 2_f); + b.Return(func, b.Construct(ty.vec3(), v)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +vec3 a() { + float v = 2.0f; + return vec3(v); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_SingleScalar_F16_Var) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + auto* v = b.Var("v", 2_h); + b.Return(func, b.Construct(ty.vec3(), v)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +f16vec3 a() { + float16_t v = 2.0hf; + return f16vec3(v); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_SingleScalar_Bool) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Splat(ty.vec3(), true)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +bvec3 a() { + return bvec3(true); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_SingleScalar_Int) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Splat(ty.vec3(), 2_i)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +ivec3 a() { + return ivec3(2); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Vec_SingleScalar_UInt) { + auto* func = b.Function("a", ty.vec3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.vec3(), 2_u)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +uvec3 a() { + return uvec3(2u); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Mat_F32) { + auto* func = b.Function("a", ty.mat2x3()); + b.Append(func->Block(), [&] { // + auto* v1 = b.Let("v1", b.Construct(ty.vec3(), 1_f, 2_f, 3_f)); + auto* v2 = b.Let("v2", b.Construct(ty.vec3(), 3_f, 4_f, 5_f)); + b.Return(func, b.Construct(ty.mat2x3(), v1, v2)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +mat2x3 a() { + vec3 v1 = vec3(1.0f, 2.0f, 3.0f); + vec3 v2 = vec3(3.0f, 4.0f, 5.0f); + return mat2x3(v1, v2); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Mat_F16) { + auto* func = b.Function("a", ty.mat2x3()); + b.Append(func->Block(), [&] { // + auto* v1 = b.Let("v1", b.Construct(ty.vec3(), 1_h, 2_h, 3_h)); + auto* v2 = b.Let("v2", b.Construct(ty.vec3(), 3_h, 4_h, 5_h)); + b.Return(func, b.Construct(ty.mat2x3(), v1, v2)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +f16mat2x3 a() { + f16vec3 v1 = f16vec3(1.0hf, 2.0hf, 3.0hf); + f16vec3 v2 = f16vec3(3.0hf, 4.0hf, 5.0hf); + return f16mat2x3(v1, v2); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Mat_Complex_F32) { + // mat4x4( + // vec4(2.0f, 3.0f, 4.0f, 8.0f), + // vec4(), + // vec4(7.0f), + // vec4(vec4(42.0f, 21.0f, 6.0f, -5.0f)), + // ); + auto* func = b.Function("a", ty.mat4x4()); + b.Append(func->Block(), [&] { // + auto* v1 = b.Construct(ty.vec4(), 2.0_f, 3.0_f, 4.0_f, 8.0_f); + auto* v2 = b.Construct(ty.vec4()); + auto* v3 = b.Splat(ty.vec4(), 7.0_f); + auto* v4 = + b.Construct(ty.vec4(), b.Construct(ty.vec4(), 42.0_f, 21.0_f, 6.0_f, -5.0_f)); + b.Return(func, b.Construct(ty.mat4x4(), v1, v2, v3, v4)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +mat4 a() { + vec4 v = vec4(2.0f, 3.0f, 4.0f, 8.0f); + vec4 v_1 = vec4(0.0f); + return mat4(v, v_1, vec4(7.0f), vec4(vec4(42.0f, 21.0f, 6.0f, -5.0f))); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Mat_Complex_F16) { + // mat4x4( + // vec4(2.0h, 3.0h, 4.0h, 8.0h), + // vec4(), + // vec4(7.0h), + // vec4(vec4(42.0h, 21.0h, 6.0h, -5.0h)), + // ); + auto* func = b.Function("a", ty.mat4x4()); + b.Append(func->Block(), [&] { // + auto* v1 = b.Construct(ty.vec4(), 2.0_h, 3.0_h, 4.0_h, 8.0_h); + auto* v2 = b.Construct(ty.vec4()); + auto* v3 = b.Splat(ty.vec4(), 7.0_h); + auto* v4 = + b.Construct(ty.vec4(), b.Construct(ty.vec4(), 42.0_h, 21.0_h, 6.0_h, -5.0_h)); + b.Return(func, b.Construct(ty.mat4x4(), v1, v2, v3, v4)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +f16mat4 a() { + f16vec4 v = f16vec4(2.0hf, 3.0hf, 4.0hf, 8.0hf); + f16vec4 v_1 = f16vec4(0.0hf); + return f16mat4(v, v_1, f16vec4(7.0hf), f16vec4(f16vec4(42.0hf, 21.0hf, 6.0hf, -5.0hf))); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Mat_Empty_F32) { + auto* func = b.Function("a", ty.mat2x3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.mat2x3())); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +mat2x3 a() { + return mat2x3(vec3(0.0f), vec3(0.0f)); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Mat_Empty_F16) { + auto* func = b.Function("a", ty.mat2x3()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.mat2x3())); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +f16mat2x3 a() { + return f16mat2x3(f16vec3(0.0hf), f16vec3(0.0hf)); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Mat_Identity_F32) { + // fn f() { + // var m_1: mat4x4 = mat4x4(); + // var m_2: mat4x4 = mat4x4(m_1); + // } + + auto* func = b.Function("a", ty.mat4x4()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.mat4x4(), b.Construct(ty.mat4x4()))); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +mat4 a() { + return mat4(mat4(vec4(0.0f), vec4(0.0f), vec4(0.0f), vec4(0.0f))); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Mat_Identity_F16) { + // fn f() { + // var m_1: mat4x4 = mat4x4(); + // var m_2: mat4x4 = mat4x4(m_1); + // } + + auto* func = b.Function("a", ty.mat4x4()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.mat4x4(), b.Construct(ty.mat4x4()))); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"(#extension GL_AMD_gpu_shader_half_float: require + +f16mat4 a() { + return f16mat4(f16mat4(f16vec4(0.0hf), f16vec4(0.0hf), f16vec4(0.0hf), f16vec4(0.0hf))); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Array) { + auto* func = b.Function("a", ty.array, 3>()); + b.Append(func->Block(), [&] { // + auto* v1 = b.Let("v1", b.Construct(ty.vec3(), 1_f, 2_f, 3_f)); + auto* v2 = b.Let("v2", b.Construct(ty.vec3(), 4_f, 5_f, 6_f)); + auto* v3 = b.Let("v3", b.Construct(ty.vec3(), 7_f, 8_f, 9_f)); + b.Return(func, b.Construct(ty.array, 3>(), v1, v2, v3)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +vec3[3] a() { + vec3 v1 = vec3(1.0f, 2.0f, 3.0f); + vec3 v2 = vec3(4.0f, 5.0f, 6.0f); + vec3 v3 = vec3(7.0f, 8.0f, 9.0f); + return vec3[3](v1, v2, v3); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Array_Empty) { + auto* func = b.Function("a", ty.array, 3>()); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(ty.array, 3>())); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +vec3[3] a() { + return vec3[3](vec3(0.0f), vec3(0.0f), vec3(0.0f)); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Struct) { + auto* str = ty.Struct(mod.symbols.New("S"), { + {mod.symbols.New("a"), ty.i32()}, + {mod.symbols.New("b"), ty.f32()}, + {mod.symbols.New("c"), ty.vec3()}, + }); + + auto* func = b.Function("a", str); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(str, 1_i, 2_f, b.Construct(ty.vec3(), 3_i, 4_i, 5_i))); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +struct S { + int a; + float b; + ivec3 c; +}; + +S a() { + return S(1, 2.0f, ivec3(3, 4, 5)); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +TEST_F(GlslWriterTest, Constructor_Type_Struct_Empty) { + auto* str = ty.Struct(mod.symbols.New("S"), { + {mod.symbols.New("a"), ty.i32()}, + {mod.symbols.New("b"), ty.f32()}, + {mod.symbols.New("c"), ty.vec3()}, + }); + + auto* func = b.Function("a", str); + b.Append(func->Block(), [&] { // + b.Return(func, b.Construct(str)); + }); + + ASSERT_TRUE(Generate()) << err_ << output_.glsl; + EXPECT_EQ(output_.glsl, GlslHeader() + R"( +struct S { + int a; + float b; + ivec3 c; +}; + +S a() { + return S(0, 0.0f, ivec3(0)); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} +)"); +} + +} // namespace +} // namespace tint::glsl::writer diff --git a/src/tint/lang/glsl/writer/printer/printer.cc b/src/tint/lang/glsl/writer/printer/printer.cc index e0cbd40d587..54b93578fa0 100644 --- a/src/tint/lang/glsl/writer/printer/printer.cc +++ b/src/tint/lang/glsl/writer/printer/printer.cc @@ -799,8 +799,9 @@ class Printer : public tint::TextGenerator { [&](const core::ir::Constant* c) { EmitConstant(out, c); }, [&](const core::ir::InstructionResult* r) { tint::Switch( - r->Instruction(), // - [&](const core::ir::Access* a) { EmitAccess(out, a); }, // + r->Instruction(), // + [&](const core::ir::Access* a) { EmitAccess(out, a); }, + [&](const core::ir::Construct* c) { EmitConstruct(out, c); }, [&](const core::ir::CoreBinary* b) { EmitBinary(out, b); }, [&](const core::ir::CoreBuiltinCall* c) { EmitCoreBuiltinCall(out, c); }, [&](const core::ir::CoreUnary* u) { EmitUnary(out, u); }, @@ -819,6 +820,40 @@ class Printer : public tint::TextGenerator { TINT_ICE_ON_NO_MATCH); } + /// Emit a constructor + void EmitConstruct(StringStream& out, const core::ir::Construct* c) { + if (c->Args().IsEmpty()) { + EmitZeroValue(out, c->Result(0)->Type()); + return; + } + + auto emit_args = [&]() { + out << "("; + + size_t i = 0; + for (auto* arg : c->Args()) { + if (i > 0) { + out << ", "; + } + EmitValue(out, arg); + i++; + } + out << ")"; + }; + + Switch( + c->Result(0)->Type(), + [&](const core::type::Struct* struct_ty) { + EmitStructType(struct_ty); + out << StructName(struct_ty); + emit_args(); + }, + [&](Default) { + EmitType(out, c->Result(0)->Type()); + emit_args(); + }); + } + /// Emit Load /// @param out the output stream to write to /// @param load the load diff --git a/test/tint/access/let/vector.wgsl.expected.ir.glsl b/test/tint/access/let/vector.wgsl.expected.ir.glsl index 1e74e7747e7..7f8f5420e90 100644 --- a/test/tint/access/let/vector.wgsl.expected.ir.glsl +++ b/test/tint/access/let/vector.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Access -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +vec3 s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + float scalar = v[1u]; + vec2 swizzle2 = v.xz; + vec3 swizzle3 = v.xzy; + vec3 v_1 = vec3(scalar); + s = ((v_1 + vec3(swizzle2, 1.0f)) + swizzle3); +} diff --git a/test/tint/access/var/vector.wgsl.expected.ir.glsl b/test/tint/access/var/vector.wgsl.expected.ir.glsl index 4a20bc7c4e6..5090881647e 100644 --- a/test/tint/access/var/vector.wgsl.expected.ir.glsl +++ b/test/tint/access/var/vector.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::LoadVectorElement -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +vec3 s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + vec3 v = vec3(0.0f); + float scalar = v.y; + vec2 swizzle2 = v.xz; + vec3 swizzle3 = v.xzy; + vec3 v_1 = vec3(scalar); + s = ((v_1 + vec3(swizzle2, 1.0f)) + swizzle3); +} diff --git a/test/tint/array/function_return_type.wgsl.expected.ir.glsl b/test/tint/array/function_return_type.wgsl.expected.ir.glsl index 37c14ad20ce..0a089a1b616 100644 --- a/test/tint/array/function_return_type.wgsl.expected.ir.glsl +++ b/test/tint/array/function_return_type.wgsl.expected.ir.glsl @@ -1,11 +1,22 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +float s; +float[4] f1() { + return float[4](0.0f, 0.0f, 0.0f, 0.0f); +} +float[3][4] f2() { + float v[4] = f1(); + float v_1[4] = f1(); + return float[3][4](v, v_1, f1()); +} +float[2][3][4] f3() { + float v_2[3][4] = f2(); + return float[2][3][4](v_2, f2()); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + float a1[4] = f1(); + float a2[3][4] = f2(); + float a3[2][3][4] = f3(); + s = ((a1[0] + a2[0][0]) + a3[0][0][0]); +} diff --git a/test/tint/array/type_initializer.wgsl.expected.ir.glsl b/test/tint/array/type_initializer.wgsl.expected.ir.glsl index 37c14ad20ce..0538df1661c 100644 --- a/test/tint/array/type_initializer.wgsl.expected.ir.glsl +++ b/test/tint/array/type_initializer.wgsl.expected.ir.glsl @@ -1,11 +1,21 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +int s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + int x = 42; + int empty[4] = int[4](0, 0, 0, 0); + int nonempty[4] = int[4](1, 2, 3, 4); + int nonempty_with_expr[4] = int[4](1, x, (x + 1), nonempty[3]); + int nested_empty[2][3][4] = int[2][3][4](int[3][4](int[4](0, 0, 0, 0), int[4](0, 0, 0, 0), int[4](0, 0, 0, 0)), int[3][4](int[4](0, 0, 0, 0), int[4](0, 0, 0, 0), int[4](0, 0, 0, 0))); + int nested_nonempty[2][3][4] = int[2][3][4](int[3][4](int[4](1, 2, 3, 4), int[4](5, 6, 7, 8), int[4](9, 10, 11, 12)), int[3][4](int[4](13, 14, 15, 16), int[4](17, 18, 19, 20), int[4](21, 22, 23, 24))); + int v[4] = int[4](1, 2, x, (x + 1)); + int nested_nonempty_with_expr[2][3][4] = int[2][3][4](int[3][4](v, int[4](5, 6, nonempty[2], (nonempty[3] + 1)), nonempty), nested_nonempty[1]); + int subexpr_empty = 0; + int subexpr_nonempty = 3; + int subexpr_nonempty_with_expr = int[4](1, x, (x + 1), nonempty[3])[2]; + int subexpr_nested_empty[4] = int[4](0, 0, 0, 0); + int subexpr_nested_nonempty[4] = int[4](5, 6, 7, 8); + int subexpr_nested_nonempty_with_expr[4] = int[2][4](int[4](1, x, (x + 1), nonempty[3]), nested_nonempty[1][2])[1]; + s = (((((((((((empty[0] + nonempty[0]) + nonempty_with_expr[0]) + nested_empty[0][0][0]) + nested_nonempty[0][0][0]) + nested_nonempty_with_expr[0][0][0]) + subexpr_empty) + subexpr_nonempty) + subexpr_nonempty_with_expr) + subexpr_nested_empty[0]) + subexpr_nested_nonempty[0]) + subexpr_nested_nonempty_with_expr[0]); +} diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..35e69b0e399 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform mat2 u[4]; +float s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat2 t = transpose(u[2]); + float l = length(u[0][1].yx); + float a = abs(u[0][1].yx[0u]); + float v = (t[0][0u] + float(l)); + s = (v + float(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..ed7bbb89f72 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform f16mat2x3 u[4]; +float16_t s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat3x2 t = transpose(u[2]); + float16_t l = length(u[0][1].zxy); + float16_t a = abs(u[0][1].zxy[0u]); + float16_t v = float16_t(a); + s = ((v + float16_t(l)) + t[0][0u]); +} diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..c4060b55945 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform mat2x3 u[4]; +float s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat3x2 t = transpose(u[2]); + float l = length(u[0][1].zxy); + float a = abs(u[0][1].zxy[0u]); + float v = (t[0][0u] + float(l)); + s = (v + float(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..549bfb161d3 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform f16mat2x4 u[4]; +float16_t s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat4x2 t = transpose(u[2]); + float16_t l = length(u[0][1].ywxz); + float16_t a = abs(u[0][1].ywxz[0u]); + float16_t v = (t[0][0u] + float16_t(l)); + s = (v + float16_t(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..5053603c224 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform mat2x4 u[4]; +float s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat4x2 t = transpose(u[2]); + float l = length(u[0][1].ywxz); + float a = abs(u[0][1].ywxz[0u]); + float v = (t[0][0u] + float(l)); + s = (v + float(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..4e7d27bc2dd 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform mat3 u[4]; +float s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat3 t = transpose(u[2]); + float l = length(u[0][1].zxy); + float a = abs(u[0][1].zxy[0u]); + float v = (t[0][0u] + float(l)); + s = (v + float(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..97c369c44d5 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform mat3x4 u[4]; +float s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat4x3 t = transpose(u[2]); + float l = length(u[0][1].ywxz); + float a = abs(u[0][1].ywxz[0u]); + float v = (t[0][0u] + float(l)); + s = (v + float(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..6be925f069d 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform f16mat4x2 u[4]; +float16_t s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat2x4 t = transpose(u[2]); + float16_t l = length(u[0][1].yx); + float16_t a = abs(u[0][1].yx[0u]); + float16_t v = (t[0][0u] + float16_t(l)); + s = (v + float16_t(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..544d3de564c 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform mat4x2 u[4]; +float s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat2x4 t = transpose(u[2]); + float l = length(u[0][1].yx); + float a = abs(u[0][1].yx[0u]); + float v = (t[0][0u] + float(l)); + s = (v + float(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..3f9e0b6db64 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform f16mat4x3 u[4]; +float16_t s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat3x4 t = transpose(u[2]); + float16_t l = length(u[0][1].zxy); + float16_t a = abs(u[0][1].zxy[0u]); + float16_t v = (t[0][0u] + float16_t(l)); + s = (v + float16_t(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..881319b6637 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform mat4x3 u[4]; +float s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat3x4 t = transpose(u[2]); + float l = length(u[0][1].zxy); + float a = abs(u[0][1].zxy[0u]); + float v = (t[0][0u] + float(l)); + s = (v + float(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..c10c3931fbc 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform f16mat4 u[4]; +float16_t s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat4 t = transpose(u[2]); + float16_t l = length(u[0][1].ywxz); + float16_t a = abs(u[0][1].ywxz[0u]); + float16_t v = (t[0][0u] + float16_t(l)); + s = (v + float16_t(a)); +} diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.ir.glsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.ir.glsl index 6c6485eeae3..36890750875 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.ir.glsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBuiltinCall -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uniform mat4 u[4]; +float s; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat4 t = transpose(u[2]); + float l = length(u[0][1].ywxz); + float a = abs(u[0][1].ywxz[0u]); + float v = (t[0][0u] + float(l)); + s = (v + float(a)); +} diff --git a/test/tint/bug/chromium/335592006.wgsl.expected.ir.glsl b/test/tint/bug/chromium/335592006.wgsl.expected.ir.glsl index 37c14ad20ce..dfd7adb989f 100644 --- a/test/tint/bug/chromium/335592006.wgsl.expected.ir.glsl +++ b/test/tint/bug/chromium/335592006.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +void f() { + int a = 1; + int(a); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/bug/tint/1670.spvasm.expected.ir.glsl b/test/tint/bug/tint/1670.spvasm.expected.ir.glsl index ae9b6d06762..81458be2397 100644 --- a/test/tint/bug/tint/1670.spvasm.expected.ir.glsl +++ b/test/tint/bug/tint/1670.spvasm.expected.ir.glsl @@ -1,11 +1,28 @@ -SKIP: FAILED +#version 310 es +precision highp float; +precision highp int; -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::CoreBinary -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** -tint executable returned error: signal: illegal instruction +void main_1() { + mat2 m2i = mat2(vec2(0.0f), vec2(0.0f)); + mat2 m2 = mat2(vec2(0.0f), vec2(0.0f)); + mat3 m3i = mat3(vec3(0.0f), vec3(0.0f), vec3(0.0f)); + mat3 m3 = mat3(vec3(0.0f), vec3(0.0f), vec3(0.0f)); + mat4 m4i = mat4(vec4(0.0f), vec4(0.0f), vec4(0.0f), vec4(0.0f)); + mat4 m4 = mat4(vec4(0.0f), vec4(0.0f), vec4(0.0f), vec4(0.0f)); + float s = (1.0f / determinant(m2)); + vec2 v = vec2((s * m2[1u].y), (-(s) * m2[0u].y)); + m2i = mat2(v, vec2((-(s) * m2[1u].x), (s * m2[0u].x))); + float v_1 = (1.0f / determinant(m3)); + vec3 v_2 = vec3(((m3[1u].y * m3[2u].z) - (m3[1u].z * m3[2u].y)), ((m3[0u].z * m3[2u].y) - (m3[0u].y * m3[2u].z)), ((m3[0u].y * m3[1u].z) - (m3[0u].z * m3[1u].y))); + vec3 v_3 = vec3(((m3[1u].z * m3[2u].x) - (m3[1u].x * m3[2u].z)), ((m3[0u].x * m3[2u].z) - (m3[0u].z * m3[2u].x)), ((m3[0u].z * m3[1u].x) - (m3[0u].x * m3[1u].z))); + m3i = (v_1 * mat3(v_2, v_3, vec3(((m3[1u].x * m3[2u].y) - (m3[1u].y * m3[2u].x)), ((m3[0u].y * m3[2u].x) - (m3[0u].x * m3[2u].y)), ((m3[0u].x * m3[1u].y) - (m3[0u].y * m3[1u].x))))); + float v_4 = (1.0f / determinant(m4)); + vec4 v_5 = vec4((((m4[1u].y * ((m4[2u].z * m4[3u].w) - (m4[2u].w * m4[3u].z))) - (m4[1u].z * ((m4[2u].y * m4[3u].w) - (m4[2u].w * m4[3u].y)))) + (m4[1u].w * ((m4[2u].y * m4[3u].z) - (m4[2u].z * m4[3u].y)))), (((-(m4[0u].y) * ((m4[2u].z * m4[3u].w) - (m4[2u].w * m4[3u].z))) + (m4[0u].z * ((m4[2u].y * m4[3u].w) - (m4[2u].w * m4[3u].y)))) - (m4[0u].w * ((m4[2u].y * m4[3u].z) - (m4[2u].z * m4[3u].y)))), (((m4[0u].y * ((m4[1u].z * m4[3u].w) - (m4[1u].w * m4[3u].z))) - (m4[0u].z * ((m4[1u].y * m4[3u].w) - (m4[1u].w * m4[3u].y)))) + (m4[0u].w * ((m4[1u].y * m4[3u].z) - (m4[1u].z * m4[3u].y)))), (((-(m4[0u].y) * ((m4[1u].z * m4[2u].w) - (m4[1u].w * m4[2u].z))) + (m4[0u].z * ((m4[1u].y * m4[2u].w) - (m4[1u].w * m4[2u].y)))) - (m4[0u].w * ((m4[1u].y * m4[2u].z) - (m4[1u].z * m4[2u].y))))); + vec4 v_6 = vec4((((-(m4[1u].x) * ((m4[2u].z * m4[3u].w) - (m4[2u].w * m4[3u].z))) + (m4[1u].z * ((m4[2u].x * m4[3u].w) - (m4[2u].w * m4[3u].x)))) - (m4[1u].w * ((m4[2u].x * m4[3u].z) - (m4[2u].z * m4[3u].x)))), (((m4[0u].x * ((m4[2u].z * m4[3u].w) - (m4[2u].w * m4[3u].z))) - (m4[0u].z * ((m4[2u].x * m4[3u].w) - (m4[2u].w * m4[3u].x)))) + (m4[0u].w * ((m4[2u].x * m4[3u].z) - (m4[2u].z * m4[3u].x)))), (((-(m4[0u].x) * ((m4[1u].z * m4[3u].w) - (m4[1u].w * m4[3u].z))) + (m4[0u].z * ((m4[1u].x * m4[3u].w) - (m4[1u].w * m4[3u].x)))) - (m4[0u].w * ((m4[1u].x * m4[3u].z) - (m4[1u].z * m4[3u].x)))), (((m4[0u].x * ((m4[1u].z * m4[2u].w) - (m4[1u].w * m4[2u].z))) - (m4[0u].z * ((m4[1u].x * m4[2u].w) - (m4[1u].w * m4[2u].x)))) + (m4[0u].w * ((m4[1u].x * m4[2u].z) - (m4[1u].z * m4[2u].x))))); + vec4 v_7 = vec4((((m4[1u].x * ((m4[2u].y * m4[3u].w) - (m4[2u].w * m4[3u].y))) - (m4[1u].y * ((m4[2u].x * m4[3u].w) - (m4[2u].w * m4[3u].x)))) + (m4[1u].w * ((m4[2u].x * m4[3u].y) - (m4[2u].y * m4[3u].x)))), (((-(m4[0u].x) * ((m4[2u].y * m4[3u].w) - (m4[2u].w * m4[3u].y))) + (m4[0u].y * ((m4[2u].x * m4[3u].w) - (m4[2u].w * m4[3u].x)))) - (m4[0u].w * ((m4[2u].x * m4[3u].y) - (m4[2u].y * m4[3u].x)))), (((m4[0u].x * ((m4[1u].y * m4[3u].w) - (m4[1u].w * m4[3u].y))) - (m4[0u].y * ((m4[1u].x * m4[3u].w) - (m4[1u].w * m4[3u].x)))) + (m4[0u].w * ((m4[1u].x * m4[3u].y) - (m4[1u].y * m4[3u].x)))), (((-(m4[0u].x) * ((m4[1u].y * m4[2u].w) - (m4[1u].w * m4[2u].y))) + (m4[0u].y * ((m4[1u].x * m4[2u].w) - (m4[1u].w * m4[2u].x)))) - (m4[0u].w * ((m4[1u].x * m4[2u].y) - (m4[1u].y * m4[2u].x))))); + m4i = (v_4 * mat4(v_5, v_6, v_7, vec4((((-(m4[1u].x) * ((m4[2u].y * m4[3u].z) - (m4[2u].z * m4[3u].y))) + (m4[1u].y * ((m4[2u].x * m4[3u].z) - (m4[2u].z * m4[3u].x)))) - (m4[1u].z * ((m4[2u].x * m4[3u].y) - (m4[2u].y * m4[3u].x)))), (((m4[0u].x * ((m4[2u].y * m4[3u].z) - (m4[2u].z * m4[3u].y))) - (m4[0u].y * ((m4[2u].x * m4[3u].z) - (m4[2u].z * m4[3u].x)))) + (m4[0u].z * ((m4[2u].x * m4[3u].y) - (m4[2u].y * m4[3u].x)))), (((-(m4[0u].x) * ((m4[1u].y * m4[3u].z) - (m4[1u].z * m4[3u].y))) + (m4[0u].y * ((m4[1u].x * m4[3u].z) - (m4[1u].z * m4[3u].x)))) - (m4[0u].z * ((m4[1u].x * m4[3u].y) - (m4[1u].y * m4[3u].x)))), (((m4[0u].x * ((m4[1u].y * m4[2u].z) - (m4[1u].z * m4[2u].y))) - (m4[0u].y * ((m4[1u].x * m4[2u].z) - (m4[1u].z * m4[2u].x)))) + (m4[0u].z * ((m4[1u].x * m4[2u].y) - (m4[1u].y * m4[2u].x))))))); +} +void main() { + main_1(); +} diff --git a/test/tint/expressions/splat/call/bool.wgsl.expected.ir.glsl b/test/tint/expressions/splat/call/bool.wgsl.expected.ir.glsl index 37c14ad20ce..c27af70e0cb 100644 --- a/test/tint/expressions/splat/call/bool.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/call/bool.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +bool get_bool() { + return true; +} +void f() { + bvec2 v2 = bvec2(get_bool()); + bvec3 v3 = bvec3(get_bool()); + bvec4 v4 = bvec4(get_bool()); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/splat/call/f16.wgsl.expected.ir.glsl b/test/tint/expressions/splat/call/f16.wgsl.expected.ir.glsl index 37c14ad20ce..a563774aee4 100644 --- a/test/tint/expressions/splat/call/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/call/f16.wgsl.expected.ir.glsl @@ -1,11 +1,14 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +float16_t get_f16() { + return 1.0hf; +} +void f() { + f16vec2 v2 = f16vec2(get_f16()); + f16vec3 v3 = f16vec3(get_f16()); + f16vec4 v4 = f16vec4(get_f16()); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/splat/call/f32.wgsl.expected.ir.glsl b/test/tint/expressions/splat/call/f32.wgsl.expected.ir.glsl index 37c14ad20ce..1753c89986a 100644 --- a/test/tint/expressions/splat/call/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/call/f32.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +float get_f32() { + return 1.0f; +} +void f() { + vec2 v2 = vec2(get_f32()); + vec3 v3 = vec3(get_f32()); + vec4 v4 = vec4(get_f32()); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/splat/call/i32.wgsl.expected.ir.glsl b/test/tint/expressions/splat/call/i32.wgsl.expected.ir.glsl index 37c14ad20ce..ad817a4ca7c 100644 --- a/test/tint/expressions/splat/call/i32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/call/i32.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +int get_i32() { + return 1; +} +void f() { + ivec2 v2 = ivec2(get_i32()); + ivec3 v3 = ivec3(get_i32()); + ivec4 v4 = ivec4(get_i32()); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/splat/call/u32.wgsl.expected.ir.glsl b/test/tint/expressions/splat/call/u32.wgsl.expected.ir.glsl index 37c14ad20ce..8ec014cfbd6 100644 --- a/test/tint/expressions/splat/call/u32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/call/u32.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +uint get_u32() { + return 1u; +} +void f() { + uvec2 v2 = uvec2(get_u32()); + uvec3 v3 = uvec3(get_u32()); + uvec4 v4 = uvec4(get_u32()); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/splat/var/bool.wgsl.expected.ir.glsl b/test/tint/expressions/splat/var/bool.wgsl.expected.ir.glsl index 37c14ad20ce..d87b7417fba 100644 --- a/test/tint/expressions/splat/var/bool.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/var/bool.wgsl.expected.ir.glsl @@ -1,11 +1,11 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +void f() { + bool v = true; + bvec2 v2 = bvec2(v); + bvec3 v3 = bvec3(v); + bvec4 v4 = bvec4(v); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/splat/var/f16.wgsl.expected.ir.glsl b/test/tint/expressions/splat/var/f16.wgsl.expected.ir.glsl index 37c14ad20ce..5a822c5cffd 100644 --- a/test/tint/expressions/splat/var/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/var/f16.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +void f() { + float16_t v = 3.0hf; + f16vec2 v2 = f16vec2(v); + f16vec3 v3 = f16vec3(v); + f16vec4 v4 = f16vec4(v); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/splat/var/f32.wgsl.expected.ir.glsl b/test/tint/expressions/splat/var/f32.wgsl.expected.ir.glsl index 37c14ad20ce..ab80de6eaa8 100644 --- a/test/tint/expressions/splat/var/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/var/f32.wgsl.expected.ir.glsl @@ -1,11 +1,11 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +void f() { + float v = 3.0f; + vec2 v2 = vec2(v); + vec3 v3 = vec3(v); + vec4 v4 = vec4(v); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/splat/var/i32.wgsl.expected.ir.glsl b/test/tint/expressions/splat/var/i32.wgsl.expected.ir.glsl index 37c14ad20ce..a7eb40eacaf 100644 --- a/test/tint/expressions/splat/var/i32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/var/i32.wgsl.expected.ir.glsl @@ -1,11 +1,11 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +void f() { + int v = 3; + ivec2 v2 = ivec2(v); + ivec3 v3 = ivec3(v); + ivec4 v4 = ivec4(v); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/splat/var/u32.wgsl.expected.ir.glsl b/test/tint/expressions/splat/var/u32.wgsl.expected.ir.glsl index 37c14ad20ce..da0dcfe4c91 100644 --- a/test/tint/expressions/splat/var/u32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/splat/var/u32.wgsl.expected.ir.glsl @@ -1,11 +1,11 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +void f() { + uint v = 3u; + uvec2 v2 = uvec2(v); + uvec3 v3 = uvec3(v); + uvec4 v4 = uvec4(v); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { +} diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..7b1eb2e67d3 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat2 m = f16mat2(f16vec2(0.0hf, 1.0hf), f16vec2(2.0hf, 3.0hf)); +f16mat2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat2(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..708da53549a 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat2 m = mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); +mat2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat2(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..7b1eb2e67d3 100644 --- a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat2 m = f16mat2(f16vec2(0.0hf, 1.0hf), f16vec2(2.0hf, 3.0hf)); +f16mat2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat2(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..708da53549a 100644 --- a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat2 m = mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); +mat2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat2(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x2/load/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x2/load/f16.wgsl.expected.ir.glsl index d4bb1c94be9..54a92831c96 100644 --- a/test/tint/expressions/type_ctor/mat2x2/load/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x2/load/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat2 m = f16mat2(f16vec2(0.0hf), f16vec2(0.0hf)); + tint_symbol = f16mat2(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x2/load/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x2/load/f32.wgsl.expected.ir.glsl index d4bb1c94be9..44aa841ba65 100644 --- a/test/tint/expressions/type_ctor/mat2x2/load/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x2/load/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat2 m = mat2(vec2(0.0f), vec2(0.0f)); + tint_symbol = mat2(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f16.wgsl.expected.ir.glsl index 37c14ad20ce..e61f07241fb 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat2x3 m = f16mat2x3(f16vec3(0.0hf, 1.0hf, 2.0hf), f16vec3(3.0hf, 4.0hf, 5.0hf)); +f16mat2x3 tint_symbol; +void tint_store_and_preserve_padding(inout f16mat2x3 target, f16mat2x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, f16mat2x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.ir.glsl index 37c14ad20ce..402494e711a 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat2x3 m = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); +mat2x3 tint_symbol; +void tint_store_and_preserve_padding(inout mat2x3 target, mat2x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, mat2x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f16.wgsl.expected.ir.glsl index 37c14ad20ce..e61f07241fb 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat2x3 m = f16mat2x3(f16vec3(0.0hf, 1.0hf, 2.0hf), f16vec3(3.0hf, 4.0hf, 5.0hf)); +f16mat2x3 tint_symbol; +void tint_store_and_preserve_padding(inout f16mat2x3 target, f16mat2x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, f16mat2x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.ir.glsl index 37c14ad20ce..402494e711a 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat2x3 m = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); +mat2x3 tint_symbol; +void tint_store_and_preserve_padding(inout mat2x3 target, mat2x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, mat2x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat2x3/load/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x3/load/f16.wgsl.expected.ir.glsl index 37c14ad20ce..3d54305c96f 100644 --- a/test/tint/expressions/type_ctor/mat2x3/load/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x3/load/f16.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat2x3 tint_symbol; +void tint_store_and_preserve_padding(inout f16mat2x3 target, f16mat2x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat2x3 m = f16mat2x3(f16vec3(0.0hf), f16vec3(0.0hf)); + tint_store_and_preserve_padding(tint_symbol, f16mat2x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat2x3/load/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x3/load/f32.wgsl.expected.ir.glsl index 37c14ad20ce..533a6ee425a 100644 --- a/test/tint/expressions/type_ctor/mat2x3/load/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x3/load/f32.wgsl.expected.ir.glsl @@ -1,11 +1,12 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat2x3 tint_symbol; +void tint_store_and_preserve_padding(inout mat2x3 target, mat2x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat2x3 m = mat2x3(vec3(0.0f), vec3(0.0f)); + tint_store_and_preserve_padding(tint_symbol, mat2x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..ffa11f943f3 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat2x4 m = f16mat2x4(f16vec4(0.0hf, 1.0hf, 2.0hf, 3.0hf), f16vec4(4.0hf, 5.0hf, 6.0hf, 7.0hf)); +f16mat2x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat2x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..7baebce1133 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat2x4 m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); +mat2x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat2x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..ffa11f943f3 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat2x4 m = f16mat2x4(f16vec4(0.0hf, 1.0hf, 2.0hf, 3.0hf), f16vec4(4.0hf, 5.0hf, 6.0hf, 7.0hf)); +f16mat2x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat2x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..7baebce1133 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat2x4 m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); +mat2x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat2x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x4/load/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x4/load/f16.wgsl.expected.ir.glsl index d4bb1c94be9..2d8a755f0a7 100644 --- a/test/tint/expressions/type_ctor/mat2x4/load/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x4/load/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat2x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat2x4 m = f16mat2x4(f16vec4(0.0hf), f16vec4(0.0hf)); + tint_symbol = f16mat2x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat2x4/load/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat2x4/load/f32.wgsl.expected.ir.glsl index d4bb1c94be9..bc2d55af4bc 100644 --- a/test/tint/expressions/type_ctor/mat2x4/load/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat2x4/load/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat2x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat2x4 m = mat2x4(vec4(0.0f), vec4(0.0f)); + tint_symbol = mat2x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..6f8569d6b9b 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat3x2 m = f16mat3x2(f16vec2(0.0hf, 1.0hf), f16vec2(2.0hf, 3.0hf), f16vec2(4.0hf, 5.0hf)); +f16mat3x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat3x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..9805917726e 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat3x2 m = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); +mat3x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat3x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..6f8569d6b9b 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat3x2 m = f16mat3x2(f16vec2(0.0hf, 1.0hf), f16vec2(2.0hf, 3.0hf), f16vec2(4.0hf, 5.0hf)); +f16mat3x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat3x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..9805917726e 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat3x2 m = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); +mat3x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat3x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x2/load/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x2/load/f16.wgsl.expected.ir.glsl index d4bb1c94be9..8c64b4b2eb9 100644 --- a/test/tint/expressions/type_ctor/mat3x2/load/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x2/load/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat3x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat3x2 m = f16mat3x2(f16vec2(0.0hf), f16vec2(0.0hf), f16vec2(0.0hf)); + tint_symbol = f16mat3x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x2/load/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x2/load/f32.wgsl.expected.ir.glsl index d4bb1c94be9..1614fe7aa71 100644 --- a/test/tint/expressions/type_ctor/mat3x2/load/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x2/load/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat3x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat3x2 m = mat3x2(vec2(0.0f), vec2(0.0f), vec2(0.0f)); + tint_symbol = mat3x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f16.wgsl.expected.ir.glsl index 37c14ad20ce..4f544a01376 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,14 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat3 m = f16mat3(f16vec3(0.0hf, 1.0hf, 2.0hf), f16vec3(3.0hf, 4.0hf, 5.0hf), f16vec3(6.0hf, 7.0hf, 8.0hf)); +f16mat3 tint_symbol; +void tint_store_and_preserve_padding(inout f16mat3 target, f16mat3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, f16mat3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.ir.glsl index 37c14ad20ce..acb79fd63c4 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat3 m = mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); +mat3 tint_symbol; +void tint_store_and_preserve_padding(inout mat3 target, mat3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, mat3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f16.wgsl.expected.ir.glsl index 37c14ad20ce..4f544a01376 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,14 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat3 m = f16mat3(f16vec3(0.0hf, 1.0hf, 2.0hf), f16vec3(3.0hf, 4.0hf, 5.0hf), f16vec3(6.0hf, 7.0hf, 8.0hf)); +f16mat3 tint_symbol; +void tint_store_and_preserve_padding(inout f16mat3 target, f16mat3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, f16mat3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.ir.glsl index 37c14ad20ce..acb79fd63c4 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat3 m = mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); +mat3 tint_symbol; +void tint_store_and_preserve_padding(inout mat3 target, mat3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, mat3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat3x3/load/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x3/load/f16.wgsl.expected.ir.glsl index 37c14ad20ce..6c801e15ee3 100644 --- a/test/tint/expressions/type_ctor/mat3x3/load/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x3/load/f16.wgsl.expected.ir.glsl @@ -1,11 +1,14 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat3 tint_symbol; +void tint_store_and_preserve_padding(inout f16mat3 target, f16mat3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat3 m = f16mat3(f16vec3(0.0hf), f16vec3(0.0hf), f16vec3(0.0hf)); + tint_store_and_preserve_padding(tint_symbol, f16mat3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat3x3/load/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x3/load/f32.wgsl.expected.ir.glsl index 37c14ad20ce..78082f674ce 100644 --- a/test/tint/expressions/type_ctor/mat3x3/load/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x3/load/f32.wgsl.expected.ir.glsl @@ -1,11 +1,13 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat3 tint_symbol; +void tint_store_and_preserve_padding(inout mat3 target, mat3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat3 m = mat3(vec3(0.0f), vec3(0.0f), vec3(0.0f)); + tint_store_and_preserve_padding(tint_symbol, mat3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..c4061bc94fd 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat3x4 m = f16mat3x4(f16vec4(0.0hf, 1.0hf, 2.0hf, 3.0hf), f16vec4(4.0hf, 5.0hf, 6.0hf, 7.0hf), f16vec4(8.0hf, 9.0hf, 10.0hf, 11.0hf)); +f16mat3x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat3x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..69064494a5e 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat3x4 m = mat3x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f)); +mat3x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat3x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..c4061bc94fd 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat3x4 m = f16mat3x4(f16vec4(0.0hf, 1.0hf, 2.0hf, 3.0hf), f16vec4(4.0hf, 5.0hf, 6.0hf, 7.0hf), f16vec4(8.0hf, 9.0hf, 10.0hf, 11.0hf)); +f16mat3x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat3x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..69064494a5e 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat3x4 m = mat3x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f)); +mat3x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat3x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x4/load/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x4/load/f16.wgsl.expected.ir.glsl index d4bb1c94be9..32b22c20707 100644 --- a/test/tint/expressions/type_ctor/mat3x4/load/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x4/load/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat3x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat3x4 m = f16mat3x4(f16vec4(0.0hf), f16vec4(0.0hf), f16vec4(0.0hf)); + tint_symbol = f16mat3x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat3x4/load/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat3x4/load/f32.wgsl.expected.ir.glsl index d4bb1c94be9..8703a406057 100644 --- a/test/tint/expressions/type_ctor/mat3x4/load/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat3x4/load/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat3x4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat3x4 m = mat3x4(vec4(0.0f), vec4(0.0f), vec4(0.0f)); + tint_symbol = mat3x4(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..eeaa9477070 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat4x2 m = f16mat4x2(f16vec2(0.0hf, 1.0hf), f16vec2(2.0hf, 3.0hf), f16vec2(4.0hf, 5.0hf), f16vec2(6.0hf, 7.0hf)); +f16mat4x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat4x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..9629c40fe5d 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat4x2 m = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); +mat4x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat4x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..eeaa9477070 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat4x2 m = f16mat4x2(f16vec2(0.0hf, 1.0hf), f16vec2(2.0hf, 3.0hf), f16vec2(4.0hf, 5.0hf), f16vec2(6.0hf, 7.0hf)); +f16mat4x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat4x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..9629c40fe5d 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat4x2 m = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); +mat4x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat4x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x2/load/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x2/load/f16.wgsl.expected.ir.glsl index d4bb1c94be9..39fb5bfcdf5 100644 --- a/test/tint/expressions/type_ctor/mat4x2/load/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x2/load/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat4x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat4x2 m = f16mat4x2(f16vec2(0.0hf), f16vec2(0.0hf), f16vec2(0.0hf), f16vec2(0.0hf)); + tint_symbol = f16mat4x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x2/load/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x2/load/f32.wgsl.expected.ir.glsl index d4bb1c94be9..b0edd8c3bc8 100644 --- a/test/tint/expressions/type_ctor/mat4x2/load/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x2/load/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat4x2 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat4x2 m = mat4x2(vec2(0.0f), vec2(0.0f), vec2(0.0f), vec2(0.0f)); + tint_symbol = mat4x2(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f16.wgsl.expected.ir.glsl index 37c14ad20ce..b4ab4168efa 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,15 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat4x3 m = f16mat4x3(f16vec3(0.0hf, 1.0hf, 2.0hf), f16vec3(3.0hf, 4.0hf, 5.0hf), f16vec3(6.0hf, 7.0hf, 8.0hf), f16vec3(9.0hf, 10.0hf, 11.0hf)); +f16mat4x3 tint_symbol; +void tint_store_and_preserve_padding(inout f16mat4x3 target, f16mat4x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; + target[3u] = value_param[3u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, f16mat4x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.ir.glsl index 37c14ad20ce..b7e49983722 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,14 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat4x3 m = mat4x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f), vec3(9.0f, 10.0f, 11.0f)); +mat4x3 tint_symbol; +void tint_store_and_preserve_padding(inout mat4x3 target, mat4x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; + target[3u] = value_param[3u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, mat4x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f16.wgsl.expected.ir.glsl index 37c14ad20ce..b4ab4168efa 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,15 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat4x3 m = f16mat4x3(f16vec3(0.0hf, 1.0hf, 2.0hf), f16vec3(3.0hf, 4.0hf, 5.0hf), f16vec3(6.0hf, 7.0hf, 8.0hf), f16vec3(9.0hf, 10.0hf, 11.0hf)); +f16mat4x3 tint_symbol; +void tint_store_and_preserve_padding(inout f16mat4x3 target, f16mat4x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; + target[3u] = value_param[3u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, f16mat4x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.ir.glsl index 37c14ad20ce..b7e49983722 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,14 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat4x3 m = mat4x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f), vec3(9.0f, 10.0f, 11.0f)); +mat4x3 tint_symbol; +void tint_store_and_preserve_padding(inout mat4x3 target, mat4x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; + target[3u] = value_param[3u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_store_and_preserve_padding(tint_symbol, mat4x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat4x3/load/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x3/load/f16.wgsl.expected.ir.glsl index 37c14ad20ce..9a6527b7167 100644 --- a/test/tint/expressions/type_ctor/mat4x3/load/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x3/load/f16.wgsl.expected.ir.glsl @@ -1,11 +1,15 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat4x3 tint_symbol; +void tint_store_and_preserve_padding(inout f16mat4x3 target, f16mat4x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; + target[3u] = value_param[3u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat4x3 m = f16mat4x3(f16vec3(0.0hf), f16vec3(0.0hf), f16vec3(0.0hf), f16vec3(0.0hf)); + tint_store_and_preserve_padding(tint_symbol, f16mat4x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat4x3/load/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x3/load/f32.wgsl.expected.ir.glsl index 37c14ad20ce..1b40aae85d0 100644 --- a/test/tint/expressions/type_ctor/mat4x3/load/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x3/load/f32.wgsl.expected.ir.glsl @@ -1,11 +1,14 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat4x3 tint_symbol; +void tint_store_and_preserve_padding(inout mat4x3 target, mat4x3 value_param) { + target[0u] = value_param[0u]; + target[1u] = value_param[1u]; + target[2u] = value_param[2u]; + target[3u] = value_param[3u]; +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat4x3 m = mat4x3(vec3(0.0f), vec3(0.0f), vec3(0.0f), vec3(0.0f)); + tint_store_and_preserve_padding(tint_symbol, mat4x3(m)); +} diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..3cc8392ca10 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat4 m = f16mat4(f16vec4(0.0hf, 1.0hf, 2.0hf, 3.0hf), f16vec4(4.0hf, 5.0hf, 6.0hf, 7.0hf), f16vec4(8.0hf, 9.0hf, 10.0hf, 11.0hf), f16vec4(12.0hf, 13.0hf, 14.0hf, 15.0hf)); +f16mat4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat4(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..3a3bc8d8888 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat4 m = mat4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f), vec4(12.0f, 13.0f, 14.0f, 15.0f)); +mat4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat4(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f16.wgsl.expected.ir.glsl index d4bb1c94be9..3cc8392ca10 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat4 m = f16mat4(f16vec4(0.0hf, 1.0hf, 2.0hf, 3.0hf), f16vec4(4.0hf, 5.0hf, 6.0hf, 7.0hf), f16vec4(8.0hf, 9.0hf, 10.0hf, 11.0hf), f16vec4(12.0hf, 13.0hf, 14.0hf, 15.0hf)); +f16mat4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = f16mat4(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.ir.glsl index d4bb1c94be9..3a3bc8d8888 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat4 m = mat4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f), vec4(12.0f, 13.0f, 14.0f, 15.0f)); +mat4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + tint_symbol = mat4(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x4/load/f16.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x4/load/f16.wgsl.expected.ir.glsl index d4bb1c94be9..5f24beed65a 100644 --- a/test/tint/expressions/type_ctor/mat4x4/load/f16.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x4/load/f16.wgsl.expected.ir.glsl @@ -1,11 +1,9 @@ -SKIP: FAILED +#version 310 es +#extension GL_AMD_gpu_shader_half_float: require -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +f16mat4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f16mat4 m = f16mat4(f16vec4(0.0hf), f16vec4(0.0hf), f16vec4(0.0hf), f16vec4(0.0hf)); + tint_symbol = f16mat4(m); +} diff --git a/test/tint/expressions/type_ctor/mat4x4/load/f32.wgsl.expected.ir.glsl b/test/tint/expressions/type_ctor/mat4x4/load/f32.wgsl.expected.ir.glsl index d4bb1c94be9..0dd6a435d85 100644 --- a/test/tint/expressions/type_ctor/mat4x4/load/f32.wgsl.expected.ir.glsl +++ b/test/tint/expressions/type_ctor/mat4x4/load/f32.wgsl.expected.ir.glsl @@ -1,11 +1,8 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:252 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Store -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +mat4 tint_symbol; +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + mat4 m = mat4(vec4(0.0f), vec4(0.0f), vec4(0.0f), vec4(0.0f)); + tint_symbol = mat4(m); +} diff --git a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.ir.glsl b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.ir.glsl index 37c14ad20ce..72de2d54b50 100644 --- a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.ir.glsl +++ b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.ir.glsl @@ -1,11 +1,45 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct strided_arr { + vec2 el; +}; -tint executable returned error: signal: illegal instruction +struct SSBO { + strided_arr m[2]; +}; + +SSBO ssbo; +strided_arr[2] mat2x2_stride_16_to_arr(mat2 m) { + strided_arr v = strided_arr(m[0u]); + return strided_arr[2](v, strided_arr(m[1u])); +} +mat2 arr_to_mat2x2_stride_16(strided_arr arr[2]) { + return mat2(arr[0u].el, arr[1u].el); +} +void tint_store_and_preserve_padding_1(inout strided_arr target, strided_arr value_param) { + target.el = value_param.el; +} +void tint_store_and_preserve_padding(inout strided_arr target[2], strided_arr value_param[2]) { + { + uint v_1 = 0u; + v_1 = 0u; + while(true) { + uint v_2 = v_1; + if ((v_2 >= 2u)) { + break; + } + tint_store_and_preserve_padding_1(target[v_2], value_param[v_2]); + { + v_1 = (v_2 + 1u); + } + continue; + } + } +} +void f_1() { + tint_store_and_preserve_padding(ssbo.m, mat2x2_stride_16_to_arr(arr_to_mat2x2_stride_16(ssbo.m))); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + f_1(); +} diff --git a/test/tint/struct/type_initializer.wgsl.expected.ir.glsl b/test/tint/struct/type_initializer.wgsl.expected.ir.glsl index 37c14ad20ce..80b2a6fe98c 100644 --- a/test/tint/struct/type_initializer.wgsl.expected.ir.glsl +++ b/test/tint/struct/type_initializer.wgsl.expected.ir.glsl @@ -1,11 +1,44 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct S1 { + int a; + int b; + int c; + int d; +}; -tint executable returned error: signal: illegal instruction +struct S2 { + int e; + S1 f; +}; + +struct S3 { + int g; + S1 h; + S2 i; +}; + +struct T { + int a[2]; +}; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + int x = 42; + S1 empty = S1(0, 0, 0, 0); + S1 nonempty = S1(1, 2, 3, 4); + S1 nonempty_with_expr = S1(1, x, (x + 1), nonempty.d); + S3 nested_empty = S3(0, S1(0, 0, 0, 0), S2(0, S1(0, 0, 0, 0))); + S3 nested_nonempty = S3(1, S1(2, 3, 4, 5), S2(6, S1(7, 8, 9, 10))); + S1 v = S1(2, x, (x + 1), nested_nonempty.i.f.d); + S3 nested_nonempty_with_expr = S3(1, v, S2(6, nonempty)); + int subexpr_empty = 0; + int subexpr_nonempty = 2; + int subexpr_nonempty_with_expr = S1(1, x, (x + 1), nonempty.d).c; + S1 subexpr_nested_empty = S1(0, 0, 0, 0); + S1 subexpr_nested_nonempty = S1(2, 3, 4, 5); + S1 subexpr_nested_nonempty_with_expr = S2(1, S1(2, x, (x + 1), nested_nonempty.i.f.d)).f; + T aosoa_empty[2] = T[2](T(int[2](0, 0)), T(int[2](0, 0))); + T aosoa_nonempty[2] = T[2](T(int[2](1, 2)), T(int[2](3, 4))); + T aosoa_nonempty_with_expr[2] = T[2](T(int[2](1, (aosoa_nonempty[0].a[0] + 1))), aosoa_nonempty[1]); +} diff --git a/test/tint/types/function_scope_var_conversions.wgsl.expected.ir.glsl b/test/tint/types/function_scope_var_conversions.wgsl.expected.ir.glsl index 37c14ad20ce..c4018e3c69c 100644 --- a/test/tint/types/function_scope_var_conversions.wgsl.expected.ir.glsl +++ b/test/tint/types/function_scope_var_conversions.wgsl.expected.ir.glsl @@ -1,11 +1,30 @@ -SKIP: FAILED +#version 310 es -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction +void constant_with_non_constant() { + float a = 0.0f; + vec2 b = vec2(1.0f, a); +} +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void main() { + bool bool_var1 = true; + bool bool_var2 = true; + bool bool_var3 = true; + int i32_var1 = 123; + int i32_var2 = 123; + int i32_var3 = 1; + uint u32_var1 = 123u; + uint u32_var2 = 123u; + uint u32_var3 = 1u; + bvec3 v3bool_var1 = bvec3(true); + bvec3 v3bool_var11 = bvec3(true); + bvec3 v3bool_var2 = bvec3(true); + bvec3 v3bool_var3 = bvec3(true); + ivec3 v3i32_var1 = ivec3(123); + ivec3 v3i32_var2 = ivec3(123); + ivec3 v3i32_var3 = ivec3(1); + uvec3 v3u32_var1 = uvec3(123u); + uvec3 v3u32_var2 = uvec3(123u); + uvec3 v3u32_var3 = uvec3(1u); + bvec3 v3bool_var4 = bvec3(true); + bvec4 v4bool_var5 = bvec4(true, false, true, false); +} diff --git a/test/tint/unittest/reader/spirv/SpvBinaryArithTestBasic_OuterProduct.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/SpvBinaryArithTestBasic_OuterProduct.spvasm.expected.ir.glsl deleted file mode 100644 index 37c14ad20ce..00000000000 --- a/test/tint/unittest/reader/spirv/SpvBinaryArithTestBasic_OuterProduct.spvasm.expected.ir.glsl +++ /dev/null @@ -1,11 +0,0 @@ -SKIP: FAILED - -/src/tint/lang/glsl/writer/printer/printer.cc:482 internal compiler error: Switch() matched no cases. Type: tint::core::ir::Construct -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - -tint executable returned error: signal: illegal instruction