diff --git a/samples/main.cc b/samples/main.cc index 87f0b546ed..05f4e42202 100644 --- a/samples/main.cc +++ b/samples/main.cc @@ -824,15 +824,15 @@ EShLanguage pipeline_stage_to_esh_language(tint::ast::PipelineStage stage) { /// @returns true on success bool GenerateGlsl(const tint::Program* program, const Options& options) { #if TINT_BUILD_GLSL_WRITER - bool success = true; if (options.validate) { glslang::InitializeProcess(); } - tint::writer::glsl::Options gen_options; - tint::inspector::Inspector inspector(program); - for (auto& entry_point : inspector.GetEntryPoints()) { + + auto generate = [&](const tint::Program* program, + const std::string entry_point_name) -> bool { + tint::writer::glsl::Options gen_options; auto result = - tint::writer::glsl::Generate(program, gen_options, entry_point.name); + tint::writer::glsl::Generate(program, gen_options, entry_point_name); if (!result.success) { PrintWGSL(std::cerr, *program); std::cerr << "Failed to generate: " << result.error << std::endl; @@ -858,10 +858,24 @@ bool GenerateGlsl(const tint::Program* program, const Options& options) { std::cerr << "Error parsing GLSL shader:\n" << shader.getInfoLog() << "\n" << shader.getInfoDebugLog() << "\n"; - success = false; + return false; } } } + return true; + }; + + tint::inspector::Inspector inspector(program); + + if (inspector.GetEntryPoints().empty()) { + // Pass empty string here so that the GLSL generator will generate + // code for all functions, reachable or not. + return generate(program, ""); + } + + bool success = true; + for (auto& entry_point : inspector.GetEntryPoints()) { + success &= generate(program, entry_point.name); } return success; #else diff --git a/src/transform/glsl.cc b/src/transform/glsl.cc index 4f056b8ed7..38e92d4a71 100644 --- a/src/transform/glsl.cc +++ b/src/transform/glsl.cc @@ -17,6 +17,7 @@ #include #include "src/program_builder.h" +#include "src/transform/add_empty_entry_point.h" #include "src/transform/add_spirv_block_decoration.h" #include "src/transform/calculate_array_length.h" #include "src/transform/canonicalize_entry_point_io.h" @@ -67,7 +68,7 @@ Output Glsl::Run(const Program* in, const DataMap& inputs) { // referenced only by phonies from being optimized out. Strictly // speaking, that optimization isn't incorrect, but it prevents some // tests (e.g., types/texture/*) from producing useful results. - if (cfg) { + if (cfg && !cfg->entry_point.empty()) { manager.Add(); data.Add(cfg->entry_point); } @@ -76,6 +77,7 @@ Output Glsl::Run(const Program* in, const DataMap& inputs) { manager.Add(); manager.Add(); manager.Add(); + manager.Add(); manager.Add(); // For now, canonicalize to structs for all IO, as in HLSL. @@ -90,24 +92,11 @@ Output Glsl::Run(const Program* in, const DataMap& inputs) { ProgramBuilder builder; CloneContext ctx(&builder, &out.program); - AddEmptyEntryPoint(ctx); ctx.Clone(); builder.SetTransformApplied(this); return Output{Program(std::move(builder))}; } -void Glsl::AddEmptyEntryPoint(CloneContext& ctx) const { - for (auto* func : ctx.src->AST().Functions()) { - if (func->IsEntryPoint()) { - return; - } - } - ctx.dst->Func(ctx.dst->Symbols().New("unused_entry_point"), {}, - ctx.dst->ty.void_(), {}, - {ctx.dst->Stage(ast::PipelineStage::kCompute), - ctx.dst->WorkgroupSize(1)}); -} - Glsl::Config::Config(const std::string& ep, bool disable_wi) : entry_point(ep), disable_workgroup_init(disable_wi) {} Glsl::Config::Config(const Config&) = default; diff --git a/src/transform/glsl.h b/src/transform/glsl.h index 27ec91f037..de3b225f9d 100644 --- a/src/transform/glsl.h +++ b/src/transform/glsl.h @@ -62,10 +62,6 @@ class Glsl : public Castable { /// @param data optional extra transform-specific data /// @returns the transformation result Output Run(const Program* program, const DataMap& data = {}) override; - - private: - /// Add an empty shader entry point if none exist in the module. - void AddEmptyEntryPoint(CloneContext& ctx) const; }; } // namespace transform diff --git a/test/array/assign_to_function_var.wgsl.expected.glsl b/test/array/assign_to_function_var.wgsl.expected.glsl index e69de29bb2..0861e921fd 100644 --- a/test/array/assign_to_function_var.wgsl.expected.glsl +++ b/test/array/assign_to_function_var.wgsl.expected.glsl @@ -0,0 +1,55 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + ivec4 arr[4]; +}; + +ivec4 src_private[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); +shared ivec4 src_workgroup[4]; +layout (binding = 0) uniform S_1 { + ivec4 arr[4]; +} src_uniform; +layout (binding = 1) buffer S_2 { + ivec4 arr[4]; +} src_storage; + +ivec4[4] ret_arr() { + ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + return tint_symbol; +} + +S ret_struct_arr() { + S tint_symbol_1 = S(ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0))); + return tint_symbol_1; +} + +void foo(ivec4 src_param[4]) { + ivec4 src_function[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + ivec4 dst[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + ivec4 tint_symbol_2[4] = ivec4[4](ivec4(1), ivec4(2), ivec4(3), ivec4(3)); + dst = tint_symbol_2; + dst = src_param; + dst = ret_arr(); + ivec4 src_let[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + dst = src_let; + dst = src_function; + dst = src_private; + dst = src_workgroup; + dst = ret_struct_arr().arr; + dst = src_uniform.arr; + dst = src_storage.arr; + int dst_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0))); + int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0))); + dst_nested = src_nested; +} diff --git a/test/array/assign_to_private_var.wgsl.expected.glsl b/test/array/assign_to_private_var.wgsl.expected.glsl index e69de29bb2..1441b02a69 100644 --- a/test/array/assign_to_private_var.wgsl.expected.glsl +++ b/test/array/assign_to_private_var.wgsl.expected.glsl @@ -0,0 +1,55 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + ivec4 arr[4]; +}; + +ivec4 src_private[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); +shared ivec4 src_workgroup[4]; +layout (binding = 0) uniform S_1 { + ivec4 arr[4]; +} src_uniform; +layout (binding = 1) buffer S_2 { + ivec4 arr[4]; +} src_storage; +ivec4 dst[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); +int dst_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0))); + +ivec4[4] ret_arr() { + ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + return tint_symbol; +} + +S ret_struct_arr() { + S tint_symbol_1 = S(ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0))); + return tint_symbol_1; +} + +void foo(ivec4 src_param[4]) { + ivec4 src_function[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + ivec4 tint_symbol_2[4] = ivec4[4](ivec4(1), ivec4(2), ivec4(3), ivec4(3)); + dst = tint_symbol_2; + dst = src_param; + dst = ret_arr(); + ivec4 src_let[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + dst = src_let; + dst = src_function; + dst = src_private; + dst = src_workgroup; + dst = ret_struct_arr().arr; + dst = src_uniform.arr; + dst = src_storage.arr; + int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0))); + dst_nested = src_nested; +} diff --git a/test/array/assign_to_storage_var.wgsl.expected.glsl b/test/array/assign_to_storage_var.wgsl.expected.glsl index e69de29bb2..2dab9e9498 100644 --- a/test/array/assign_to_storage_var.wgsl.expected.glsl +++ b/test/array/assign_to_storage_var.wgsl.expected.glsl @@ -0,0 +1,62 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + ivec4 arr[4]; +}; +struct S_nested { + int arr[4][3][2]; +}; + +ivec4 src_private[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); +shared ivec4 src_workgroup[4]; +layout (binding = 0) uniform S_1 { + ivec4 arr[4]; +} src_uniform; +layout (binding = 1) buffer S_2 { + ivec4 arr[4]; +} src_storage; +layout (binding = 2) buffer S_3 { + ivec4 arr[4]; +} dst; +layout (binding = 3) buffer S_nested_1 { + int arr[4][3][2]; +} dst_nested; + +ivec4[4] ret_arr() { + ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + return tint_symbol; +} + +S ret_struct_arr() { + S tint_symbol_1 = S(ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0))); + return tint_symbol_1; +} + +void foo(ivec4 src_param[4]) { + ivec4 src_function[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + ivec4 tint_symbol_2[4] = ivec4[4](ivec4(1), ivec4(2), ivec4(3), ivec4(3)); + dst.arr = tint_symbol_2; + dst.arr = src_param; + dst.arr = ret_arr(); + ivec4 src_let[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + dst.arr = src_let; + dst.arr = src_function; + dst.arr = src_private; + dst.arr = src_workgroup; + dst.arr = ret_struct_arr().arr; + dst.arr = src_uniform.arr; + dst.arr = src_storage.arr; + int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0))); + dst_nested.arr = src_nested; +} diff --git a/test/array/assign_to_subexpr.wgsl.expected.glsl b/test/array/assign_to_subexpr.wgsl.expected.glsl index e69de29bb2..13e169007d 100644 --- a/test/array/assign_to_subexpr.wgsl.expected.glsl +++ b/test/array/assign_to_subexpr.wgsl.expected.glsl @@ -0,0 +1,28 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + int arr[4]; +}; + +void foo() { + int src[4] = int[4](0, 0, 0, 0); + int dst[4] = int[4](0, 0, 0, 0); + S dst_struct = S(int[4](0, 0, 0, 0)); + int dst_array[2][4] = int[2][4](int[4](0, 0, 0, 0), int[4](0, 0, 0, 0)); + dst_struct.arr = src; + dst_array[1] = src; + dst = src; + dst_struct.arr = src; + dst_array[0] = src; +} diff --git a/test/array/assign_to_workgroup_var.wgsl.expected.glsl b/test/array/assign_to_workgroup_var.wgsl.expected.glsl index e69de29bb2..c339c4192e 100644 --- a/test/array/assign_to_workgroup_var.wgsl.expected.glsl +++ b/test/array/assign_to_workgroup_var.wgsl.expected.glsl @@ -0,0 +1,55 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + ivec4 arr[4]; +}; + +ivec4 src_private[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); +shared ivec4 src_workgroup[4]; +layout (binding = 0) uniform S_1 { + ivec4 arr[4]; +} src_uniform; +layout (binding = 1) buffer S_2 { + ivec4 arr[4]; +} src_storage; +shared ivec4 dst[4]; +shared int dst_nested[4][3][2]; + +ivec4[4] ret_arr() { + ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + return tint_symbol; +} + +S ret_struct_arr() { + S tint_symbol_1 = S(ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0))); + return tint_symbol_1; +} + +void foo(ivec4 src_param[4]) { + ivec4 src_function[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + ivec4 tint_symbol_2[4] = ivec4[4](ivec4(1), ivec4(2), ivec4(3), ivec4(3)); + dst = tint_symbol_2; + dst = src_param; + dst = ret_arr(); + ivec4 src_let[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); + dst = src_let; + dst = src_function; + dst = src_private; + dst = src_workgroup; + dst = ret_struct_arr().arr; + dst = src_uniform.arr; + dst = src_storage.arr; + int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0))); + dst_nested = src_nested; +} diff --git a/test/buffer/storage/types/runtime_array.wgsl.expected.glsl b/test/buffer/storage/types/runtime_array.wgsl.expected.glsl index bc7c8c6c79..20ab43abed 100644 --- a/test/buffer/storage/types/runtime_array.wgsl.expected.glsl +++ b/test/buffer/storage/types/runtime_array.wgsl.expected.glsl @@ -1,12 +1,15 @@ #version 310 es precision mediump float; +struct S { + float f; +}; layout (binding = 0) buffer tint_symbol_block_1 { - float inner[]; + S inner[]; } tint_symbol; layout (binding = 1) buffer tint_symbol_block_2 { - float inner[]; + S inner[]; } tint_symbol_1; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; diff --git a/test/bug/chromium/1221120.wgsl.expected.glsl b/test/bug/chromium/1221120.wgsl.expected.glsl index e69de29bb2..fed5e2677e 100644 --- a/test/bug/chromium/1221120.wgsl.expected.glsl +++ b/test/bug/chromium/1221120.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const int H = 1; diff --git a/test/bug/chromium/1236161.wgsl.expected.glsl b/test/bug/chromium/1236161.wgsl.expected.glsl index e69de29bb2..87dbeff593 100644 --- a/test/bug/chromium/1236161.wgsl.expected.glsl +++ b/test/bug/chromium/1236161.wgsl.expected.glsl @@ -0,0 +1,37 @@ +SKIP: FAILED + +#version 310 es +precision mediump float; + +struct modf_result { + float fract; + float whole; +}; +modf_result tint_modf(float param_0) { + float whole; + float fract = modf(param_0, whole); + modf_result result = {fract, whole}; + return result; +} + + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void i() { + float s = tint_modf(1.0f).whole; +} +Error parsing GLSL shader: +ERROR: 0:11: '{ } style initializers' : not supported with this profile: es +ERROR: 0:11: '' : compilation terminated +ERROR: 2 compilation errors. No code generated. + + + diff --git a/test/bug/chromium/1273451.wgsl.expected.glsl b/test/bug/chromium/1273451.wgsl.expected.glsl index e69de29bb2..90a906d926 100644 --- a/test/bug/chromium/1273451.wgsl.expected.glsl +++ b/test/bug/chromium/1273451.wgsl.expected.glsl @@ -0,0 +1,24 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct A { + int a; +}; +struct B { + int b; +}; + +B f(A a) { + B tint_symbol = B(0); + return tint_symbol; +} diff --git a/test/bug/tint/1081.wgsl.expected.glsl b/test/bug/tint/1081.wgsl.expected.glsl index dda1d6bad5..4d21187fcc 100644 --- a/test/bug/tint/1081.wgsl.expected.glsl +++ b/test/bug/tint/1081.wgsl.expected.glsl @@ -1,8 +1,8 @@ SKIP: FAILED -bug/tint/1081.wgsl:9:25 warning: integral user-defined fragment inputs must have a flat interpolation attribute +bug/tint/1081.wgsl:9:22 warning: integral user-defined fragment inputs must have a flat interpolation attribute fn main(@location(1) x: vec3) -> @location(2) i32 { - ^ + ^ #version 310 es precision mediump float; @@ -51,7 +51,7 @@ void main() { Error parsing GLSL shader: ERROR: 0:35: 'int' : must be qualified as flat in -ERROR: 0:35: '' : compilation terminated +ERROR: 0:35: '' : compilation terminated ERROR: 2 compilation errors. No code generated. diff --git a/test/bug/tint/1136.wgsl.expected.glsl b/test/bug/tint/1136.wgsl.expected.glsl index e69de29bb2..379b3406f7 100644 --- a/test/bug/tint/1136.wgsl.expected.glsl +++ b/test/bug/tint/1136.wgsl.expected.glsl @@ -0,0 +1,24 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct Buffer { + uint data; +}; + +layout (binding = 0) buffer Buffer_1 { + uint data; +} tint_symbol; + +void tint_symbol_1() { + tint_symbol.data = (tint_symbol.data + 1u); +} diff --git a/test/bug/tint/294.wgsl.expected.glsl b/test/bug/tint/294.wgsl.expected.glsl index e69de29bb2..730ce221f0 100644 --- a/test/bug/tint/294.wgsl.expected.glsl +++ b/test/bug/tint/294.wgsl.expected.glsl @@ -0,0 +1,21 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct Light { + vec3 position; + vec3 colour; +}; + +layout (binding = 1) buffer Lights_1 { + Light light[]; +} lights; diff --git a/test/bug/tint/369.wgsl.expected.glsl b/test/bug/tint/369.wgsl.expected.glsl index e69de29bb2..4a6ca48feb 100644 --- a/test/bug/tint/369.wgsl.expected.glsl +++ b/test/bug/tint/369.wgsl.expected.glsl @@ -0,0 +1,23 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + mat2 m; +}; + +layout (binding = 0) buffer S_1 { + mat2 m; +} SSBO; +layout (binding = 0) uniform S_2 { + mat2 m; +} UBO; diff --git a/test/bug/tint/764.wgsl.expected.glsl b/test/bug/tint/764.wgsl.expected.glsl index e69de29bb2..61aaa72f16 100644 --- a/test/bug/tint/764.wgsl.expected.glsl +++ b/test/bug/tint/764.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat4 m = mat4(vec4(1.0f, 1.0f, 1.0f, 1.0f), vec4(1.0f, 1.0f, 1.0f, 1.0f), vec4(1.0f, 1.0f, 1.0f, 1.0f), vec4(1.0f, 1.0f, 1.0f, 1.0f)); + vec4 v1 = m[0]; + float a = v1[0]; +} diff --git a/test/bug/tint/782.wgsl.expected.glsl b/test/bug/tint/782.wgsl.expected.glsl index e69de29bb2..946b9f465f 100644 --- a/test/bug/tint/782.wgsl.expected.glsl +++ b/test/bug/tint/782.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void foo() { + int explicit[2] = int[2](0, 0); + int implict[2] = int[2](0, 0); + implict = explicit; +} diff --git a/test/bug/tint/804.spv.expected.glsl b/test/bug/tint/804.spv.expected.glsl index 85b35ecfe5..a1eef0860d 100644 --- a/test/bug/tint/804.spv.expected.glsl +++ b/test/bug/tint/804.spv.expected.glsl @@ -3,12 +3,12 @@ SKIP: FAILED struct buf0 { resolution : vec2; -}; +} struct S { field0 : u32; field1 : u32; -}; +} @group(0) @binding(0) var x_75 : buf0; diff --git a/test/bug/tint/807.spv.expected.glsl b/test/bug/tint/807.spv.expected.glsl index 785418e9be..5036690f39 100644 --- a/test/bug/tint/807.spv.expected.glsl +++ b/test/bug/tint/807.spv.expected.glsl @@ -3,6 +3,6 @@ SKIP: FAILED struct buf0 { resolution : vec2; -}; +} error: undef pointer is not valid: %845 = OpUndef %434 diff --git a/test/bug/tint/825.wgsl.expected.glsl b/test/bug/tint/825.wgsl.expected.glsl index e69de29bb2..3132ef8565 100644 --- a/test/bug/tint/825.wgsl.expected.glsl +++ b/test/bug/tint/825.wgsl.expected.glsl @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int i = 0; + int j = 0; + mat2 m = mat2(vec2(1.0f, 2.0f), vec2(3.0f, 4.0f)); + float f_1 = m[i][j]; +} diff --git a/test/bug/tint/990.wgsl.expected.glsl b/test/bug/tint/990.wgsl.expected.glsl index e69de29bb2..d9b7b77e6e 100644 --- a/test/bug/tint/990.wgsl.expected.glsl +++ b/test/bug/tint/990.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int i = 0; + { + for(; false; ) { + } + } +} diff --git a/test/expressions/index/let/let/literal/array.wgsl.expected.glsl b/test/expressions/index/let/let/literal/array.wgsl.expected.glsl new file mode 100644 index 0000000000..2f0abd5952 --- /dev/null +++ b/test/expressions/index/let/let/literal/array.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f() { + int a[8] = int[8](1, 2, 3, 4, 5, 6, 7, 8); + return a[1]; +} diff --git a/test/expressions/index/let/let/literal/matrix.wgsl.expected.glsl b/test/expressions/index/let/let/literal/matrix.wgsl.expected.glsl new file mode 100644 index 0000000000..cd0f7ba96f --- /dev/null +++ b/test/expressions/index/let/let/literal/matrix.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +vec3 f() { + mat3 m = mat3(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + return m[1]; +} diff --git a/test/expressions/index/let/let/literal/vector.wgsl.expected.glsl b/test/expressions/index/let/let/literal/vector.wgsl.expected.glsl new file mode 100644 index 0000000000..1db8e0bf22 --- /dev/null +++ b/test/expressions/index/let/let/literal/vector.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float f() { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + return v[1]; +} diff --git a/test/expressions/index/let/let/param/array.wgsl.expected.glsl b/test/expressions/index/let/let/param/array.wgsl.expected.glsl new file mode 100644 index 0000000000..ea2771239c --- /dev/null +++ b/test/expressions/index/let/let/param/array.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f(int x) { + int a[8] = int[8](1, 2, 3, 4, 5, 6, 7, 8); + return a[x]; +} diff --git a/test/expressions/index/let/let/param/matrix.wgsl.expected.glsl b/test/expressions/index/let/let/param/matrix.wgsl.expected.glsl new file mode 100644 index 0000000000..a9ae0fd59a --- /dev/null +++ b/test/expressions/index/let/let/param/matrix.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +vec3 f(int x) { + mat3 m = mat3(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + return m[x]; +} diff --git a/test/expressions/index/let/let/param/vector.wgsl.expected.glsl b/test/expressions/index/let/let/param/vector.wgsl.expected.glsl new file mode 100644 index 0000000000..0a3af1c58d --- /dev/null +++ b/test/expressions/index/let/let/param/vector.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float f(int x) { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + return v[x]; +} diff --git a/test/expressions/index/let/literal/array.wgsl.expected.glsl b/test/expressions/index/let/literal/array.wgsl.expected.glsl new file mode 100644 index 0000000000..2f0abd5952 --- /dev/null +++ b/test/expressions/index/let/literal/array.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f() { + int a[8] = int[8](1, 2, 3, 4, 5, 6, 7, 8); + return a[1]; +} diff --git a/test/expressions/index/let/literal/matrix.wgsl.expected.glsl b/test/expressions/index/let/literal/matrix.wgsl.expected.glsl new file mode 100644 index 0000000000..cd0f7ba96f --- /dev/null +++ b/test/expressions/index/let/literal/matrix.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +vec3 f() { + mat3 m = mat3(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + return m[1]; +} diff --git a/test/expressions/index/let/literal/vector.wgsl.expected.glsl b/test/expressions/index/let/literal/vector.wgsl.expected.glsl new file mode 100644 index 0000000000..1db8e0bf22 --- /dev/null +++ b/test/expressions/index/let/literal/vector.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float f() { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + return v[1]; +} diff --git a/test/expressions/index/let/param/array.wgsl.expected.glsl b/test/expressions/index/let/param/array.wgsl.expected.glsl new file mode 100644 index 0000000000..1d881bf042 --- /dev/null +++ b/test/expressions/index/let/param/array.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f(int i) { + int a[8] = int[8](1, 2, 3, 4, 5, 6, 7, 8); + return a[i]; +} diff --git a/test/expressions/index/let/param/matrix.wgsl.expected.glsl b/test/expressions/index/let/param/matrix.wgsl.expected.glsl new file mode 100644 index 0000000000..d4a28b3329 --- /dev/null +++ b/test/expressions/index/let/param/matrix.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +vec3 f(int i) { + mat3 m = mat3(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + return m[i]; +} diff --git a/test/expressions/index/let/param/vector.wgsl.expected.glsl b/test/expressions/index/let/param/vector.wgsl.expected.glsl new file mode 100644 index 0000000000..6a2d0bfba1 --- /dev/null +++ b/test/expressions/index/let/param/vector.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float f(int i) { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + return v[i]; +} diff --git a/test/expressions/index/let/var/literal/array.wgsl.expected.glsl b/test/expressions/index/let/var/literal/array.wgsl.expected.glsl new file mode 100644 index 0000000000..2f0abd5952 --- /dev/null +++ b/test/expressions/index/let/var/literal/array.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f() { + int a[8] = int[8](1, 2, 3, 4, 5, 6, 7, 8); + return a[1]; +} diff --git a/test/expressions/index/let/var/literal/matrix.wgsl.expected.glsl b/test/expressions/index/let/var/literal/matrix.wgsl.expected.glsl new file mode 100644 index 0000000000..cd0f7ba96f --- /dev/null +++ b/test/expressions/index/let/var/literal/matrix.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +vec3 f() { + mat3 m = mat3(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + return m[1]; +} diff --git a/test/expressions/index/let/var/literal/vector.wgsl.expected.glsl b/test/expressions/index/let/var/literal/vector.wgsl.expected.glsl new file mode 100644 index 0000000000..1db8e0bf22 --- /dev/null +++ b/test/expressions/index/let/var/literal/vector.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float f() { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + return v[1]; +} diff --git a/test/expressions/index/var/let/literal/array.wgsl.expected.glsl b/test/expressions/index/var/let/literal/array.wgsl.expected.glsl new file mode 100644 index 0000000000..2f0abd5952 --- /dev/null +++ b/test/expressions/index/var/let/literal/array.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f() { + int a[8] = int[8](1, 2, 3, 4, 5, 6, 7, 8); + return a[1]; +} diff --git a/test/expressions/index/var/let/literal/matrix.wgsl.expected.glsl b/test/expressions/index/var/let/literal/matrix.wgsl.expected.glsl new file mode 100644 index 0000000000..cd0f7ba96f --- /dev/null +++ b/test/expressions/index/var/let/literal/matrix.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +vec3 f() { + mat3 m = mat3(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + return m[1]; +} diff --git a/test/expressions/index/var/let/literal/vector.wgsl.expected.glsl b/test/expressions/index/var/let/literal/vector.wgsl.expected.glsl new file mode 100644 index 0000000000..1db8e0bf22 --- /dev/null +++ b/test/expressions/index/var/let/literal/vector.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float f() { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + return v[1]; +} diff --git a/test/expressions/index/var/let/param/array.wgsl.expected.glsl b/test/expressions/index/var/let/param/array.wgsl.expected.glsl new file mode 100644 index 0000000000..ea2771239c --- /dev/null +++ b/test/expressions/index/var/let/param/array.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f(int x) { + int a[8] = int[8](1, 2, 3, 4, 5, 6, 7, 8); + return a[x]; +} diff --git a/test/expressions/index/var/let/param/matrix.wgsl.expected.glsl b/test/expressions/index/var/let/param/matrix.wgsl.expected.glsl new file mode 100644 index 0000000000..a9ae0fd59a --- /dev/null +++ b/test/expressions/index/var/let/param/matrix.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +vec3 f(int x) { + mat3 m = mat3(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + return m[x]; +} diff --git a/test/expressions/index/var/let/param/vector.wgsl.expected.glsl b/test/expressions/index/var/let/param/vector.wgsl.expected.glsl new file mode 100644 index 0000000000..0a3af1c58d --- /dev/null +++ b/test/expressions/index/var/let/param/vector.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float f(int x) { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + return v[x]; +} diff --git a/test/expressions/index/var/literal/array.wgsl.expected.glsl b/test/expressions/index/var/literal/array.wgsl.expected.glsl new file mode 100644 index 0000000000..2f0abd5952 --- /dev/null +++ b/test/expressions/index/var/literal/array.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f() { + int a[8] = int[8](1, 2, 3, 4, 5, 6, 7, 8); + return a[1]; +} diff --git a/test/expressions/index/var/literal/matrix.wgsl.expected.glsl b/test/expressions/index/var/literal/matrix.wgsl.expected.glsl new file mode 100644 index 0000000000..cd0f7ba96f --- /dev/null +++ b/test/expressions/index/var/literal/matrix.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +vec3 f() { + mat3 m = mat3(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + return m[1]; +} diff --git a/test/expressions/index/var/literal/vector.wgsl.expected.glsl b/test/expressions/index/var/literal/vector.wgsl.expected.glsl new file mode 100644 index 0000000000..1db8e0bf22 --- /dev/null +++ b/test/expressions/index/var/literal/vector.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float f() { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + return v[1]; +} diff --git a/test/expressions/index/var/param/array.wgsl.expected.glsl b/test/expressions/index/var/param/array.wgsl.expected.glsl new file mode 100644 index 0000000000..1d881bf042 --- /dev/null +++ b/test/expressions/index/var/param/array.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f(int i) { + int a[8] = int[8](1, 2, 3, 4, 5, 6, 7, 8); + return a[i]; +} diff --git a/test/expressions/index/var/param/matrix.wgsl.expected.glsl b/test/expressions/index/var/param/matrix.wgsl.expected.glsl new file mode 100644 index 0000000000..d4a28b3329 --- /dev/null +++ b/test/expressions/index/var/param/matrix.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +vec3 f(int i) { + mat3 m = mat3(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + return m[i]; +} diff --git a/test/expressions/index/var/param/vector.wgsl.expected.glsl b/test/expressions/index/var/param/vector.wgsl.expected.glsl new file mode 100644 index 0000000000..6a2d0bfba1 --- /dev/null +++ b/test/expressions/index/var/param/vector.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float f(int i) { + vec3 v = vec3(1.0f, 2.0f, 3.0f); + return v[i]; +} diff --git a/test/expressions/literals/intmin.wgsl.expected.glsl b/test/expressions/literals/intmin.wgsl.expected.glsl index e69de29bb2..0fcbd6e6c0 100644 --- a/test/expressions/literals/intmin.wgsl.expected.glsl +++ b/test/expressions/literals/intmin.wgsl.expected.glsl @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int add_int_min_explicit() { + int a = -2147483648; + int b = (a + 1); + int c = (-2147483648 + 1); + return c; +} diff --git a/test/expressions/splat/call/bool.wgsl.expected.glsl b/test/expressions/splat/call/bool.wgsl.expected.glsl index e69de29bb2..7088506fde 100644 --- a/test/expressions/splat/call/bool.wgsl.expected.glsl +++ b/test/expressions/splat/call/bool.wgsl.expected.glsl @@ -0,0 +1,22 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +bool get_bool() { + return true; +} + +void f() { + bvec2 v2 = bvec2(get_bool()); + bvec3 v3 = bvec3(get_bool()); + bvec4 v4 = bvec4(get_bool()); +} diff --git a/test/expressions/splat/call/f32.wgsl.expected.glsl b/test/expressions/splat/call/f32.wgsl.expected.glsl index e69de29bb2..cfd01c6aa3 100644 --- a/test/expressions/splat/call/f32.wgsl.expected.glsl +++ b/test/expressions/splat/call/f32.wgsl.expected.glsl @@ -0,0 +1,22 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +float get_f32() { + return 1.0f; +} + +void f() { + vec2 v2 = vec2(get_f32()); + vec3 v3 = vec3(get_f32()); + vec4 v4 = vec4(get_f32()); +} diff --git a/test/expressions/splat/call/i32.wgsl.expected.glsl b/test/expressions/splat/call/i32.wgsl.expected.glsl index e69de29bb2..0f8a5bc97c 100644 --- a/test/expressions/splat/call/i32.wgsl.expected.glsl +++ b/test/expressions/splat/call/i32.wgsl.expected.glsl @@ -0,0 +1,22 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int get_i32() { + return 1; +} + +void f() { + ivec2 v2 = ivec2(get_i32()); + ivec3 v3 = ivec3(get_i32()); + ivec4 v4 = ivec4(get_i32()); +} diff --git a/test/expressions/splat/call/u32.wgsl.expected.glsl b/test/expressions/splat/call/u32.wgsl.expected.glsl index e69de29bb2..78d1b6aa2e 100644 --- a/test/expressions/splat/call/u32.wgsl.expected.glsl +++ b/test/expressions/splat/call/u32.wgsl.expected.glsl @@ -0,0 +1,22 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +uint get_u32() { + return 1u; +} + +void f() { + uvec2 v2 = uvec2(get_u32()); + uvec3 v3 = uvec3(get_u32()); + uvec4 v4 = uvec4(get_u32()); +} diff --git a/test/expressions/splat/expression/bool.wgsl.expected.glsl b/test/expressions/splat/expression/bool.wgsl.expected.glsl index e69de29bb2..63b1d0ffc9 100644 --- a/test/expressions/splat/expression/bool.wgsl.expected.glsl +++ b/test/expressions/splat/expression/bool.wgsl.expected.glsl @@ -0,0 +1,30 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + bool tint_tmp = true; + if (!tint_tmp) { + tint_tmp = false; + } + bvec2 v2 = bvec2((tint_tmp)); + bool tint_tmp_1 = true; + if (!tint_tmp_1) { + tint_tmp_1 = false; + } + bvec3 v3 = bvec3((tint_tmp_1)); + bool tint_tmp_2 = true; + if (!tint_tmp_2) { + tint_tmp_2 = false; + } + bvec4 v4 = bvec4((tint_tmp_2)); +} diff --git a/test/expressions/splat/expression/f32.wgsl.expected.glsl b/test/expressions/splat/expression/f32.wgsl.expected.glsl index e69de29bb2..572896e8b5 100644 --- a/test/expressions/splat/expression/f32.wgsl.expected.glsl +++ b/test/expressions/splat/expression/f32.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + vec2 v2 = vec2((1.0f + 2.0f)); + vec3 v3 = vec3((1.0f + 2.0f)); + vec4 v4 = vec4((1.0f + 2.0f)); +} diff --git a/test/expressions/splat/expression/i32.wgsl.expected.glsl b/test/expressions/splat/expression/i32.wgsl.expected.glsl index e69de29bb2..c577b3cc6e 100644 --- a/test/expressions/splat/expression/i32.wgsl.expected.glsl +++ b/test/expressions/splat/expression/i32.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + ivec2 v2 = ivec2((1 + 2)); + ivec3 v3 = ivec3((1 + 2)); + ivec4 v4 = ivec4((1 + 2)); +} diff --git a/test/expressions/splat/expression/u32.wgsl.expected.glsl b/test/expressions/splat/expression/u32.wgsl.expected.glsl index e69de29bb2..d1a65977c1 100644 --- a/test/expressions/splat/expression/u32.wgsl.expected.glsl +++ b/test/expressions/splat/expression/u32.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + uvec2 v2 = uvec2((1u + 2u)); + uvec3 v3 = uvec3((1u + 2u)); + uvec4 v4 = uvec4((1u + 2u)); +} diff --git a/test/expressions/splat/immediate/bool.wgsl.expected.glsl b/test/expressions/splat/immediate/bool.wgsl.expected.glsl index e69de29bb2..01f1069798 100644 --- a/test/expressions/splat/immediate/bool.wgsl.expected.glsl +++ b/test/expressions/splat/immediate/bool.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + bvec2 v2 = bvec2(true); + bvec3 v3 = bvec3(true); + bvec4 v4 = bvec4(true); +} diff --git a/test/expressions/splat/immediate/f32.wgsl.expected.glsl b/test/expressions/splat/immediate/f32.wgsl.expected.glsl index e69de29bb2..25d356cfcf 100644 --- a/test/expressions/splat/immediate/f32.wgsl.expected.glsl +++ b/test/expressions/splat/immediate/f32.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + vec2 v2 = vec2(1.0f); + vec3 v3 = vec3(1.0f); + vec4 v4 = vec4(1.0f); +} diff --git a/test/expressions/splat/immediate/i32.wgsl.expected.glsl b/test/expressions/splat/immediate/i32.wgsl.expected.glsl index e69de29bb2..9610fe16a8 100644 --- a/test/expressions/splat/immediate/i32.wgsl.expected.glsl +++ b/test/expressions/splat/immediate/i32.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + ivec2 v2 = ivec2(1); + ivec3 v3 = ivec3(1); + ivec4 v4 = ivec4(1); +} diff --git a/test/expressions/splat/immediate/u32.wgsl.expected.glsl b/test/expressions/splat/immediate/u32.wgsl.expected.glsl index e69de29bb2..ecc96019b5 100644 --- a/test/expressions/splat/immediate/u32.wgsl.expected.glsl +++ b/test/expressions/splat/immediate/u32.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + uvec2 v2 = uvec2(1u); + uvec3 v3 = uvec3(1u); + uvec4 v4 = uvec4(1u); +} diff --git a/test/expressions/splat/var/bool.wgsl.expected.glsl b/test/expressions/splat/var/bool.wgsl.expected.glsl index e69de29bb2..643b38ca1f 100644 --- a/test/expressions/splat/var/bool.wgsl.expected.glsl +++ b/test/expressions/splat/var/bool.wgsl.expected.glsl @@ -0,0 +1,23 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + bool tint_tmp = true; + if (!tint_tmp) { + tint_tmp = false; + } + bool v = (tint_tmp); + bvec2 v2 = bvec2(v); + bvec3 v3 = bvec3(v); + bvec4 v4 = bvec4(v); +} diff --git a/test/expressions/splat/var/f32.wgsl.expected.glsl b/test/expressions/splat/var/f32.wgsl.expected.glsl index e69de29bb2..82daaeec49 100644 --- a/test/expressions/splat/var/f32.wgsl.expected.glsl +++ b/test/expressions/splat/var/f32.wgsl.expected.glsl @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + float v = (1.0f + 2.0f); + vec2 v2 = vec2(v); + vec3 v3 = vec3(v); + vec4 v4 = vec4(v); +} diff --git a/test/expressions/splat/var/i32.wgsl.expected.glsl b/test/expressions/splat/var/i32.wgsl.expected.glsl index e69de29bb2..74374ba30b 100644 --- a/test/expressions/splat/var/i32.wgsl.expected.glsl +++ b/test/expressions/splat/var/i32.wgsl.expected.glsl @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int v = (1 + 2); + ivec2 v2 = ivec2(v); + ivec3 v3 = ivec3(v); + ivec4 v4 = ivec4(v); +} diff --git a/test/expressions/splat/var/u32.wgsl.expected.glsl b/test/expressions/splat/var/u32.wgsl.expected.glsl index e69de29bb2..2ec3ca56de 100644 --- a/test/expressions/splat/var/u32.wgsl.expected.glsl +++ b/test/expressions/splat/var/u32.wgsl.expected.glsl @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + uint v = (1u + 2u); + uvec2 v2 = uvec2(v); + uvec3 v3 = uvec3(v); + uvec4 v4 = uvec4(v); +} diff --git a/test/expressions/splat/with_swizzle/f32.wgsl.expected.glsl b/test/expressions/splat/with_swizzle/f32.wgsl.expected.glsl index e69de29bb2..b1bd888e90 100644 --- a/test/expressions/splat/with_swizzle/f32.wgsl.expected.glsl +++ b/test/expressions/splat/with_swizzle/f32.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + float a = vec2(1.0f).y; + float b = vec3(1.0f).z; + float c = vec4(1.0f).w; +} diff --git a/test/expressions/swizzle/read/packed_vec3/f32.wgsl.expected.glsl b/test/expressions/swizzle/read/packed_vec3/f32.wgsl.expected.glsl index e69de29bb2..1197f463cf 100644 --- a/test/expressions/swizzle/read/packed_vec3/f32.wgsl.expected.glsl +++ b/test/expressions/swizzle/read/packed_vec3/f32.wgsl.expected.glsl @@ -0,0 +1,144 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + vec3 v; +}; + +layout (binding = 0) uniform S_1 { + vec3 v; +} U; + +void f() { + vec3 v = U.v; + float x = U.v.x; + float y = U.v.y; + float z = U.v.z; + vec2 xx = U.v.xx; + vec2 xy = U.v.xy; + vec2 xz = U.v.xz; + vec2 yx = U.v.yx; + vec2 yy = U.v.yy; + vec2 yz = U.v.yz; + vec2 zx = U.v.zx; + vec2 zy = U.v.zy; + vec2 zz = U.v.zz; + vec3 xxx = U.v.xxx; + vec3 xxy = U.v.xxy; + vec3 xxz = U.v.xxz; + vec3 xyx = U.v.xyx; + vec3 xyy = U.v.xyy; + vec3 xyz = U.v.xyz; + vec3 xzx = U.v.xzx; + vec3 xzy = U.v.xzy; + vec3 xzz = U.v.xzz; + vec3 yxx = U.v.yxx; + vec3 yxy = U.v.yxy; + vec3 yxz = U.v.yxz; + vec3 yyx = U.v.yyx; + vec3 yyy = U.v.yyy; + vec3 yyz = U.v.yyz; + vec3 yzx = U.v.yzx; + vec3 yzy = U.v.yzy; + vec3 yzz = U.v.yzz; + vec3 zxx = U.v.zxx; + vec3 zxy = U.v.zxy; + vec3 zxz = U.v.zxz; + vec3 zyx = U.v.zyx; + vec3 zyy = U.v.zyy; + vec3 zyz = U.v.zyz; + vec3 zzx = U.v.zzx; + vec3 zzy = U.v.zzy; + vec3 zzz = U.v.zzz; + vec4 xxxx = U.v.xxxx; + vec4 xxxy = U.v.xxxy; + vec4 xxxz = U.v.xxxz; + vec4 xxyx = U.v.xxyx; + vec4 xxyy = U.v.xxyy; + vec4 xxyz = U.v.xxyz; + vec4 xxzx = U.v.xxzx; + vec4 xxzy = U.v.xxzy; + vec4 xxzz = U.v.xxzz; + vec4 xyxx = U.v.xyxx; + vec4 xyxy = U.v.xyxy; + vec4 xyxz = U.v.xyxz; + vec4 xyyx = U.v.xyyx; + vec4 xyyy = U.v.xyyy; + vec4 xyyz = U.v.xyyz; + vec4 xyzx = U.v.xyzx; + vec4 xyzy = U.v.xyzy; + vec4 xyzz = U.v.xyzz; + vec4 xzxx = U.v.xzxx; + vec4 xzxy = U.v.xzxy; + vec4 xzxz = U.v.xzxz; + vec4 xzyx = U.v.xzyx; + vec4 xzyy = U.v.xzyy; + vec4 xzyz = U.v.xzyz; + vec4 xzzx = U.v.xzzx; + vec4 xzzy = U.v.xzzy; + vec4 xzzz = U.v.xzzz; + vec4 yxxx = U.v.yxxx; + vec4 yxxy = U.v.yxxy; + vec4 yxxz = U.v.yxxz; + vec4 yxyx = U.v.yxyx; + vec4 yxyy = U.v.yxyy; + vec4 yxyz = U.v.yxyz; + vec4 yxzx = U.v.yxzx; + vec4 yxzy = U.v.yxzy; + vec4 yxzz = U.v.yxzz; + vec4 yyxx = U.v.yyxx; + vec4 yyxy = U.v.yyxy; + vec4 yyxz = U.v.yyxz; + vec4 yyyx = U.v.yyyx; + vec4 yyyy = U.v.yyyy; + vec4 yyyz = U.v.yyyz; + vec4 yyzx = U.v.yyzx; + vec4 yyzy = U.v.yyzy; + vec4 yyzz = U.v.yyzz; + vec4 yzxx = U.v.yzxx; + vec4 yzxy = U.v.yzxy; + vec4 yzxz = U.v.yzxz; + vec4 yzyx = U.v.yzyx; + vec4 yzyy = U.v.yzyy; + vec4 yzyz = U.v.yzyz; + vec4 yzzx = U.v.yzzx; + vec4 yzzy = U.v.yzzy; + vec4 yzzz = U.v.yzzz; + vec4 zxxx = U.v.zxxx; + vec4 zxxy = U.v.zxxy; + vec4 zxxz = U.v.zxxz; + vec4 zxyx = U.v.zxyx; + vec4 zxyy = U.v.zxyy; + vec4 zxyz = U.v.zxyz; + vec4 zxzx = U.v.zxzx; + vec4 zxzy = U.v.zxzy; + vec4 zxzz = U.v.zxzz; + vec4 zyxx = U.v.zyxx; + vec4 zyxy = U.v.zyxy; + vec4 zyxz = U.v.zyxz; + vec4 zyyx = U.v.zyyx; + vec4 zyyy = U.v.zyyy; + vec4 zyyz = U.v.zyyz; + vec4 zyzx = U.v.zyzx; + vec4 zyzy = U.v.zyzy; + vec4 zyzz = U.v.zyzz; + vec4 zzxx = U.v.zzxx; + vec4 zzxy = U.v.zzxy; + vec4 zzxz = U.v.zzxz; + vec4 zzyx = U.v.zzyx; + vec4 zzyy = U.v.zzyy; + vec4 zzyz = U.v.zzyz; + vec4 zzzx = U.v.zzzx; + vec4 zzzy = U.v.zzzy; + vec4 zzzz = U.v.zzzz; +} diff --git a/test/expressions/swizzle/read/packed_vec3/i32.wgsl.expected.glsl b/test/expressions/swizzle/read/packed_vec3/i32.wgsl.expected.glsl index e69de29bb2..e43295527f 100644 --- a/test/expressions/swizzle/read/packed_vec3/i32.wgsl.expected.glsl +++ b/test/expressions/swizzle/read/packed_vec3/i32.wgsl.expected.glsl @@ -0,0 +1,144 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + ivec3 v; +}; + +layout (binding = 0) uniform S_1 { + ivec3 v; +} U; + +void f() { + ivec3 v = U.v; + int x = U.v.x; + int y = U.v.y; + int z = U.v.z; + ivec2 xx = U.v.xx; + ivec2 xy = U.v.xy; + ivec2 xz = U.v.xz; + ivec2 yx = U.v.yx; + ivec2 yy = U.v.yy; + ivec2 yz = U.v.yz; + ivec2 zx = U.v.zx; + ivec2 zy = U.v.zy; + ivec2 zz = U.v.zz; + ivec3 xxx = U.v.xxx; + ivec3 xxy = U.v.xxy; + ivec3 xxz = U.v.xxz; + ivec3 xyx = U.v.xyx; + ivec3 xyy = U.v.xyy; + ivec3 xyz = U.v.xyz; + ivec3 xzx = U.v.xzx; + ivec3 xzy = U.v.xzy; + ivec3 xzz = U.v.xzz; + ivec3 yxx = U.v.yxx; + ivec3 yxy = U.v.yxy; + ivec3 yxz = U.v.yxz; + ivec3 yyx = U.v.yyx; + ivec3 yyy = U.v.yyy; + ivec3 yyz = U.v.yyz; + ivec3 yzx = U.v.yzx; + ivec3 yzy = U.v.yzy; + ivec3 yzz = U.v.yzz; + ivec3 zxx = U.v.zxx; + ivec3 zxy = U.v.zxy; + ivec3 zxz = U.v.zxz; + ivec3 zyx = U.v.zyx; + ivec3 zyy = U.v.zyy; + ivec3 zyz = U.v.zyz; + ivec3 zzx = U.v.zzx; + ivec3 zzy = U.v.zzy; + ivec3 zzz = U.v.zzz; + ivec4 xxxx = U.v.xxxx; + ivec4 xxxy = U.v.xxxy; + ivec4 xxxz = U.v.xxxz; + ivec4 xxyx = U.v.xxyx; + ivec4 xxyy = U.v.xxyy; + ivec4 xxyz = U.v.xxyz; + ivec4 xxzx = U.v.xxzx; + ivec4 xxzy = U.v.xxzy; + ivec4 xxzz = U.v.xxzz; + ivec4 xyxx = U.v.xyxx; + ivec4 xyxy = U.v.xyxy; + ivec4 xyxz = U.v.xyxz; + ivec4 xyyx = U.v.xyyx; + ivec4 xyyy = U.v.xyyy; + ivec4 xyyz = U.v.xyyz; + ivec4 xyzx = U.v.xyzx; + ivec4 xyzy = U.v.xyzy; + ivec4 xyzz = U.v.xyzz; + ivec4 xzxx = U.v.xzxx; + ivec4 xzxy = U.v.xzxy; + ivec4 xzxz = U.v.xzxz; + ivec4 xzyx = U.v.xzyx; + ivec4 xzyy = U.v.xzyy; + ivec4 xzyz = U.v.xzyz; + ivec4 xzzx = U.v.xzzx; + ivec4 xzzy = U.v.xzzy; + ivec4 xzzz = U.v.xzzz; + ivec4 yxxx = U.v.yxxx; + ivec4 yxxy = U.v.yxxy; + ivec4 yxxz = U.v.yxxz; + ivec4 yxyx = U.v.yxyx; + ivec4 yxyy = U.v.yxyy; + ivec4 yxyz = U.v.yxyz; + ivec4 yxzx = U.v.yxzx; + ivec4 yxzy = U.v.yxzy; + ivec4 yxzz = U.v.yxzz; + ivec4 yyxx = U.v.yyxx; + ivec4 yyxy = U.v.yyxy; + ivec4 yyxz = U.v.yyxz; + ivec4 yyyx = U.v.yyyx; + ivec4 yyyy = U.v.yyyy; + ivec4 yyyz = U.v.yyyz; + ivec4 yyzx = U.v.yyzx; + ivec4 yyzy = U.v.yyzy; + ivec4 yyzz = U.v.yyzz; + ivec4 yzxx = U.v.yzxx; + ivec4 yzxy = U.v.yzxy; + ivec4 yzxz = U.v.yzxz; + ivec4 yzyx = U.v.yzyx; + ivec4 yzyy = U.v.yzyy; + ivec4 yzyz = U.v.yzyz; + ivec4 yzzx = U.v.yzzx; + ivec4 yzzy = U.v.yzzy; + ivec4 yzzz = U.v.yzzz; + ivec4 zxxx = U.v.zxxx; + ivec4 zxxy = U.v.zxxy; + ivec4 zxxz = U.v.zxxz; + ivec4 zxyx = U.v.zxyx; + ivec4 zxyy = U.v.zxyy; + ivec4 zxyz = U.v.zxyz; + ivec4 zxzx = U.v.zxzx; + ivec4 zxzy = U.v.zxzy; + ivec4 zxzz = U.v.zxzz; + ivec4 zyxx = U.v.zyxx; + ivec4 zyxy = U.v.zyxy; + ivec4 zyxz = U.v.zyxz; + ivec4 zyyx = U.v.zyyx; + ivec4 zyyy = U.v.zyyy; + ivec4 zyyz = U.v.zyyz; + ivec4 zyzx = U.v.zyzx; + ivec4 zyzy = U.v.zyzy; + ivec4 zyzz = U.v.zyzz; + ivec4 zzxx = U.v.zzxx; + ivec4 zzxy = U.v.zzxy; + ivec4 zzxz = U.v.zzxz; + ivec4 zzyx = U.v.zzyx; + ivec4 zzyy = U.v.zzyy; + ivec4 zzyz = U.v.zzyz; + ivec4 zzzx = U.v.zzzx; + ivec4 zzzy = U.v.zzzy; + ivec4 zzzz = U.v.zzzz; +} diff --git a/test/expressions/swizzle/read/packed_vec3/u32.wgsl.expected.glsl b/test/expressions/swizzle/read/packed_vec3/u32.wgsl.expected.glsl index e69de29bb2..68e72afc7b 100644 --- a/test/expressions/swizzle/read/packed_vec3/u32.wgsl.expected.glsl +++ b/test/expressions/swizzle/read/packed_vec3/u32.wgsl.expected.glsl @@ -0,0 +1,144 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + uvec3 v; +}; + +layout (binding = 0) uniform S_1 { + uvec3 v; +} U; + +void f() { + uvec3 v = U.v; + uint x = U.v.x; + uint y = U.v.y; + uint z = U.v.z; + uvec2 xx = U.v.xx; + uvec2 xy = U.v.xy; + uvec2 xz = U.v.xz; + uvec2 yx = U.v.yx; + uvec2 yy = U.v.yy; + uvec2 yz = U.v.yz; + uvec2 zx = U.v.zx; + uvec2 zy = U.v.zy; + uvec2 zz = U.v.zz; + uvec3 xxx = U.v.xxx; + uvec3 xxy = U.v.xxy; + uvec3 xxz = U.v.xxz; + uvec3 xyx = U.v.xyx; + uvec3 xyy = U.v.xyy; + uvec3 xyz = U.v.xyz; + uvec3 xzx = U.v.xzx; + uvec3 xzy = U.v.xzy; + uvec3 xzz = U.v.xzz; + uvec3 yxx = U.v.yxx; + uvec3 yxy = U.v.yxy; + uvec3 yxz = U.v.yxz; + uvec3 yyx = U.v.yyx; + uvec3 yyy = U.v.yyy; + uvec3 yyz = U.v.yyz; + uvec3 yzx = U.v.yzx; + uvec3 yzy = U.v.yzy; + uvec3 yzz = U.v.yzz; + uvec3 zxx = U.v.zxx; + uvec3 zxy = U.v.zxy; + uvec3 zxz = U.v.zxz; + uvec3 zyx = U.v.zyx; + uvec3 zyy = U.v.zyy; + uvec3 zyz = U.v.zyz; + uvec3 zzx = U.v.zzx; + uvec3 zzy = U.v.zzy; + uvec3 zzz = U.v.zzz; + uvec4 xxxx = U.v.xxxx; + uvec4 xxxy = U.v.xxxy; + uvec4 xxxz = U.v.xxxz; + uvec4 xxyx = U.v.xxyx; + uvec4 xxyy = U.v.xxyy; + uvec4 xxyz = U.v.xxyz; + uvec4 xxzx = U.v.xxzx; + uvec4 xxzy = U.v.xxzy; + uvec4 xxzz = U.v.xxzz; + uvec4 xyxx = U.v.xyxx; + uvec4 xyxy = U.v.xyxy; + uvec4 xyxz = U.v.xyxz; + uvec4 xyyx = U.v.xyyx; + uvec4 xyyy = U.v.xyyy; + uvec4 xyyz = U.v.xyyz; + uvec4 xyzx = U.v.xyzx; + uvec4 xyzy = U.v.xyzy; + uvec4 xyzz = U.v.xyzz; + uvec4 xzxx = U.v.xzxx; + uvec4 xzxy = U.v.xzxy; + uvec4 xzxz = U.v.xzxz; + uvec4 xzyx = U.v.xzyx; + uvec4 xzyy = U.v.xzyy; + uvec4 xzyz = U.v.xzyz; + uvec4 xzzx = U.v.xzzx; + uvec4 xzzy = U.v.xzzy; + uvec4 xzzz = U.v.xzzz; + uvec4 yxxx = U.v.yxxx; + uvec4 yxxy = U.v.yxxy; + uvec4 yxxz = U.v.yxxz; + uvec4 yxyx = U.v.yxyx; + uvec4 yxyy = U.v.yxyy; + uvec4 yxyz = U.v.yxyz; + uvec4 yxzx = U.v.yxzx; + uvec4 yxzy = U.v.yxzy; + uvec4 yxzz = U.v.yxzz; + uvec4 yyxx = U.v.yyxx; + uvec4 yyxy = U.v.yyxy; + uvec4 yyxz = U.v.yyxz; + uvec4 yyyx = U.v.yyyx; + uvec4 yyyy = U.v.yyyy; + uvec4 yyyz = U.v.yyyz; + uvec4 yyzx = U.v.yyzx; + uvec4 yyzy = U.v.yyzy; + uvec4 yyzz = U.v.yyzz; + uvec4 yzxx = U.v.yzxx; + uvec4 yzxy = U.v.yzxy; + uvec4 yzxz = U.v.yzxz; + uvec4 yzyx = U.v.yzyx; + uvec4 yzyy = U.v.yzyy; + uvec4 yzyz = U.v.yzyz; + uvec4 yzzx = U.v.yzzx; + uvec4 yzzy = U.v.yzzy; + uvec4 yzzz = U.v.yzzz; + uvec4 zxxx = U.v.zxxx; + uvec4 zxxy = U.v.zxxy; + uvec4 zxxz = U.v.zxxz; + uvec4 zxyx = U.v.zxyx; + uvec4 zxyy = U.v.zxyy; + uvec4 zxyz = U.v.zxyz; + uvec4 zxzx = U.v.zxzx; + uvec4 zxzy = U.v.zxzy; + uvec4 zxzz = U.v.zxzz; + uvec4 zyxx = U.v.zyxx; + uvec4 zyxy = U.v.zyxy; + uvec4 zyxz = U.v.zyxz; + uvec4 zyyx = U.v.zyyx; + uvec4 zyyy = U.v.zyyy; + uvec4 zyyz = U.v.zyyz; + uvec4 zyzx = U.v.zyzx; + uvec4 zyzy = U.v.zyzy; + uvec4 zyzz = U.v.zyzz; + uvec4 zzxx = U.v.zzxx; + uvec4 zzxy = U.v.zzxy; + uvec4 zzxz = U.v.zzxz; + uvec4 zzyx = U.v.zzyx; + uvec4 zzyy = U.v.zzyy; + uvec4 zzyz = U.v.zzyz; + uvec4 zzzx = U.v.zzzx; + uvec4 zzzy = U.v.zzzy; + uvec4 zzzz = U.v.zzzz; +} diff --git a/test/expressions/swizzle/read/vec3/f32.wgsl.expected.glsl b/test/expressions/swizzle/read/vec3/f32.wgsl.expected.glsl index e69de29bb2..8ca7c27167 100644 --- a/test/expressions/swizzle/read/vec3/f32.wgsl.expected.glsl +++ b/test/expressions/swizzle/read/vec3/f32.wgsl.expected.glsl @@ -0,0 +1,142 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + vec3 v; +}; + +S P = S(vec3(0.0f, 0.0f, 0.0f)); + +void f() { + vec3 v = P.v; + float x = P.v.x; + float y = P.v.y; + float z = P.v.z; + vec2 xx = P.v.xx; + vec2 xy = P.v.xy; + vec2 xz = P.v.xz; + vec2 yx = P.v.yx; + vec2 yy = P.v.yy; + vec2 yz = P.v.yz; + vec2 zx = P.v.zx; + vec2 zy = P.v.zy; + vec2 zz = P.v.zz; + vec3 xxx = P.v.xxx; + vec3 xxy = P.v.xxy; + vec3 xxz = P.v.xxz; + vec3 xyx = P.v.xyx; + vec3 xyy = P.v.xyy; + vec3 xyz = P.v.xyz; + vec3 xzx = P.v.xzx; + vec3 xzy = P.v.xzy; + vec3 xzz = P.v.xzz; + vec3 yxx = P.v.yxx; + vec3 yxy = P.v.yxy; + vec3 yxz = P.v.yxz; + vec3 yyx = P.v.yyx; + vec3 yyy = P.v.yyy; + vec3 yyz = P.v.yyz; + vec3 yzx = P.v.yzx; + vec3 yzy = P.v.yzy; + vec3 yzz = P.v.yzz; + vec3 zxx = P.v.zxx; + vec3 zxy = P.v.zxy; + vec3 zxz = P.v.zxz; + vec3 zyx = P.v.zyx; + vec3 zyy = P.v.zyy; + vec3 zyz = P.v.zyz; + vec3 zzx = P.v.zzx; + vec3 zzy = P.v.zzy; + vec3 zzz = P.v.zzz; + vec4 xxxx = P.v.xxxx; + vec4 xxxy = P.v.xxxy; + vec4 xxxz = P.v.xxxz; + vec4 xxyx = P.v.xxyx; + vec4 xxyy = P.v.xxyy; + vec4 xxyz = P.v.xxyz; + vec4 xxzx = P.v.xxzx; + vec4 xxzy = P.v.xxzy; + vec4 xxzz = P.v.xxzz; + vec4 xyxx = P.v.xyxx; + vec4 xyxy = P.v.xyxy; + vec4 xyxz = P.v.xyxz; + vec4 xyyx = P.v.xyyx; + vec4 xyyy = P.v.xyyy; + vec4 xyyz = P.v.xyyz; + vec4 xyzx = P.v.xyzx; + vec4 xyzy = P.v.xyzy; + vec4 xyzz = P.v.xyzz; + vec4 xzxx = P.v.xzxx; + vec4 xzxy = P.v.xzxy; + vec4 xzxz = P.v.xzxz; + vec4 xzyx = P.v.xzyx; + vec4 xzyy = P.v.xzyy; + vec4 xzyz = P.v.xzyz; + vec4 xzzx = P.v.xzzx; + vec4 xzzy = P.v.xzzy; + vec4 xzzz = P.v.xzzz; + vec4 yxxx = P.v.yxxx; + vec4 yxxy = P.v.yxxy; + vec4 yxxz = P.v.yxxz; + vec4 yxyx = P.v.yxyx; + vec4 yxyy = P.v.yxyy; + vec4 yxyz = P.v.yxyz; + vec4 yxzx = P.v.yxzx; + vec4 yxzy = P.v.yxzy; + vec4 yxzz = P.v.yxzz; + vec4 yyxx = P.v.yyxx; + vec4 yyxy = P.v.yyxy; + vec4 yyxz = P.v.yyxz; + vec4 yyyx = P.v.yyyx; + vec4 yyyy = P.v.yyyy; + vec4 yyyz = P.v.yyyz; + vec4 yyzx = P.v.yyzx; + vec4 yyzy = P.v.yyzy; + vec4 yyzz = P.v.yyzz; + vec4 yzxx = P.v.yzxx; + vec4 yzxy = P.v.yzxy; + vec4 yzxz = P.v.yzxz; + vec4 yzyx = P.v.yzyx; + vec4 yzyy = P.v.yzyy; + vec4 yzyz = P.v.yzyz; + vec4 yzzx = P.v.yzzx; + vec4 yzzy = P.v.yzzy; + vec4 yzzz = P.v.yzzz; + vec4 zxxx = P.v.zxxx; + vec4 zxxy = P.v.zxxy; + vec4 zxxz = P.v.zxxz; + vec4 zxyx = P.v.zxyx; + vec4 zxyy = P.v.zxyy; + vec4 zxyz = P.v.zxyz; + vec4 zxzx = P.v.zxzx; + vec4 zxzy = P.v.zxzy; + vec4 zxzz = P.v.zxzz; + vec4 zyxx = P.v.zyxx; + vec4 zyxy = P.v.zyxy; + vec4 zyxz = P.v.zyxz; + vec4 zyyx = P.v.zyyx; + vec4 zyyy = P.v.zyyy; + vec4 zyyz = P.v.zyyz; + vec4 zyzx = P.v.zyzx; + vec4 zyzy = P.v.zyzy; + vec4 zyzz = P.v.zyzz; + vec4 zzxx = P.v.zzxx; + vec4 zzxy = P.v.zzxy; + vec4 zzxz = P.v.zzxz; + vec4 zzyx = P.v.zzyx; + vec4 zzyy = P.v.zzyy; + vec4 zzyz = P.v.zzyz; + vec4 zzzx = P.v.zzzx; + vec4 zzzy = P.v.zzzy; + vec4 zzzz = P.v.zzzz; +} diff --git a/test/expressions/swizzle/read/vec3/i32.wgsl.expected.glsl b/test/expressions/swizzle/read/vec3/i32.wgsl.expected.glsl index e69de29bb2..65df5663ef 100644 --- a/test/expressions/swizzle/read/vec3/i32.wgsl.expected.glsl +++ b/test/expressions/swizzle/read/vec3/i32.wgsl.expected.glsl @@ -0,0 +1,142 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + ivec3 v; +}; + +S P = S(ivec3(0, 0, 0)); + +void f() { + ivec3 v = P.v; + int x = P.v.x; + int y = P.v.y; + int z = P.v.z; + ivec2 xx = P.v.xx; + ivec2 xy = P.v.xy; + ivec2 xz = P.v.xz; + ivec2 yx = P.v.yx; + ivec2 yy = P.v.yy; + ivec2 yz = P.v.yz; + ivec2 zx = P.v.zx; + ivec2 zy = P.v.zy; + ivec2 zz = P.v.zz; + ivec3 xxx = P.v.xxx; + ivec3 xxy = P.v.xxy; + ivec3 xxz = P.v.xxz; + ivec3 xyx = P.v.xyx; + ivec3 xyy = P.v.xyy; + ivec3 xyz = P.v.xyz; + ivec3 xzx = P.v.xzx; + ivec3 xzy = P.v.xzy; + ivec3 xzz = P.v.xzz; + ivec3 yxx = P.v.yxx; + ivec3 yxy = P.v.yxy; + ivec3 yxz = P.v.yxz; + ivec3 yyx = P.v.yyx; + ivec3 yyy = P.v.yyy; + ivec3 yyz = P.v.yyz; + ivec3 yzx = P.v.yzx; + ivec3 yzy = P.v.yzy; + ivec3 yzz = P.v.yzz; + ivec3 zxx = P.v.zxx; + ivec3 zxy = P.v.zxy; + ivec3 zxz = P.v.zxz; + ivec3 zyx = P.v.zyx; + ivec3 zyy = P.v.zyy; + ivec3 zyz = P.v.zyz; + ivec3 zzx = P.v.zzx; + ivec3 zzy = P.v.zzy; + ivec3 zzz = P.v.zzz; + ivec4 xxxx = P.v.xxxx; + ivec4 xxxy = P.v.xxxy; + ivec4 xxxz = P.v.xxxz; + ivec4 xxyx = P.v.xxyx; + ivec4 xxyy = P.v.xxyy; + ivec4 xxyz = P.v.xxyz; + ivec4 xxzx = P.v.xxzx; + ivec4 xxzy = P.v.xxzy; + ivec4 xxzz = P.v.xxzz; + ivec4 xyxx = P.v.xyxx; + ivec4 xyxy = P.v.xyxy; + ivec4 xyxz = P.v.xyxz; + ivec4 xyyx = P.v.xyyx; + ivec4 xyyy = P.v.xyyy; + ivec4 xyyz = P.v.xyyz; + ivec4 xyzx = P.v.xyzx; + ivec4 xyzy = P.v.xyzy; + ivec4 xyzz = P.v.xyzz; + ivec4 xzxx = P.v.xzxx; + ivec4 xzxy = P.v.xzxy; + ivec4 xzxz = P.v.xzxz; + ivec4 xzyx = P.v.xzyx; + ivec4 xzyy = P.v.xzyy; + ivec4 xzyz = P.v.xzyz; + ivec4 xzzx = P.v.xzzx; + ivec4 xzzy = P.v.xzzy; + ivec4 xzzz = P.v.xzzz; + ivec4 yxxx = P.v.yxxx; + ivec4 yxxy = P.v.yxxy; + ivec4 yxxz = P.v.yxxz; + ivec4 yxyx = P.v.yxyx; + ivec4 yxyy = P.v.yxyy; + ivec4 yxyz = P.v.yxyz; + ivec4 yxzx = P.v.yxzx; + ivec4 yxzy = P.v.yxzy; + ivec4 yxzz = P.v.yxzz; + ivec4 yyxx = P.v.yyxx; + ivec4 yyxy = P.v.yyxy; + ivec4 yyxz = P.v.yyxz; + ivec4 yyyx = P.v.yyyx; + ivec4 yyyy = P.v.yyyy; + ivec4 yyyz = P.v.yyyz; + ivec4 yyzx = P.v.yyzx; + ivec4 yyzy = P.v.yyzy; + ivec4 yyzz = P.v.yyzz; + ivec4 yzxx = P.v.yzxx; + ivec4 yzxy = P.v.yzxy; + ivec4 yzxz = P.v.yzxz; + ivec4 yzyx = P.v.yzyx; + ivec4 yzyy = P.v.yzyy; + ivec4 yzyz = P.v.yzyz; + ivec4 yzzx = P.v.yzzx; + ivec4 yzzy = P.v.yzzy; + ivec4 yzzz = P.v.yzzz; + ivec4 zxxx = P.v.zxxx; + ivec4 zxxy = P.v.zxxy; + ivec4 zxxz = P.v.zxxz; + ivec4 zxyx = P.v.zxyx; + ivec4 zxyy = P.v.zxyy; + ivec4 zxyz = P.v.zxyz; + ivec4 zxzx = P.v.zxzx; + ivec4 zxzy = P.v.zxzy; + ivec4 zxzz = P.v.zxzz; + ivec4 zyxx = P.v.zyxx; + ivec4 zyxy = P.v.zyxy; + ivec4 zyxz = P.v.zyxz; + ivec4 zyyx = P.v.zyyx; + ivec4 zyyy = P.v.zyyy; + ivec4 zyyz = P.v.zyyz; + ivec4 zyzx = P.v.zyzx; + ivec4 zyzy = P.v.zyzy; + ivec4 zyzz = P.v.zyzz; + ivec4 zzxx = P.v.zzxx; + ivec4 zzxy = P.v.zzxy; + ivec4 zzxz = P.v.zzxz; + ivec4 zzyx = P.v.zzyx; + ivec4 zzyy = P.v.zzyy; + ivec4 zzyz = P.v.zzyz; + ivec4 zzzx = P.v.zzzx; + ivec4 zzzy = P.v.zzzy; + ivec4 zzzz = P.v.zzzz; +} diff --git a/test/expressions/swizzle/read/vec3/u32.wgsl.expected.glsl b/test/expressions/swizzle/read/vec3/u32.wgsl.expected.glsl index e69de29bb2..5616b2f6fe 100644 --- a/test/expressions/swizzle/read/vec3/u32.wgsl.expected.glsl +++ b/test/expressions/swizzle/read/vec3/u32.wgsl.expected.glsl @@ -0,0 +1,142 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + uvec3 v; +}; + +S P = S(uvec3(0u, 0u, 0u)); + +void f() { + uvec3 v = P.v; + uint x = P.v.x; + uint y = P.v.y; + uint z = P.v.z; + uvec2 xx = P.v.xx; + uvec2 xy = P.v.xy; + uvec2 xz = P.v.xz; + uvec2 yx = P.v.yx; + uvec2 yy = P.v.yy; + uvec2 yz = P.v.yz; + uvec2 zx = P.v.zx; + uvec2 zy = P.v.zy; + uvec2 zz = P.v.zz; + uvec3 xxx = P.v.xxx; + uvec3 xxy = P.v.xxy; + uvec3 xxz = P.v.xxz; + uvec3 xyx = P.v.xyx; + uvec3 xyy = P.v.xyy; + uvec3 xyz = P.v.xyz; + uvec3 xzx = P.v.xzx; + uvec3 xzy = P.v.xzy; + uvec3 xzz = P.v.xzz; + uvec3 yxx = P.v.yxx; + uvec3 yxy = P.v.yxy; + uvec3 yxz = P.v.yxz; + uvec3 yyx = P.v.yyx; + uvec3 yyy = P.v.yyy; + uvec3 yyz = P.v.yyz; + uvec3 yzx = P.v.yzx; + uvec3 yzy = P.v.yzy; + uvec3 yzz = P.v.yzz; + uvec3 zxx = P.v.zxx; + uvec3 zxy = P.v.zxy; + uvec3 zxz = P.v.zxz; + uvec3 zyx = P.v.zyx; + uvec3 zyy = P.v.zyy; + uvec3 zyz = P.v.zyz; + uvec3 zzx = P.v.zzx; + uvec3 zzy = P.v.zzy; + uvec3 zzz = P.v.zzz; + uvec4 xxxx = P.v.xxxx; + uvec4 xxxy = P.v.xxxy; + uvec4 xxxz = P.v.xxxz; + uvec4 xxyx = P.v.xxyx; + uvec4 xxyy = P.v.xxyy; + uvec4 xxyz = P.v.xxyz; + uvec4 xxzx = P.v.xxzx; + uvec4 xxzy = P.v.xxzy; + uvec4 xxzz = P.v.xxzz; + uvec4 xyxx = P.v.xyxx; + uvec4 xyxy = P.v.xyxy; + uvec4 xyxz = P.v.xyxz; + uvec4 xyyx = P.v.xyyx; + uvec4 xyyy = P.v.xyyy; + uvec4 xyyz = P.v.xyyz; + uvec4 xyzx = P.v.xyzx; + uvec4 xyzy = P.v.xyzy; + uvec4 xyzz = P.v.xyzz; + uvec4 xzxx = P.v.xzxx; + uvec4 xzxy = P.v.xzxy; + uvec4 xzxz = P.v.xzxz; + uvec4 xzyx = P.v.xzyx; + uvec4 xzyy = P.v.xzyy; + uvec4 xzyz = P.v.xzyz; + uvec4 xzzx = P.v.xzzx; + uvec4 xzzy = P.v.xzzy; + uvec4 xzzz = P.v.xzzz; + uvec4 yxxx = P.v.yxxx; + uvec4 yxxy = P.v.yxxy; + uvec4 yxxz = P.v.yxxz; + uvec4 yxyx = P.v.yxyx; + uvec4 yxyy = P.v.yxyy; + uvec4 yxyz = P.v.yxyz; + uvec4 yxzx = P.v.yxzx; + uvec4 yxzy = P.v.yxzy; + uvec4 yxzz = P.v.yxzz; + uvec4 yyxx = P.v.yyxx; + uvec4 yyxy = P.v.yyxy; + uvec4 yyxz = P.v.yyxz; + uvec4 yyyx = P.v.yyyx; + uvec4 yyyy = P.v.yyyy; + uvec4 yyyz = P.v.yyyz; + uvec4 yyzx = P.v.yyzx; + uvec4 yyzy = P.v.yyzy; + uvec4 yyzz = P.v.yyzz; + uvec4 yzxx = P.v.yzxx; + uvec4 yzxy = P.v.yzxy; + uvec4 yzxz = P.v.yzxz; + uvec4 yzyx = P.v.yzyx; + uvec4 yzyy = P.v.yzyy; + uvec4 yzyz = P.v.yzyz; + uvec4 yzzx = P.v.yzzx; + uvec4 yzzy = P.v.yzzy; + uvec4 yzzz = P.v.yzzz; + uvec4 zxxx = P.v.zxxx; + uvec4 zxxy = P.v.zxxy; + uvec4 zxxz = P.v.zxxz; + uvec4 zxyx = P.v.zxyx; + uvec4 zxyy = P.v.zxyy; + uvec4 zxyz = P.v.zxyz; + uvec4 zxzx = P.v.zxzx; + uvec4 zxzy = P.v.zxzy; + uvec4 zxzz = P.v.zxzz; + uvec4 zyxx = P.v.zyxx; + uvec4 zyxy = P.v.zyxy; + uvec4 zyxz = P.v.zyxz; + uvec4 zyyx = P.v.zyyx; + uvec4 zyyy = P.v.zyyy; + uvec4 zyyz = P.v.zyyz; + uvec4 zyzx = P.v.zyzx; + uvec4 zyzy = P.v.zyzy; + uvec4 zyzz = P.v.zyzz; + uvec4 zzxx = P.v.zzxx; + uvec4 zzxy = P.v.zzxy; + uvec4 zzxz = P.v.zzxz; + uvec4 zzyx = P.v.zzyx; + uvec4 zzyy = P.v.zzyy; + uvec4 zzyz = P.v.zzyz; + uvec4 zzzx = P.v.zzzx; + uvec4 zzzy = P.v.zzzy; + uvec4 zzzz = P.v.zzzz; +} diff --git a/test/expressions/swizzle/write/packed_vec3/f32.wgsl.expected.glsl b/test/expressions/swizzle/write/packed_vec3/f32.wgsl.expected.glsl index e69de29bb2..1e33fd53b0 100644 --- a/test/expressions/swizzle/write/packed_vec3/f32.wgsl.expected.glsl +++ b/test/expressions/swizzle/write/packed_vec3/f32.wgsl.expected.glsl @@ -0,0 +1,27 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + vec3 v; +}; + +layout (binding = 0) buffer S_1 { + vec3 v; +} U; + +void f() { + U.v = vec3(1.0f, 2.0f, 3.0f); + U.v.x = 1.0f; + U.v.y = 2.0f; + U.v.z = 3.0f; +} diff --git a/test/expressions/swizzle/write/packed_vec3/i32.wgsl.expected.glsl b/test/expressions/swizzle/write/packed_vec3/i32.wgsl.expected.glsl index e69de29bb2..11c7c30afb 100644 --- a/test/expressions/swizzle/write/packed_vec3/i32.wgsl.expected.glsl +++ b/test/expressions/swizzle/write/packed_vec3/i32.wgsl.expected.glsl @@ -0,0 +1,27 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + ivec3 v; +}; + +layout (binding = 0) buffer S_1 { + ivec3 v; +} U; + +void f() { + U.v = ivec3(1, 2, 3); + U.v.x = 1; + U.v.y = 2; + U.v.z = 3; +} diff --git a/test/expressions/swizzle/write/packed_vec3/u32.wgsl.expected.glsl b/test/expressions/swizzle/write/packed_vec3/u32.wgsl.expected.glsl index e69de29bb2..4745c3c01c 100644 --- a/test/expressions/swizzle/write/packed_vec3/u32.wgsl.expected.glsl +++ b/test/expressions/swizzle/write/packed_vec3/u32.wgsl.expected.glsl @@ -0,0 +1,27 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + uvec3 v; +}; + +layout (binding = 0) buffer S_1 { + uvec3 v; +} U; + +void f() { + U.v = uvec3(1u, 2u, 3u); + U.v.x = 1u; + U.v.y = 2u; + U.v.z = 3u; +} diff --git a/test/expressions/swizzle/write/vec3/f32.wgsl.expected.glsl b/test/expressions/swizzle/write/vec3/f32.wgsl.expected.glsl index e69de29bb2..5cf34f47ff 100644 --- a/test/expressions/swizzle/write/vec3/f32.wgsl.expected.glsl +++ b/test/expressions/swizzle/write/vec3/f32.wgsl.expected.glsl @@ -0,0 +1,25 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + vec3 v; +}; + +S P = S(vec3(0.0f, 0.0f, 0.0f)); + +void f() { + P.v = vec3(1.0f, 2.0f, 3.0f); + P.v.x = 1.0f; + P.v.y = 2.0f; + P.v.z = 3.0f; +} diff --git a/test/expressions/swizzle/write/vec3/i32.wgsl.expected.glsl b/test/expressions/swizzle/write/vec3/i32.wgsl.expected.glsl index e69de29bb2..578002578c 100644 --- a/test/expressions/swizzle/write/vec3/i32.wgsl.expected.glsl +++ b/test/expressions/swizzle/write/vec3/i32.wgsl.expected.glsl @@ -0,0 +1,25 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + ivec3 v; +}; + +S P = S(ivec3(0, 0, 0)); + +void f() { + P.v = ivec3(1, 2, 3); + P.v.x = 1; + P.v.y = 2; + P.v.z = 3; +} diff --git a/test/expressions/swizzle/write/vec3/u32.wgsl.expected.glsl b/test/expressions/swizzle/write/vec3/u32.wgsl.expected.glsl index e69de29bb2..053311a43d 100644 --- a/test/expressions/swizzle/write/vec3/u32.wgsl.expected.glsl +++ b/test/expressions/swizzle/write/vec3/u32.wgsl.expected.glsl @@ -0,0 +1,25 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + uvec3 v; +}; + +S P = S(uvec3(0u, 0u, 0u)); + +void f() { + P.v = uvec3(1u, 2u, 3u); + P.v.x = 1u; + P.v.y = 2u; + P.v.z = 3u; +} diff --git a/test/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl.expected.glsl index e69de29bb2..ce52794bd2 100644 --- a/test/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2 m = mat2(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl.expected.glsl index e69de29bb2..1b41ea2c34 100644 --- a/test/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2 m = mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); diff --git a/test/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl.expected.glsl index e69de29bb2..ce52794bd2 100644 --- a/test/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2 m = mat2(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/expressions/type_ctor/mat2x2/inferred/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x2/inferred/vectors/f32.wgsl.expected.glsl index e69de29bb2..1b41ea2c34 100644 --- a/test/expressions/type_ctor/mat2x2/inferred/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x2/inferred/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2 m = mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); diff --git a/test/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl.expected.glsl index e69de29bb2..57f04b5645 100644 --- a/test/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2x3 m = mat2x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl.expected.glsl index e69de29bb2..7c1c90b075 100644 --- a/test/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2x3 m = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); diff --git a/test/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl.expected.glsl index e69de29bb2..57f04b5645 100644 --- a/test/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2x3 m = mat2x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl.expected.glsl index e69de29bb2..7c1c90b075 100644 --- a/test/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2x3 m = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); diff --git a/test/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl.expected.glsl index e69de29bb2..a487bc8927 100644 --- a/test/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2x4 m = mat2x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl.expected.glsl index e69de29bb2..ceca1c826a 100644 --- a/test/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2x4 m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); diff --git a/test/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl.expected.glsl index e69de29bb2..a487bc8927 100644 --- a/test/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2x4 m = mat2x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl.expected.glsl index e69de29bb2..ceca1c826a 100644 --- a/test/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat2x4 m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); diff --git a/test/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl.expected.glsl index e69de29bb2..1f1bbe196f 100644 --- a/test/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3x2 m = mat3x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl.expected.glsl index e69de29bb2..19bfb0b9b4 100644 --- a/test/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3x2 m = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); diff --git a/test/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl.expected.glsl index e69de29bb2..1f1bbe196f 100644 --- a/test/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3x2 m = mat3x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl.expected.glsl index e69de29bb2..19bfb0b9b4 100644 --- a/test/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3x2 m = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); diff --git a/test/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl.expected.glsl index e69de29bb2..3657e1dd03 100644 --- a/test/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3 m = mat3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); diff --git a/test/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl.expected.glsl index e69de29bb2..1a551bb9d1 100644 --- a/test/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3 m = mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); diff --git a/test/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl.expected.glsl index e69de29bb2..3657e1dd03 100644 --- a/test/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3 m = mat3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); diff --git a/test/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl.expected.glsl index e69de29bb2..1a551bb9d1 100644 --- a/test/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3 m = mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); diff --git a/test/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl.expected.glsl index e69de29bb2..ef53b66241 100644 --- a/test/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3x4 m = mat3x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl.expected.glsl index e69de29bb2..48eb1fafca 100644 --- a/test/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const 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)); diff --git a/test/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl.expected.glsl index e69de29bb2..ef53b66241 100644 --- a/test/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat3x4 m = mat3x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl.expected.glsl index e69de29bb2..48eb1fafca 100644 --- a/test/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const 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)); diff --git a/test/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl.expected.glsl index e69de29bb2..503820e4e3 100644 --- a/test/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat4x2 m = mat4x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl.expected.glsl index e69de29bb2..17038f0154 100644 --- a/test/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat4x2 m = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); diff --git a/test/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl.expected.glsl index e69de29bb2..503820e4e3 100644 --- a/test/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat4x2 m = mat4x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl.expected.glsl index e69de29bb2..17038f0154 100644 --- a/test/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat4x2 m = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); diff --git a/test/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl.expected.glsl index e69de29bb2..085b370a94 100644 --- a/test/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat4x3 m = mat4x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl.expected.glsl index e69de29bb2..12a476b137 100644 --- a/test/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const 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)); diff --git a/test/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl.expected.glsl index e69de29bb2..085b370a94 100644 --- a/test/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat4x3 m = mat4x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl.expected.glsl index e69de29bb2..12a476b137 100644 --- a/test/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const 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)); diff --git a/test/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl.expected.glsl index e69de29bb2..4d57ae100c 100644 --- a/test/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat4 m = mat4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f); diff --git a/test/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl.expected.glsl index e69de29bb2..0d9377ef07 100644 --- a/test/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const 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)); diff --git a/test/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl.expected.glsl index e69de29bb2..4d57ae100c 100644 --- a/test/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const mat4 m = mat4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f); diff --git a/test/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl.expected.glsl b/test/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl.expected.glsl index e69de29bb2..0d9377ef07 100644 --- a/test/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const 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)); diff --git a/test/expressions/type_ctor/vec2/explicit/bool.wgsl.expected.glsl b/test/expressions/type_ctor/vec2/explicit/bool.wgsl.expected.glsl index e69de29bb2..b008ac779d 100644 --- a/test/expressions/type_ctor/vec2/explicit/bool.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec2/explicit/bool.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const bvec2 v = bvec2(false, true); diff --git a/test/expressions/type_ctor/vec2/explicit/f32.wgsl.expected.glsl b/test/expressions/type_ctor/vec2/explicit/f32.wgsl.expected.glsl index e69de29bb2..c507eb00d2 100644 --- a/test/expressions/type_ctor/vec2/explicit/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec2/explicit/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const vec2 v = vec2(0.0f, 1.0f); diff --git a/test/expressions/type_ctor/vec2/explicit/i32.wgsl.expected.glsl b/test/expressions/type_ctor/vec2/explicit/i32.wgsl.expected.glsl index e69de29bb2..eaf0db6068 100644 --- a/test/expressions/type_ctor/vec2/explicit/i32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec2/explicit/i32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const ivec2 v = ivec2(0, 1); diff --git a/test/expressions/type_ctor/vec2/explicit/u32.wgsl.expected.glsl b/test/expressions/type_ctor/vec2/explicit/u32.wgsl.expected.glsl index e69de29bb2..9bfce2de16 100644 --- a/test/expressions/type_ctor/vec2/explicit/u32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec2/explicit/u32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const uvec2 v = uvec2(0u, 1u); diff --git a/test/expressions/type_ctor/vec2/inferred/bool.wgsl.expected.glsl b/test/expressions/type_ctor/vec2/inferred/bool.wgsl.expected.glsl index e69de29bb2..b008ac779d 100644 --- a/test/expressions/type_ctor/vec2/inferred/bool.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec2/inferred/bool.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const bvec2 v = bvec2(false, true); diff --git a/test/expressions/type_ctor/vec2/inferred/f32.wgsl.expected.glsl b/test/expressions/type_ctor/vec2/inferred/f32.wgsl.expected.glsl index e69de29bb2..c507eb00d2 100644 --- a/test/expressions/type_ctor/vec2/inferred/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec2/inferred/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const vec2 v = vec2(0.0f, 1.0f); diff --git a/test/expressions/type_ctor/vec2/inferred/i32.wgsl.expected.glsl b/test/expressions/type_ctor/vec2/inferred/i32.wgsl.expected.glsl index e69de29bb2..eaf0db6068 100644 --- a/test/expressions/type_ctor/vec2/inferred/i32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec2/inferred/i32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const ivec2 v = ivec2(0, 1); diff --git a/test/expressions/type_ctor/vec2/inferred/u32.wgsl.expected.glsl b/test/expressions/type_ctor/vec2/inferred/u32.wgsl.expected.glsl index e69de29bb2..9bfce2de16 100644 --- a/test/expressions/type_ctor/vec2/inferred/u32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec2/inferred/u32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const uvec2 v = uvec2(0u, 1u); diff --git a/test/expressions/type_ctor/vec3/explicit/bool.wgsl.expected.glsl b/test/expressions/type_ctor/vec3/explicit/bool.wgsl.expected.glsl index e69de29bb2..e9a10c104e 100644 --- a/test/expressions/type_ctor/vec3/explicit/bool.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec3/explicit/bool.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const bvec3 v = bvec3(false, true, false); diff --git a/test/expressions/type_ctor/vec3/explicit/f32.wgsl.expected.glsl b/test/expressions/type_ctor/vec3/explicit/f32.wgsl.expected.glsl index e69de29bb2..315fe8cc94 100644 --- a/test/expressions/type_ctor/vec3/explicit/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec3/explicit/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const vec3 v = vec3(0.0f, 1.0f, 2.0f); diff --git a/test/expressions/type_ctor/vec3/explicit/i32.wgsl.expected.glsl b/test/expressions/type_ctor/vec3/explicit/i32.wgsl.expected.glsl index e69de29bb2..bbef57624e 100644 --- a/test/expressions/type_ctor/vec3/explicit/i32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec3/explicit/i32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const ivec3 v = ivec3(0, 1, 2); diff --git a/test/expressions/type_ctor/vec3/explicit/u32.wgsl.expected.glsl b/test/expressions/type_ctor/vec3/explicit/u32.wgsl.expected.glsl index e69de29bb2..68d9ed495d 100644 --- a/test/expressions/type_ctor/vec3/explicit/u32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec3/explicit/u32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const uvec3 v = uvec3(0u, 1u, 2u); diff --git a/test/expressions/type_ctor/vec4/explicit/bool.wgsl.expected.glsl b/test/expressions/type_ctor/vec4/explicit/bool.wgsl.expected.glsl index e69de29bb2..47ddaebfaf 100644 --- a/test/expressions/type_ctor/vec4/explicit/bool.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec4/explicit/bool.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const bvec4 v = bvec4(false, true, false, true); diff --git a/test/expressions/type_ctor/vec4/explicit/f32.wgsl.expected.glsl b/test/expressions/type_ctor/vec4/explicit/f32.wgsl.expected.glsl index e69de29bb2..d5bb0b5080 100644 --- a/test/expressions/type_ctor/vec4/explicit/f32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec4/explicit/f32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const vec4 v = vec4(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/expressions/type_ctor/vec4/explicit/i32.wgsl.expected.glsl b/test/expressions/type_ctor/vec4/explicit/i32.wgsl.expected.glsl index e69de29bb2..76fbdd0349 100644 --- a/test/expressions/type_ctor/vec4/explicit/i32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec4/explicit/i32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const ivec4 v = ivec4(0, 1, 2, 3); diff --git a/test/expressions/type_ctor/vec4/explicit/u32.wgsl.expected.glsl b/test/expressions/type_ctor/vec4/explicit/u32.wgsl.expected.glsl index e69de29bb2..17a431eac2 100644 --- a/test/expressions/type_ctor/vec4/explicit/u32.wgsl.expected.glsl +++ b/test/expressions/type_ctor/vec4/explicit/u32.wgsl.expected.glsl @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const uvec4 v = uvec4(0u, 1u, 2u, 3u); diff --git a/test/expressions/unary/complement/complement.wgsl.expected.glsl b/test/expressions/unary/complement/complement.wgsl.expected.glsl index e69de29bb2..9edee88ee4 100644 --- a/test/expressions/unary/complement/complement.wgsl.expected.glsl +++ b/test/expressions/unary/complement/complement.wgsl.expected.glsl @@ -0,0 +1,28 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int i(int x) { + return ~(x); +} + +uint u(uint x) { + return ~(x); +} + +ivec4 vi(ivec4 x) { + return ~(x); +} + +uvec4 vu(uvec4 x) { + return ~(x); +} diff --git a/test/expressions/unary/negate/negate.wgsl.expected.glsl b/test/expressions/unary/negate/negate.wgsl.expected.glsl index e69de29bb2..b2ace9d614 100644 --- a/test/expressions/unary/negate/negate.wgsl.expected.glsl +++ b/test/expressions/unary/negate/negate.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int i(int x) { + return -(x); +} + +ivec4 vi(ivec4 x) { + return -(x); +} diff --git a/test/expressions/zero_init/array/bool.wgsl.expected.glsl b/test/expressions/zero_init/array/bool.wgsl.expected.glsl index e69de29bb2..57b69ce2ab 100644 --- a/test/expressions/zero_init/array/bool.wgsl.expected.glsl +++ b/test/expressions/zero_init/array/bool.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + bool v[4] = bool[4](false, false, false, false); +} diff --git a/test/expressions/zero_init/array/f32.wgsl.expected.glsl b/test/expressions/zero_init/array/f32.wgsl.expected.glsl index e69de29bb2..622b0babe7 100644 --- a/test/expressions/zero_init/array/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/array/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + float v[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/array/i32.wgsl.expected.glsl b/test/expressions/zero_init/array/i32.wgsl.expected.glsl index e69de29bb2..5d2d392ffa 100644 --- a/test/expressions/zero_init/array/i32.wgsl.expected.glsl +++ b/test/expressions/zero_init/array/i32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int v[4] = int[4](0, 0, 0, 0); +} diff --git a/test/expressions/zero_init/array/struct.wgsl.expected.glsl b/test/expressions/zero_init/array/struct.wgsl.expected.glsl index e69de29bb2..65d04903d2 100644 --- a/test/expressions/zero_init/array/struct.wgsl.expected.glsl +++ b/test/expressions/zero_init/array/struct.wgsl.expected.glsl @@ -0,0 +1,23 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + int i; + uint u; + float f; + bool b; +}; + +void f() { + S v[4] = S[4](S(0, 0u, 0.0f, false), S(0, 0u, 0.0f, false), S(0, 0u, 0.0f, false), S(0, 0u, 0.0f, false)); +} diff --git a/test/expressions/zero_init/array/u32.wgsl.expected.glsl b/test/expressions/zero_init/array/u32.wgsl.expected.glsl index e69de29bb2..6a2060907a 100644 --- a/test/expressions/zero_init/array/u32.wgsl.expected.glsl +++ b/test/expressions/zero_init/array/u32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + uint v[4] = uint[4](0u, 0u, 0u, 0u); +} diff --git a/test/expressions/zero_init/mat2x2/f32.wgsl.expected.glsl b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.glsl index e69de29bb2..d333532d26 100644 --- a/test/expressions/zero_init/mat2x2/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat2 v = mat2(0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/mat2x3/f32.wgsl.expected.glsl b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.glsl index e69de29bb2..b836b1ad2c 100644 --- a/test/expressions/zero_init/mat2x3/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat2x3 v = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/mat2x4/f32.wgsl.expected.glsl b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.glsl index e69de29bb2..b575ffd9ca 100644 --- a/test/expressions/zero_init/mat2x4/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat2x4 v = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/mat3x2/f32.wgsl.expected.glsl b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.glsl index e69de29bb2..a5ee3635ec 100644 --- a/test/expressions/zero_init/mat3x2/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat3x2 v = mat3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/mat3x3/f32.wgsl.expected.glsl b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.glsl index e69de29bb2..e28311604d 100644 --- a/test/expressions/zero_init/mat3x3/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat3 v = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/mat3x4/f32.wgsl.expected.glsl b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.glsl index e69de29bb2..a9af0e969a 100644 --- a/test/expressions/zero_init/mat3x4/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat3x4 v = mat3x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/mat4x2/f32.wgsl.expected.glsl b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.glsl index e69de29bb2..22cca40bc2 100644 --- a/test/expressions/zero_init/mat4x2/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat4x2 v = mat4x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/mat4x3/f32.wgsl.expected.glsl b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.glsl index e69de29bb2..2dc748e3fc 100644 --- a/test/expressions/zero_init/mat4x3/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat4x3 v = mat4x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/mat4x4/f32.wgsl.expected.glsl b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.glsl index e69de29bb2..70b877aec3 100644 --- a/test/expressions/zero_init/mat4x4/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + mat4 v = mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/scalar/bool.wgsl.expected.glsl b/test/expressions/zero_init/scalar/bool.wgsl.expected.glsl index e69de29bb2..e8ff5f523c 100644 --- a/test/expressions/zero_init/scalar/bool.wgsl.expected.glsl +++ b/test/expressions/zero_init/scalar/bool.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + bool v = false; +} diff --git a/test/expressions/zero_init/scalar/f32.wgsl.expected.glsl b/test/expressions/zero_init/scalar/f32.wgsl.expected.glsl index e69de29bb2..73fd41cac1 100644 --- a/test/expressions/zero_init/scalar/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/scalar/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + float v = 0.0f; +} diff --git a/test/expressions/zero_init/scalar/i32.wgsl.expected.glsl b/test/expressions/zero_init/scalar/i32.wgsl.expected.glsl index e69de29bb2..37ec2a1ed4 100644 --- a/test/expressions/zero_init/scalar/i32.wgsl.expected.glsl +++ b/test/expressions/zero_init/scalar/i32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int v = 0; +} diff --git a/test/expressions/zero_init/scalar/u32.wgsl.expected.glsl b/test/expressions/zero_init/scalar/u32.wgsl.expected.glsl index e69de29bb2..8b743c5d20 100644 --- a/test/expressions/zero_init/scalar/u32.wgsl.expected.glsl +++ b/test/expressions/zero_init/scalar/u32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + uint v = 0u; +} diff --git a/test/expressions/zero_init/struct/array.wgsl.expected.glsl b/test/expressions/zero_init/struct/array.wgsl.expected.glsl index e69de29bb2..eb0a1461be 100644 --- a/test/expressions/zero_init/struct/array.wgsl.expected.glsl +++ b/test/expressions/zero_init/struct/array.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + float a[4]; +}; + +void f() { + S v = S(float[4](0.0f, 0.0f, 0.0f, 0.0f)); +} diff --git a/test/expressions/zero_init/struct/scalar.wgsl.expected.glsl b/test/expressions/zero_init/struct/scalar.wgsl.expected.glsl index e69de29bb2..1aaa3c6baf 100644 --- a/test/expressions/zero_init/struct/scalar.wgsl.expected.glsl +++ b/test/expressions/zero_init/struct/scalar.wgsl.expected.glsl @@ -0,0 +1,23 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + int i; + uint u; + float f; + bool b; +}; + +void f() { + S v = S(0, 0u, 0.0f, false); +} diff --git a/test/expressions/zero_init/vec2/bool.wgsl.expected.glsl b/test/expressions/zero_init/vec2/bool.wgsl.expected.glsl index e69de29bb2..564132fc6f 100644 --- a/test/expressions/zero_init/vec2/bool.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec2/bool.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + bvec2 v = bvec2(false, false); +} diff --git a/test/expressions/zero_init/vec2/f32.wgsl.expected.glsl b/test/expressions/zero_init/vec2/f32.wgsl.expected.glsl index e69de29bb2..777431cf66 100644 --- a/test/expressions/zero_init/vec2/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec2/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + vec2 v = vec2(0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/vec2/i32.wgsl.expected.glsl b/test/expressions/zero_init/vec2/i32.wgsl.expected.glsl index e69de29bb2..63ced7c188 100644 --- a/test/expressions/zero_init/vec2/i32.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec2/i32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + ivec2 v = ivec2(0, 0); +} diff --git a/test/expressions/zero_init/vec2/u32.wgsl.expected.glsl b/test/expressions/zero_init/vec2/u32.wgsl.expected.glsl index e69de29bb2..9952538a25 100644 --- a/test/expressions/zero_init/vec2/u32.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec2/u32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + uvec2 v = uvec2(0u, 0u); +} diff --git a/test/expressions/zero_init/vec3/bool.wgsl.expected.glsl b/test/expressions/zero_init/vec3/bool.wgsl.expected.glsl index e69de29bb2..8da4d24b49 100644 --- a/test/expressions/zero_init/vec3/bool.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec3/bool.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + bvec3 v = bvec3(false, false, false); +} diff --git a/test/expressions/zero_init/vec3/f32.wgsl.expected.glsl b/test/expressions/zero_init/vec3/f32.wgsl.expected.glsl index e69de29bb2..9bf7e46eee 100644 --- a/test/expressions/zero_init/vec3/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec3/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + vec3 v = vec3(0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/vec3/i32.wgsl.expected.glsl b/test/expressions/zero_init/vec3/i32.wgsl.expected.glsl index e69de29bb2..85ff26bf9c 100644 --- a/test/expressions/zero_init/vec3/i32.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec3/i32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + ivec3 v = ivec3(0, 0, 0); +} diff --git a/test/expressions/zero_init/vec3/u32.wgsl.expected.glsl b/test/expressions/zero_init/vec3/u32.wgsl.expected.glsl index e69de29bb2..9618466f56 100644 --- a/test/expressions/zero_init/vec3/u32.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec3/u32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + uvec3 v = uvec3(0u, 0u, 0u); +} diff --git a/test/expressions/zero_init/vec4/bool.wgsl.expected.glsl b/test/expressions/zero_init/vec4/bool.wgsl.expected.glsl index e69de29bb2..486e93f538 100644 --- a/test/expressions/zero_init/vec4/bool.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec4/bool.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + bvec4 v = bvec4(false, false, false, false); +} diff --git a/test/expressions/zero_init/vec4/f32.wgsl.expected.glsl b/test/expressions/zero_init/vec4/f32.wgsl.expected.glsl index e69de29bb2..a80e2f4511 100644 --- a/test/expressions/zero_init/vec4/f32.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec4/f32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + vec4 v = vec4(0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/vec4/i32.wgsl.expected.glsl b/test/expressions/zero_init/vec4/i32.wgsl.expected.glsl index e69de29bb2..de961206db 100644 --- a/test/expressions/zero_init/vec4/i32.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec4/i32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + ivec4 v = ivec4(0, 0, 0, 0); +} diff --git a/test/expressions/zero_init/vec4/u32.wgsl.expected.glsl b/test/expressions/zero_init/vec4/u32.wgsl.expected.glsl index e69de29bb2..f83dbc49e1 100644 --- a/test/expressions/zero_init/vec4/u32.wgsl.expected.glsl +++ b/test/expressions/zero_init/vec4/u32.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + uvec4 v = uvec4(0u, 0u, 0u, 0u); +} diff --git a/test/identifiers/underscore/double/alias.wgsl.expected.glsl b/test/identifiers/underscore/double/alias.wgsl.expected.glsl index e69de29bb2..53fcf10276 100644 --- a/test/identifiers/underscore/double/alias.wgsl.expected.glsl +++ b/test/identifiers/underscore/double/alias.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int c = 0; + int d = 0; +} diff --git a/test/identifiers/underscore/double/fn.wgsl.expected.glsl b/test/identifiers/underscore/double/fn.wgsl.expected.glsl index e69de29bb2..7b2cd08a85 100644 --- a/test/identifiers/underscore/double/fn.wgsl.expected.glsl +++ b/test/identifiers/underscore/double/fn.wgsl.expected.glsl @@ -0,0 +1,26 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void a() { +} + +void a__() { +} + +void b() { + a(); +} + +void b__() { + a__(); +} diff --git a/test/identifiers/underscore/double/let.wgsl.expected.glsl b/test/identifiers/underscore/double/let.wgsl.expected.glsl index e69de29bb2..8930f1dbcc 100644 --- a/test/identifiers/underscore/double/let.wgsl.expected.glsl +++ b/test/identifiers/underscore/double/let.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const int a = 1; +const int a__ = 2; + +void f() { + int b = a; + int b__ = a__; +} diff --git a/test/identifiers/underscore/double/parameter.wgsl.expected.glsl b/test/identifiers/underscore/double/parameter.wgsl.expected.glsl index e69de29bb2..3fb63a82ed 100644 --- a/test/identifiers/underscore/double/parameter.wgsl.expected.glsl +++ b/test/identifiers/underscore/double/parameter.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f(int a__) { + int b = a__; +} diff --git a/test/identifiers/underscore/double/struct.wgsl.expected.glsl b/test/identifiers/underscore/double/struct.wgsl.expected.glsl index e69de29bb2..42b05678b6 100644 --- a/test/identifiers/underscore/double/struct.wgsl.expected.glsl +++ b/test/identifiers/underscore/double/struct.wgsl.expected.glsl @@ -0,0 +1,24 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct a { + int b; +}; +struct a__ { + int b__; +}; + +void f() { + a__ c = a__(0); + int d = c.b__; +} diff --git a/test/identifiers/underscore/double/var.wgsl.expected.glsl b/test/identifiers/underscore/double/var.wgsl.expected.glsl index e69de29bb2..5ce98aa082 100644 --- a/test/identifiers/underscore/double/var.wgsl.expected.glsl +++ b/test/identifiers/underscore/double/var.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int a = 1; +int a__ = 2; + +void f() { + int b = a; + int b__ = a__; +} diff --git a/test/identifiers/underscore/prefix/lower/alias.wgsl.expected.glsl b/test/identifiers/underscore/prefix/lower/alias.wgsl.expected.glsl index e69de29bb2..53fcf10276 100644 --- a/test/identifiers/underscore/prefix/lower/alias.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/lower/alias.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int c = 0; + int d = 0; +} diff --git a/test/identifiers/underscore/prefix/lower/fn.wgsl.expected.glsl b/test/identifiers/underscore/prefix/lower/fn.wgsl.expected.glsl index e69de29bb2..1160ea6df4 100644 --- a/test/identifiers/underscore/prefix/lower/fn.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/lower/fn.wgsl.expected.glsl @@ -0,0 +1,26 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void a() { +} + +void _a() { +} + +void b() { + a(); +} + +void _b() { + _a(); +} diff --git a/test/identifiers/underscore/prefix/lower/let.wgsl.expected.glsl b/test/identifiers/underscore/prefix/lower/let.wgsl.expected.glsl index e69de29bb2..8f043f147a 100644 --- a/test/identifiers/underscore/prefix/lower/let.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/lower/let.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const int a = 1; +const int _a = 2; + +void f() { + int b = a; + int _b = _a; +} diff --git a/test/identifiers/underscore/prefix/lower/parameter.wgsl.expected.glsl b/test/identifiers/underscore/prefix/lower/parameter.wgsl.expected.glsl index e69de29bb2..670f017c00 100644 --- a/test/identifiers/underscore/prefix/lower/parameter.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/lower/parameter.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f(int _a) { + int b = _a; +} diff --git a/test/identifiers/underscore/prefix/lower/struct.wgsl.expected.glsl b/test/identifiers/underscore/prefix/lower/struct.wgsl.expected.glsl index e69de29bb2..ca7b774eb4 100644 --- a/test/identifiers/underscore/prefix/lower/struct.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/lower/struct.wgsl.expected.glsl @@ -0,0 +1,24 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct a { + int b; +}; +struct _a { + int _b; +}; + +void f() { + _a c = _a(0); + int d = c._b; +} diff --git a/test/identifiers/underscore/prefix/lower/var.wgsl.expected.glsl b/test/identifiers/underscore/prefix/lower/var.wgsl.expected.glsl index e69de29bb2..677a81e7de 100644 --- a/test/identifiers/underscore/prefix/lower/var.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/lower/var.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int a = 1; +int _a = 2; + +void f() { + int b = a; + int _b = _a; +} diff --git a/test/identifiers/underscore/prefix/upper/alias.wgsl.expected.glsl b/test/identifiers/underscore/prefix/upper/alias.wgsl.expected.glsl index e69de29bb2..53fcf10276 100644 --- a/test/identifiers/underscore/prefix/upper/alias.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/upper/alias.wgsl.expected.glsl @@ -0,0 +1,17 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int c = 0; + int d = 0; +} diff --git a/test/identifiers/underscore/prefix/upper/fn.wgsl.expected.glsl b/test/identifiers/underscore/prefix/upper/fn.wgsl.expected.glsl index e69de29bb2..aad927e10c 100644 --- a/test/identifiers/underscore/prefix/upper/fn.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/upper/fn.wgsl.expected.glsl @@ -0,0 +1,26 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void A() { +} + +void _A() { +} + +void B() { + A(); +} + +void _B() { + _A(); +} diff --git a/test/identifiers/underscore/prefix/upper/let.wgsl.expected.glsl b/test/identifiers/underscore/prefix/upper/let.wgsl.expected.glsl index e69de29bb2..6d5f7d2668 100644 --- a/test/identifiers/underscore/prefix/upper/let.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/upper/let.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +const int A = 1; +const int _A = 2; + +void f() { + int B = A; + int _B = _A; +} diff --git a/test/identifiers/underscore/prefix/upper/parameter.wgsl.expected.glsl b/test/identifiers/underscore/prefix/upper/parameter.wgsl.expected.glsl index e69de29bb2..6bed49e2ca 100644 --- a/test/identifiers/underscore/prefix/upper/parameter.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/upper/parameter.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f(int _A) { + int B = _A; +} diff --git a/test/identifiers/underscore/prefix/upper/struct.wgsl.expected.glsl b/test/identifiers/underscore/prefix/upper/struct.wgsl.expected.glsl index e69de29bb2..05d196e8d7 100644 --- a/test/identifiers/underscore/prefix/upper/struct.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/upper/struct.wgsl.expected.glsl @@ -0,0 +1,24 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct A { + int B; +}; +struct _A { + int _B; +}; + +void f() { + _A c = _A(0); + int d = c._B; +} diff --git a/test/identifiers/underscore/prefix/upper/var.wgsl.expected.glsl b/test/identifiers/underscore/prefix/upper/var.wgsl.expected.glsl index e69de29bb2..96d1732f00 100644 --- a/test/identifiers/underscore/prefix/upper/var.wgsl.expected.glsl +++ b/test/identifiers/underscore/prefix/upper/var.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int A = 1; +int _A = 2; + +void f() { + int B = A; + int _B = _A; +} diff --git a/test/loops/loop.wgsl.expected.glsl b/test/loops/loop.wgsl.expected.glsl index e69de29bb2..e0d93302c9 100644 --- a/test/loops/loop.wgsl.expected.glsl +++ b/test/loops/loop.wgsl.expected.glsl @@ -0,0 +1,22 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f() { + int i = 0; + while (true) { + i = (i + 1); + if ((i > 4)) { + return i; + } + } +} diff --git a/test/loops/loop_with_continuing.wgsl.expected.glsl b/test/loops/loop_with_continuing.wgsl.expected.glsl index e69de29bb2..2510e3d60f 100644 --- a/test/loops/loop_with_continuing.wgsl.expected.glsl +++ b/test/loops/loop_with_continuing.wgsl.expected.glsl @@ -0,0 +1,24 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f() { + int i = 0; + while (true) { + if ((i > 4)) { + return i; + } + { + i = (i + 1); + } + } +} diff --git a/test/loops/nested_loops.wgsl.expected.glsl b/test/loops/nested_loops.wgsl.expected.glsl index e69de29bb2..f6a415341a 100644 --- a/test/loops/nested_loops.wgsl.expected.glsl +++ b/test/loops/nested_loops.wgsl.expected.glsl @@ -0,0 +1,29 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f() { + int i = 0; + int j = 0; + while (true) { + i = (i + 1); + if ((i > 4)) { + return 1; + } + while (true) { + j = (j + 1); + if ((j > 4)) { + return 2; + } + } + } +} diff --git a/test/loops/nested_loops_with_continuing.wgsl.expected.glsl b/test/loops/nested_loops_with_continuing.wgsl.expected.glsl index e69de29bb2..23b0e70a8c 100644 --- a/test/loops/nested_loops_with_continuing.wgsl.expected.glsl +++ b/test/loops/nested_loops_with_continuing.wgsl.expected.glsl @@ -0,0 +1,33 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +int f() { + int i = 0; + int j = 0; + while (true) { + if ((i > 4)) { + return 1; + } + while (true) { + if ((j > 4)) { + return 2; + } + { + j = (j + 1); + } + } + { + i = (i + 1); + } + } +} diff --git a/test/shadowing/alias/let.wgsl.expected.glsl b/test/shadowing/alias/let.wgsl.expected.glsl index e69de29bb2..15c71a7a20 100644 --- a/test/shadowing/alias/let.wgsl.expected.glsl +++ b/test/shadowing/alias/let.wgsl.expected.glsl @@ -0,0 +1,21 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + { + int a_1 = 0; + int b = a_1; + } + int a_2 = 0; + int b = a_2; +} diff --git a/test/shadowing/alias/param.wgsl.expected.glsl b/test/shadowing/alias/param.wgsl.expected.glsl index e69de29bb2..cd776caf18 100644 --- a/test/shadowing/alias/param.wgsl.expected.glsl +++ b/test/shadowing/alias/param.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f(int a_1) { + int b = a_1; +} diff --git a/test/shadowing/alias/var.wgsl.expected.glsl b/test/shadowing/alias/var.wgsl.expected.glsl index e69de29bb2..15c71a7a20 100644 --- a/test/shadowing/alias/var.wgsl.expected.glsl +++ b/test/shadowing/alias/var.wgsl.expected.glsl @@ -0,0 +1,21 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + { + int a_1 = 0; + int b = a_1; + } + int a_2 = 0; + int b = a_2; +} diff --git a/test/shadowing/function/let.wgsl.expected.glsl b/test/shadowing/function/let.wgsl.expected.glsl index e69de29bb2..89ec7f6c73 100644 --- a/test/shadowing/function/let.wgsl.expected.glsl +++ b/test/shadowing/function/let.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void a() { + { + int a_1 = 1; + int b = a_1; + } + int b = 1; +} diff --git a/test/shadowing/function/param.wgsl.expected.glsl b/test/shadowing/function/param.wgsl.expected.glsl index e69de29bb2..cdaca56a26 100644 --- a/test/shadowing/function/param.wgsl.expected.glsl +++ b/test/shadowing/function/param.wgsl.expected.glsl @@ -0,0 +1,16 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void a(int a_1) { + int b = a_1; +} diff --git a/test/shadowing/function/var.wgsl.expected.glsl b/test/shadowing/function/var.wgsl.expected.glsl index e69de29bb2..4ed4b3dbdd 100644 --- a/test/shadowing/function/var.wgsl.expected.glsl +++ b/test/shadowing/function/var.wgsl.expected.glsl @@ -0,0 +1,25 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct a { + int a; +}; + +void f() { + { + a a_1 = a(0); + a b = a_1; + } + a a_2 = a(0); + a b = a_2; +} diff --git a/test/shadowing/param/function.wgsl.expected.glsl b/test/shadowing/param/function.wgsl.expected.glsl index e69de29bb2..483ebcc76c 100644 --- a/test/shadowing/param/function.wgsl.expected.glsl +++ b/test/shadowing/param/function.wgsl.expected.glsl @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void a(int a_1) { + { + int a_2 = a_1; + int b = a_2; + } +} diff --git a/test/shadowing/param/let.wgsl.expected.glsl b/test/shadowing/param/let.wgsl.expected.glsl index e69de29bb2..b267040965 100644 --- a/test/shadowing/param/let.wgsl.expected.glsl +++ b/test/shadowing/param/let.wgsl.expected.glsl @@ -0,0 +1,18 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f(int a) { + { + int b = a; + } +} diff --git a/test/shadowing/param/var.wgsl.expected.glsl b/test/shadowing/param/var.wgsl.expected.glsl index e69de29bb2..1cabf9bdb1 100644 --- a/test/shadowing/param/var.wgsl.expected.glsl +++ b/test/shadowing/param/var.wgsl.expected.glsl @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f(int a) { + { + int a_1 = a; + int b = a_1; + } +} diff --git a/test/shadowing/struct/let.wgsl.expected.glsl b/test/shadowing/struct/let.wgsl.expected.glsl index e69de29bb2..4ed4b3dbdd 100644 --- a/test/shadowing/struct/let.wgsl.expected.glsl +++ b/test/shadowing/struct/let.wgsl.expected.glsl @@ -0,0 +1,25 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct a { + int a; +}; + +void f() { + { + a a_1 = a(0); + a b = a_1; + } + a a_2 = a(0); + a b = a_2; +} diff --git a/test/shadowing/struct/param.wgsl.expected.glsl b/test/shadowing/struct/param.wgsl.expected.glsl index e69de29bb2..0a9a3e77f5 100644 --- a/test/shadowing/struct/param.wgsl.expected.glsl +++ b/test/shadowing/struct/param.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct a { + int a; +}; + +void f(a a_1) { + a b = a_1; +} diff --git a/test/shadowing/struct/var.wgsl.expected.glsl b/test/shadowing/struct/var.wgsl.expected.glsl index e69de29bb2..4ed4b3dbdd 100644 --- a/test/shadowing/struct/var.wgsl.expected.glsl +++ b/test/shadowing/struct/var.wgsl.expected.glsl @@ -0,0 +1,25 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct a { + int a; +}; + +void f() { + { + a a_1 = a(0); + a b = a_1; + } + a a_2 = a(0); + a b = a_2; +} diff --git a/test/statements/for/basic.wgsl.expected.glsl b/test/statements/for/basic.wgsl.expected.glsl index e69de29bb2..7459c6b1a4 100644 --- a/test/statements/for/basic.wgsl.expected.glsl +++ b/test/statements/for/basic.wgsl.expected.glsl @@ -0,0 +1,23 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void some_loop_body() { +} + +void f() { + { + for(int i = 0; (i < 5); i = (i + 1)) { + some_loop_body(); + } + } +} diff --git a/test/statements/for/complex.wgsl.expected.glsl b/test/statements/for/complex.wgsl.expected.glsl index e69de29bb2..96191a7d24 100644 --- a/test/statements/for/complex.wgsl.expected.glsl +++ b/test/statements/for/complex.wgsl.expected.glsl @@ -0,0 +1,32 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void some_loop_body() { +} + +void f() { + int j = 0; + { + int i = 0; + while (true) { + bool tint_tmp = (i < 5); + if (tint_tmp) { + tint_tmp = (j < 10); + } + if (!((tint_tmp))) { break; } + some_loop_body(); + j = (i * 30); + i = (i + 1); + } + } +} diff --git a/test/statements/for/condition/array_ctor.wgsl.expected.glsl b/test/statements/for/condition/array_ctor.wgsl.expected.glsl index e69de29bb2..07cdfb759f 100644 --- a/test/statements/for/condition/array_ctor.wgsl.expected.glsl +++ b/test/statements/for/condition/array_ctor.wgsl.expected.glsl @@ -0,0 +1,22 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int i = 0; + while (true) { + int tint_symbol[1] = int[1](1); + if (!((i < tint_symbol[0]))) { + break; + } + } +} diff --git a/test/statements/for/condition/basic.wgsl.expected.glsl b/test/statements/for/condition/basic.wgsl.expected.glsl index e69de29bb2..640d2bb5be 100644 --- a/test/statements/for/condition/basic.wgsl.expected.glsl +++ b/test/statements/for/condition/basic.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int i = 0; + { + for(; (i < 4); ) { + } + } +} diff --git a/test/statements/for/condition/struct_ctor.wgsl.expected.glsl b/test/statements/for/condition/struct_ctor.wgsl.expected.glsl index e69de29bb2..8ae3445c9f 100644 --- a/test/statements/for/condition/struct_ctor.wgsl.expected.glsl +++ b/test/statements/for/condition/struct_ctor.wgsl.expected.glsl @@ -0,0 +1,26 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + int i; +}; + +void f() { + int i = 0; + while (true) { + S tint_symbol = S(1); + if (!((i < tint_symbol.i))) { + break; + } + } +} diff --git a/test/statements/for/continuing/array_ctor.wgsl.expected.glsl b/test/statements/for/continuing/array_ctor.wgsl.expected.glsl index e69de29bb2..4269ffe512 100644 --- a/test/statements/for/continuing/array_ctor.wgsl.expected.glsl +++ b/test/statements/for/continuing/array_ctor.wgsl.expected.glsl @@ -0,0 +1,25 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int i = 0; + while (true) { + if (!(false)) { + break; + } + { + int tint_symbol[1] = int[1](1); + i = (i + tint_symbol[0]); + } + } +} diff --git a/test/statements/for/continuing/basic.wgsl.expected.glsl b/test/statements/for/continuing/basic.wgsl.expected.glsl index e69de29bb2..61e828e02e 100644 --- a/test/statements/for/continuing/basic.wgsl.expected.glsl +++ b/test/statements/for/continuing/basic.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int i = 0; + { + for(; false; i = (i + 1)) { + } + } +} diff --git a/test/statements/for/continuing/struct_ctor.wgsl.expected.glsl b/test/statements/for/continuing/struct_ctor.wgsl.expected.glsl index e69de29bb2..768964e81d 100644 --- a/test/statements/for/continuing/struct_ctor.wgsl.expected.glsl +++ b/test/statements/for/continuing/struct_ctor.wgsl.expected.glsl @@ -0,0 +1,31 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + int i; +}; + +void f() { + { + int i = 0; + while (true) { + if (!(false)) { + break; + } + { + S tint_symbol = S(1); + i = (i + tint_symbol.i); + } + } + } +} diff --git a/test/statements/for/empty.wgsl.expected.glsl b/test/statements/for/empty.wgsl.expected.glsl index e69de29bb2..943d71e3f1 100644 --- a/test/statements/for/empty.wgsl.expected.glsl +++ b/test/statements/for/empty.wgsl.expected.glsl @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + { + for(; false; ) { + } + } +} diff --git a/test/statements/for/initializer/array_ctor.wgsl.expected.glsl b/test/statements/for/initializer/array_ctor.wgsl.expected.glsl index e69de29bb2..4ce3c59212 100644 --- a/test/statements/for/initializer/array_ctor.wgsl.expected.glsl +++ b/test/statements/for/initializer/array_ctor.wgsl.expected.glsl @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + int tint_symbol[1] = int[1](1); + { + for(int i = tint_symbol[0]; false; ) { + } + } +} diff --git a/test/statements/for/initializer/basic.wgsl.expected.glsl b/test/statements/for/initializer/basic.wgsl.expected.glsl index e69de29bb2..ff1d58f83d 100644 --- a/test/statements/for/initializer/basic.wgsl.expected.glsl +++ b/test/statements/for/initializer/basic.wgsl.expected.glsl @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + { + for(int i = 0; false; ) { + } + } +} diff --git a/test/statements/for/initializer/struct_ctor.wgsl.expected.glsl b/test/statements/for/initializer/struct_ctor.wgsl.expected.glsl index e69de29bb2..39e137a813 100644 --- a/test/statements/for/initializer/struct_ctor.wgsl.expected.glsl +++ b/test/statements/for/initializer/struct_ctor.wgsl.expected.glsl @@ -0,0 +1,24 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +struct S { + int i; +}; + +void f() { + S tint_symbol = S(1); + { + for(int i = tint_symbol.i; false; ) { + } + } +} diff --git a/test/statements/for/scoping.wgsl.expected.glsl b/test/statements/for/scoping.wgsl.expected.glsl index e69de29bb2..1c8d750463 100644 --- a/test/statements/for/scoping.wgsl.expected.glsl +++ b/test/statements/for/scoping.wgsl.expected.glsl @@ -0,0 +1,21 @@ +#version 310 es +precision mediump float; + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +void main() { + unused_entry_point(); +} + + + +void f() { + { + for(int must_not_collide = 0; ; ) { + break; + } + } + int must_not_collide = 0; +}