From d733fdb85cbfc76b2b56912fbf4ef417f579f174 Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Mon, 13 Dec 2021 15:55:11 +0000 Subject: [PATCH] HLSL: work around FXC failures when dynamically indexing arrays in structs FXC fails to compile code that assigns to dynamically-indexed fixed-size arrays in structs on internal shader variables with: error X3500: array reference cannot be used as an l-value; not natively addressable This CL detects this case, and transforms such assignments into copying out the array to a local variable, assigning to that local, and then copying the array back. Also manually regenerate SKIPs for HLSL/FXC after this change, which fixes 30 tests. Also exposes some "compilation aborted unexpectedly" now that "array reference cannot be used as an l-value" has been fixed. For tests that fail for both DXC and FXC, updating SKIPs to the DXC one to help distinguish actual FXC bugs from valid errors. Bug: tint:998 Bug: tint:1206 Change-Id: I09204d8d81ab27d1c257538ad702414ccc386543 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/71620 Reviewed-by: Ben Clayton Kokoro: Kokoro Commit-Queue: Antonio Maiorano --- src/BUILD.gn | 2 + src/CMakeLists.txt | 3 + src/program_builder.h | 9 + .../localize_struct_array_assignment.cc | 230 +++ .../localize_struct_array_assignment.h | 53 + .../localize_struct_array_assignment_test.cc | 620 +++++++ src/writer/hlsl/generator_impl.cc | 10 + test/BUILD.gn | 1 + .../write/function.wgsl.expected.hlsl | 21 - .../function_via_param.wgsl.expected.hlsl | 25 - .../write/private.wgsl.expected.hlsl | 21 - .../private_via_param.wgsl.expected.hlsl | 25 - .../1206.wgsl | 23 + .../1206.wgsl.expected.hlsl | 38 + test/bug/tint/749.spvasm.expected.hlsl | 1566 ----------------- test/bug/tint/998.wgsl.expected.hlsl | 21 - .../in_for_loop_body.wgsl | 22 + .../in_for_loop_body.wgsl.expected.hlsl | 26 + .../in_for_loop_continuing.wgsl | 22 + .../in_for_loop_continuing.wgsl.expected.hlsl | 29 + .../in_for_loop_init.wgsl | 22 + .../in_for_loop_init.wgsl.expected.hlsl | 27 + .../indexing_with_side_effect_func.wgsl | 31 + ...g_with_side_effect_func.wgsl.expected.hlsl | 35 + .../struct_array.wgsl | 21 + .../struct_array.wgsl.expected.hlsl | 22 + .../struct_array_array.wgsl | 21 + .../struct_array_array.wgsl.expected.hlsl | 22 + .../struct_array_struct.wgsl | 24 + .../struct_array_struct.wgsl.expected.hlsl | 25 + .../struct_array_struct_array.wgsl | 25 + ...ruct_array_struct_array.wgsl.expected.hlsl | 28 + .../struct_dynamic_array.wgsl | 20 + .../struct_dynamic_array.wgsl.expected.hlsl | 19 + .../struct_dynamic_array_struct_array.wgsl | 25 + ...amic_array_struct_array.wgsl.expected.hlsl | 19 + .../struct_matrix.wgsl | 16 + .../struct_matrix.wgsl.expected.hlsl | 33 + .../struct_multiple_arrays.wgsl | 22 + .../struct_multiple_arrays.wgsl.expected.hlsl | 28 + .../struct_struct_array.wgsl | 24 + .../struct_struct_array.wgsl.expected.hlsl | 25 + .../struct_vector.wgsl | 15 + .../struct_vector.wgsl.expected.hlsl | 18 + .../vector_assign.wgsl | 21 + .../vector_assign.wgsl.expected.hlsl | 24 + .../via_pointer.wgsl | 21 + .../via_pointer.wgsl.expected.hlsl | 23 + .../via_pointer_arg.wgsl | 21 + .../via_pointer_arg.wgsl.expected.hlsl | 26 + .../0-opt.spvasm.expected.hlsl | 165 -- .../0-opt.wgsl.expected.hlsl | 165 -- .../0-opt.spvasm.expected.hlsl | 6 +- .../0-opt.wgsl.expected.hlsl | 8 +- .../0-opt.spvasm.expected.hlsl | 49 - .../0-opt.wgsl.expected.hlsl | 49 - .../0-opt.spvasm.expected.hlsl | 19 +- .../0-opt.wgsl.expected.hlsl | 19 +- .../0-opt.spvasm.expected.hlsl | 94 - .../0-opt.wgsl.expected.hlsl | 94 - .../0-opt.spvasm.expected.hlsl | 6 +- .../0-opt.wgsl.expected.hlsl | 6 +- .../0-opt.spvasm.expected.hlsl | 6 +- .../0-opt.wgsl.expected.hlsl | 6 +- .../0.spvasm.expected.hlsl | 93 - .../0.wgsl.expected.hlsl | 93 - .../0-opt.spvasm.expected.hlsl | 2 + .../0-opt.wgsl.expected.hlsl | 2 + .../0-opt.spvasm.expected.hlsl | 224 --- .../0-opt.wgsl.expected.hlsl | 224 --- .../1.spvasm.expected.hlsl | 224 --- .../1.wgsl.expected.hlsl | 224 --- .../1.spvasm.expected.hlsl | 75 +- .../1.wgsl.expected.hlsl | 111 +- .../1.spvasm.expected.hlsl | 20 +- .../1.wgsl.expected.hlsl | 26 +- .../1.spvasm.expected.hlsl | 242 --- .../1.wgsl.expected.hlsl | 242 --- .../0-opt.spvasm.expected.hlsl | 230 --- .../0-opt.wgsl.expected.hlsl | 230 --- .../2-opt.spvasm.expected.hlsl | 238 --- .../2-opt.wgsl.expected.hlsl | 238 --- .../0.spvasm.expected.hlsl | 317 ---- .../0.wgsl.expected.hlsl | 317 ---- .../2.spvasm.expected.hlsl | 295 ---- .../2.wgsl.expected.hlsl | 295 ---- .../2-opt.spvasm.expected.hlsl | 236 --- .../2-opt.wgsl.expected.hlsl | 236 --- .../0.spvasm.expected.hlsl | 6 +- .../0.wgsl.expected.hlsl | 6 +- .../0-opt.spvasm.expected.hlsl | 8 +- .../0-opt.wgsl.expected.hlsl | 8 +- .../0.spvasm.expected.hlsl | 2 + .../0.wgsl.expected.hlsl | 2 + .../0-opt.spvasm.expected.hlsl | 25 +- .../0-opt.wgsl.expected.hlsl | 33 +- .../0-opt.spvasm.expected.hlsl | 35 +- .../0-opt.wgsl.expected.hlsl | 47 +- 98 files changed, 2149 insertions(+), 6619 deletions(-) create mode 100644 src/transform/localize_struct_array_assignment.cc create mode 100644 src/transform/localize_struct_array_assignment.h create mode 100644 src/transform/localize_struct_array_assignment_test.cc delete mode 100644 test/bug/fxc/dyn_array_idx/write/function.wgsl.expected.hlsl delete mode 100644 test/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.hlsl delete mode 100644 test/bug/fxc/dyn_array_idx/write/private.wgsl.expected.hlsl delete mode 100644 test/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.hlsl create mode 100644 test/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl create mode 100644 test/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.hlsl delete mode 100644 test/bug/tint/749.spvasm.expected.hlsl delete mode 100644 test/bug/tint/998.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.hlsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl create mode 100644 test/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/arr-value-set-to-arr-value-squared/0-opt.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/arr-value-set-to-arr-value-squared/0-opt.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/cov-copy-prop-arrays-no-stores/0-opt.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/cov-copy-prop-arrays-no-stores/0-opt.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/cov-struct-float-array-mix-uniform-vectors/0-opt.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/cov-struct-float-array-mix-uniform-vectors/0-opt.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/loops-ifs-continues-call/0.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/loops-ifs-continues-call/0.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-dontinline/0-opt.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-dontinline/0-opt.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-mat-func-param/1.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-mat-func-param/1.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-conditional-bitwise-or-clamp/1.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-conditional-bitwise-or-clamp/1.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/0-opt.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/0-opt.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/2-opt.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/2-opt.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/0.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/0.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/2.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/2.wgsl.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-max-value-as-index/2-opt.spvasm.expected.hlsl delete mode 100644 test/vk-gl-cts/graphicsfuzz/stable-quicksort-max-value-as-index/2-opt.wgsl.expected.hlsl diff --git a/src/BUILD.gn b/src/BUILD.gn index f88173beea..1003f275c8 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -451,6 +451,8 @@ libtint_source_set("libtint_core_all_src") { "transform/fold_trivial_single_use_lets.h", "transform/for_loop_to_loop.cc", "transform/for_loop_to_loop.h", + "transform/localize_struct_array_assignment.cc", + "transform/localize_struct_array_assignment.h", "transform/loop_to_for_loop.cc", "transform/loop_to_for_loop.h", "transform/manager.cc", diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3994fed9d8..10aeea6aae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -312,6 +312,8 @@ set(TINT_LIB_SRCS transform/fold_constants.h transform/fold_trivial_single_use_lets.cc transform/fold_trivial_single_use_lets.h + transform/localize_struct_array_assignment.cc + transform/localize_struct_array_assignment.h transform/for_loop_to_loop.cc transform/for_loop_to_loop.h transform/glsl.cc @@ -971,6 +973,7 @@ if(${TINT_BUILD_TESTS}) transform/fold_constants_test.cc transform/fold_trivial_single_use_lets_test.cc transform/for_loop_to_loop_test.cc + transform/localize_struct_array_assignment_test.cc transform/loop_to_for_loop_test.cc transform/module_scope_var_to_entry_point_param_test.cc transform/multiplanar_external_texture_test.cc diff --git a/src/program_builder.h b/src/program_builder.h index e440474f09..53929af772 100644 --- a/src/program_builder.h +++ b/src/program_builder.h @@ -2468,6 +2468,15 @@ class ProgramBuilder { } } + /// Unmarks that the given transform `T` has been applied to this program. + template + void UnsetTransformApplied() { + auto it = transforms_applied_.find(&TypeInfo::Of()); + if (it != transforms_applied_.end()) { + transforms_applied_.erase(it); + } + } + /// @returns true if the transform of type `T` was applied. template bool HasTransformApplied() { diff --git a/src/transform/localize_struct_array_assignment.cc b/src/transform/localize_struct_array_assignment.cc new file mode 100644 index 0000000000..6d73ec9ee2 --- /dev/null +++ b/src/transform/localize_struct_array_assignment.cc @@ -0,0 +1,230 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "src/transform/localize_struct_array_assignment.h" + +#include +#include + +#include "src/ast/assignment_statement.h" +#include "src/ast/traverse_expressions.h" +#include "src/program_builder.h" +#include "src/sem/expression.h" +#include "src/sem/member_accessor_expression.h" +#include "src/sem/reference_type.h" +#include "src/sem/statement.h" +#include "src/sem/variable.h" +#include "src/transform/simplify_pointers.h" +#include "src/utils/scoped_assignment.h" + +TINT_INSTANTIATE_TYPEINFO(tint::transform::LocalizeStructArrayAssignment); + +namespace tint { +namespace transform { + +/// Private implementation of LocalizeStructArrayAssignment transform +class LocalizeStructArrayAssignment::State { + private: + CloneContext& ctx; + ProgramBuilder& b; + + /// Returns true if `expr` contains an index accessor expression to a + /// structure member of array type. + bool ContainsStructArrayIndex(const ast::Expression* expr) { + bool result = false; + ast::TraverseExpressions( + expr, b.Diagnostics(), [&](const ast::IndexAccessorExpression* ia) { + // Indexing using a runtime value? + auto* idx_sem = ctx.src->Sem().Get(ia->index); + if (!idx_sem->ConstantValue().IsValid()) { + // Indexing a member access expr? + if (auto* ma = ia->object->As()) { + // That accesses an array? + if (ctx.src->TypeOf(ma)->UnwrapRef()->Is()) { + result = true; + return ast::TraverseAction::Stop; + } + } + } + return ast::TraverseAction::Descend; + }); + + return result; + } + + // Returns the type and storage class of the originating variable of the lhs + // of the assignment statement. + // See https://www.w3.org/TR/WGSL/#originating-variable-section + std::pair + GetOriginatingTypeAndStorageClass( + const ast::AssignmentStatement* assign_stmt) { + // Get first IdentifierExpr from lhs of assignment, which should resolve to + // the pointer or reference of the originating variable of the assignment. + // TraverseExpressions traverses left to right, and this code depends on the + // fact that for an assignment statement, the variable will be the left-most + // expression. + // TODO(crbug.com/tint/1341): do this in the Resolver, setting the + // originating variable on sem::Expression. + const ast::IdentifierExpression* ident = nullptr; + ast::TraverseExpressions(assign_stmt->lhs, b.Diagnostics(), + [&](const ast::IdentifierExpression* id) { + ident = id; + return ast::TraverseAction::Stop; + }); + auto* sem_var_user = ctx.src->Sem().Get(ident); + if (!sem_var_user) { + TINT_ICE(Transform, b.Diagnostics()) + << "Expected to find variable of lhs of assignment statement"; + return {}; + } + + auto* var = sem_var_user->Variable(); + if (auto* ptr = var->Type()->As()) { + return {ptr->StoreType(), ptr->StorageClass()}; + } + + auto* ref = var->Type()->As(); + if (!ref) { + TINT_ICE(Transform, b.Diagnostics()) + << "Expecting to find variable of type pointer or reference on lhs " + "of assignment statement"; + return {}; + } + + return {ref->StoreType(), ref->StorageClass()}; + } + + public: + /// Constructor + /// @param ctx_in the CloneContext primed with the input program and + /// ProgramBuilder + explicit State(CloneContext& ctx_in) : ctx(ctx_in), b(*ctx_in.dst) {} + + /// Runs the transform + void Run() { + struct Shared { + bool process_nested_nodes = false; + ast::StatementList insert_before_stmts; + ast::StatementList insert_after_stmts; + } s; + + ctx.ReplaceAll([&](const ast::AssignmentStatement* assign_stmt) + -> const ast::Statement* { + // Process if it's an assignment statement to a dynamically indexed array + // within a struct on a function or private storage variable. This + // specific use-case is what FXC fails to compile with: + // error X3500: array reference cannot be used as an l-value; not natively + // addressable + if (!ContainsStructArrayIndex(assign_stmt->lhs)) { + return nullptr; + } + auto og = GetOriginatingTypeAndStorageClass(assign_stmt); + if (!(og.first->Is() && + (og.second == ast::StorageClass::kFunction || + og.second == ast::StorageClass::kPrivate))) { + return nullptr; + } + + // Reset shared state for this assignment statement + s = Shared{}; + + const ast::Expression* new_lhs = nullptr; + { + TINT_SCOPED_ASSIGNMENT(s.process_nested_nodes, true); + new_lhs = ctx.Clone(assign_stmt->lhs); + } + + auto* new_assign_stmt = b.Assign(new_lhs, ctx.Clone(assign_stmt->rhs)); + + // Combine insert_before_stmts + new_assign_stmt + insert_after_stmts into + // a block and return it + ast::StatementList stmts = std::move(s.insert_before_stmts); + stmts.reserve(1 + s.insert_after_stmts.size()); + stmts.emplace_back(new_assign_stmt); + stmts.insert(stmts.end(), s.insert_after_stmts.begin(), + s.insert_after_stmts.end()); + + return b.Block(std::move(stmts)); + }); + + ctx.ReplaceAll([&](const ast::IndexAccessorExpression* index_access) + -> const ast::Expression* { + if (!s.process_nested_nodes) { + return nullptr; + } + + // Indexing a member access expr? + auto* mem_access = + index_access->object->As(); + if (!mem_access) { + return nullptr; + } + + // Process any nested IndexAccessorExpressions + mem_access = ctx.Clone(mem_access); + + // Store the address of the member access into a let as we need to read + // the value twice e.g. let tint_symbol = &(s.a1); + auto mem_access_ptr = b.Sym(); + s.insert_before_stmts.push_back( + b.Decl(b.Const(mem_access_ptr, nullptr, b.AddressOf(mem_access)))); + + // Disable further transforms when cloning + TINT_SCOPED_ASSIGNMENT(s.process_nested_nodes, false); + + // Copy entire array out of struct into local temp var + // e.g. var tint_symbol_1 = *(tint_symbol); + auto tmp_var = b.Sym(); + s.insert_before_stmts.push_back( + b.Decl(b.Var(tmp_var, nullptr, b.Deref(mem_access_ptr)))); + + // Replace input index_access with a clone of itself, but with its + // .object replaced by the new temp var. This is returned from this + // function to modify the original assignment statement. e.g. + // tint_symbol_1[uniforms.i] + auto* new_index_access = + b.IndexAccessor(tmp_var, ctx.Clone(index_access->index)); + + // Assign temp var back to array + // e.g. *(tint_symbol) = tint_symbol_1; + auto* assign_rhs_to_temp = b.Assign(b.Deref(mem_access_ptr), tmp_var); + s.insert_after_stmts.insert(s.insert_after_stmts.begin(), + assign_rhs_to_temp); // push_front + + return new_index_access; + }); + + ctx.Clone(); + } +}; + +LocalizeStructArrayAssignment::LocalizeStructArrayAssignment() = default; + +LocalizeStructArrayAssignment::~LocalizeStructArrayAssignment() = default; + +void LocalizeStructArrayAssignment::Run(CloneContext& ctx, + const DataMap&, + DataMap&) { + if (!Requires(ctx)) { + return; + } + + State state(ctx); + state.Run(); + + // This transform may introduce pointers + ctx.dst->UnsetTransformApplied(); +} +} // namespace transform +} // namespace tint diff --git a/src/transform/localize_struct_array_assignment.h b/src/transform/localize_struct_array_assignment.h new file mode 100644 index 0000000000..ce56e147c5 --- /dev/null +++ b/src/transform/localize_struct_array_assignment.h @@ -0,0 +1,53 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SRC_TRANSFORM_LOCALIZE_STRUCT_ARRAY_ASSIGNMENT_H_ +#define SRC_TRANSFORM_LOCALIZE_STRUCT_ARRAY_ASSIGNMENT_H_ + +#include "src/transform/transform.h" + +namespace tint { +namespace transform { + +/// This transforms replaces assignment to dynamically-indexed fixed-size arrays +/// in structs on shader-local variables with code that copies the arrays to a +/// temporary local variable, assigns to the local variable, and copies the +/// array back. This is to work around FXC's compilation failure for these cases +/// (see crbug.com/tint/1206). +class LocalizeStructArrayAssignment + : public Castable { + public: + /// Constructor + LocalizeStructArrayAssignment(); + + /// Destructor + ~LocalizeStructArrayAssignment() override; + + protected: + /// Runs the transform using the CloneContext built for transforming a + /// program. Run() is responsible for calling Clone() on the CloneContext. + /// @param ctx the CloneContext primed with the input program and + /// ProgramBuilder + /// @param inputs optional extra transform-specific input data + /// @param outputs optional extra transform-specific output data + void Run(CloneContext& ctx, const DataMap& inputs, DataMap& outputs) override; + + private: + class State; +}; + +} // namespace transform +} // namespace tint + +#endif // SRC_TRANSFORM_LOCALIZE_STRUCT_ARRAY_ASSIGNMENT_H_ diff --git a/src/transform/localize_struct_array_assignment_test.cc b/src/transform/localize_struct_array_assignment_test.cc new file mode 100644 index 0000000000..197aa02dcd --- /dev/null +++ b/src/transform/localize_struct_array_assignment_test.cc @@ -0,0 +1,620 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "src/transform/localize_struct_array_assignment.h" +#include "src/transform/simplify_pointers.h" +#include "src/transform/unshadow.h" + +#include "src/transform/test_helper.h" + +namespace tint { +namespace transform { +namespace { + +using LocalizeStructArrayAssignmentTest = TransformTest; + +TEST_F(LocalizeStructArrayAssignmentTest, MissingSimplifyPointers) { + auto* src = R"()"; + auto* expect = + "error: tint::transform::LocalizeStructArrayAssignment depends on " + "tint::transform::SimplifyPointers but the dependency was not run"; + + auto got = Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, EmptyModule) { + auto* src = R"()"; + auto* expect = src; + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, StructArray) { + auto* src = R"( +[[block]] struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + s1.a1[uniforms.i] = v; +} +)"; + + auto* expect = R"( +[[block]] +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + { + let tint_symbol = &(s1.a1); + var tint_symbol_1 = *(tint_symbol); + tint_symbol_1[uniforms.i] = v; + *(tint_symbol) = tint_symbol_1; + } +} +)"; + + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, StructStructArray) { + auto* src = R"( +[[block]] struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a : array; +}; + +struct OuterS { + s2 : S1; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + s1.s2.a[uniforms.i] = v; +} +)"; + + auto* expect = R"( +[[block]] +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a : array; +}; + +struct OuterS { + s2 : S1; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + { + let tint_symbol = &(s1.s2.a); + var tint_symbol_1 = *(tint_symbol); + tint_symbol_1[uniforms.i] = v; + *(tint_symbol) = tint_symbol_1; + } +} +)"; + + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, StructArrayArray) { + auto* src = R"( +[[block]] struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array, 8>; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + s1.a1[uniforms.i][uniforms.j] = v; +} +)"; + + auto* expect = R"( +[[block]] +struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array, 8>; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + { + let tint_symbol = &(s1.a1); + var tint_symbol_1 = *(tint_symbol); + tint_symbol_1[uniforms.i][uniforms.j] = v; + *(tint_symbol) = tint_symbol_1; + } +} +)"; + + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, StructArrayStruct) { + auto* src = R"( +[[block]] struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + s2 : InnerS; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + s1.a1[uniforms.i].s2 = v; +} +)"; + + auto* expect = R"( +[[block]] +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + s2 : InnerS; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + { + let tint_symbol = &(s1.a1); + var tint_symbol_1 = *(tint_symbol); + tint_symbol_1[uniforms.i].s2 = v; + *(tint_symbol) = tint_symbol_1; + } +} +)"; + + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, StructArrayStructArray) { + auto* src = R"( +[[block]] struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a2 : array; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s : OuterS; + s.a1[uniforms.i].a2[uniforms.j] = v; +} +)"; + + auto* expect = R"( +[[block]] +struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a2 : array; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s : OuterS; + { + let tint_symbol = &(s.a1); + var tint_symbol_1 = *(tint_symbol); + let tint_symbol_2 = &(tint_symbol_1[uniforms.i].a2); + var tint_symbol_3 = *(tint_symbol_2); + tint_symbol_3[uniforms.j] = v; + *(tint_symbol_2) = tint_symbol_3; + *(tint_symbol) = tint_symbol_1; + } +} +)"; + + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, IndexingWithSideEffectFunc) { + auto* src = R"( +[[block]] struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a2 : array; +}; + +struct OuterS { + a1 : array; +}; + +var nextIndex : u32; +fn getNextIndex() -> u32 { + nextIndex = nextIndex + 1u; + return nextIndex; +} + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s : OuterS; + s.a1[getNextIndex()].a2[uniforms.j] = v; +} +)"; + + auto* expect = R"( +[[block]] +struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a2 : array; +}; + +struct OuterS { + a1 : array; +}; + +var nextIndex : u32; + +fn getNextIndex() -> u32 { + nextIndex = (nextIndex + 1u); + return nextIndex; +} + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s : OuterS; + { + let tint_symbol = &(s.a1); + var tint_symbol_1 = *(tint_symbol); + let tint_symbol_2 = &(tint_symbol_1[getNextIndex()].a2); + var tint_symbol_3 = *(tint_symbol_2); + tint_symbol_3[uniforms.j] = v; + *(tint_symbol_2) = tint_symbol_3; + *(tint_symbol) = tint_symbol_1; + } +} +)"; + + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, ViaPointerArg) { + auto* src = R"( +[[block]] struct Uniforms { + i : u32; +}; +struct InnerS { + v : i32; +}; +struct OuterS { + a1 : array; +}; +[[group(1), binding(4)]] var uniforms : Uniforms; + +fn f(p : ptr) { + var v : InnerS; + (*p).a1[uniforms.i] = v; +} + +[[stage(compute), workgroup_size(1)]] +fn main() { + var s1 : OuterS; + f(&s1); +} +)"; + + auto* expect = R"( +[[block]] +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +fn f(p : ptr) { + var v : InnerS; + { + let tint_symbol = &((*(p)).a1); + var tint_symbol_1 = *(tint_symbol); + tint_symbol_1[uniforms.i] = v; + *(tint_symbol) = tint_symbol_1; + } +} + +[[stage(compute), workgroup_size(1)]] +fn main() { + var s1 : OuterS; + f(&(s1)); +} +)"; + + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, ViaPointerVar) { + auto* src = R"( +[[block]] +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +fn f(p : ptr, v : InnerS) { + *(p) = v; +} + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + let p = &(s1.a1[uniforms.i]); + *(p) = v; +} +)"; + + auto* expect = R"( +[[block]] +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +fn f(p : ptr, v : InnerS) { + *(p) = v; +} + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + let p_save = uniforms.i; + { + let tint_symbol = &(s1.a1); + var tint_symbol_1 = *(tint_symbol); + tint_symbol_1[p_save] = v; + *(tint_symbol) = tint_symbol_1; + } +} +)"; + + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +TEST_F(LocalizeStructArrayAssignmentTest, VectorAssignment) { + auto* src = R"( +[[block]] +struct Uniforms { + i : u32; +}; + +[[block]] +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +fn f(i : u32) -> u32 { + return (i + 1u); +} + +[[stage(compute), workgroup_size(1)]] +fn main() { + var s1 : OuterS; + var v : vec3; + v[s1.a1[uniforms.i]] = 1.0; + v[f(s1.a1[uniforms.i])] = 1.0; +} +)"; + + // Transform does nothing here as we're not actually assigning to the array in + // the struct. + auto* expect = src; + + auto got = + Run(src); + EXPECT_EQ(expect, str(got)); +} + +} // namespace +} // namespace transform +} // namespace tint diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index c66278f46f..82c36cb8a0 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -51,6 +51,7 @@ #include "src/transform/decompose_memory_access.h" #include "src/transform/external_texture_transform.h" #include "src/transform/fold_trivial_single_use_lets.h" +#include "src/transform/localize_struct_array_assignment.h" #include "src/transform/loop_to_for_loop.h" #include "src/transform/manager.h" #include "src/transform/num_workgroups_from_uniform.h" @@ -145,6 +146,15 @@ SanitizedResult Sanitize( manager.Add(); + // LocalizeStructArrayAssignment must come after: + // * SimplifyPointers, because it assumes assignment to arrays in structs are + // done directly, not indirectly. + // TODO(crbug.com/tint/1340): See if we can get rid of the duplicate + // SimplifyPointers transform. Can't do it right now because + // LocalizeStructArrayAssignment introduces pointers. + manager.Add(); + manager.Add(); + // Attempt to convert `loop`s into for-loops. This is to try and massage the // output into something that will not cause FXC to choke or misbehave. manager.Add(); diff --git a/test/BUILD.gn b/test/BUILD.gn index cf1c258244..4403a242e3 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -314,6 +314,7 @@ tint_unittests_source_set("tint_unittests_transform_src") { "../src/transform/fold_constants_test.cc", "../src/transform/fold_trivial_single_use_lets_test.cc", "../src/transform/for_loop_to_loop_test.cc", + "../src/transform/localize_struct_array_assignment_test.cc", "../src/transform/loop_to_for_loop_test.cc", "../src/transform/module_scope_var_to_entry_point_param_test.cc", "../src/transform/multiplanar_external_texture_test.cc", diff --git a/test/bug/fxc/dyn_array_idx/write/function.wgsl.expected.hlsl b/test/bug/fxc/dyn_array_idx/write/function.wgsl.expected.hlsl deleted file mode 100644 index 04d50a17ac..0000000000 --- a/test/bug/fxc/dyn_array_idx/write/function.wgsl.expected.hlsl +++ /dev/null @@ -1,21 +0,0 @@ -SKIP: FAILED - -cbuffer cbuffer_ubo : register(b0, space0) { - uint4 ubo[1]; -}; - -struct S { - int data[64]; -}; - -RWByteAddressBuffer result : register(u1, space0); - -[numthreads(1, 1, 1)] -void f() { - S s = (S)0; - s.data[asint(ubo[0].x)] = 1; - result.Store(0u, asuint(s.data[3])); - return; -} -C:\src\tint\test\Shader@0x000002C587F87250(14,3-25): error X3500: array reference cannot be used as an l-value; not natively addressable - diff --git a/test/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.hlsl b/test/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.hlsl deleted file mode 100644 index 59669b372a..0000000000 --- a/test/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.hlsl +++ /dev/null @@ -1,25 +0,0 @@ -SKIP: FAILED - -cbuffer cbuffer_ubo : register(b0, space0) { - uint4 ubo[1]; -}; - -struct S { - int data[64]; -}; - -RWByteAddressBuffer result : register(u1, space0); - -void x(inout S p) { - p.data[asint(ubo[0].x)] = 1; -} - -[numthreads(1, 1, 1)] -void f() { - S s = (S)0; - x(s); - result.Store(0u, asuint(s.data[3])); - return; -} -C:\src\tint\test\Shader@0x000002338E919910(12,3-25): error X3500: array reference cannot be used as an l-value; not natively addressable - diff --git a/test/bug/fxc/dyn_array_idx/write/private.wgsl.expected.hlsl b/test/bug/fxc/dyn_array_idx/write/private.wgsl.expected.hlsl deleted file mode 100644 index 1ef5a388bc..0000000000 --- a/test/bug/fxc/dyn_array_idx/write/private.wgsl.expected.hlsl +++ /dev/null @@ -1,21 +0,0 @@ -SKIP: FAILED - -cbuffer cbuffer_ubo : register(b0, space0) { - uint4 ubo[1]; -}; - -struct S { - int data[64]; -}; - -RWByteAddressBuffer result : register(u1, space0); -static S s = (S)0; - -[numthreads(1, 1, 1)] -void f() { - s.data[asint(ubo[0].x)] = 1; - result.Store(0u, asuint(s.data[3])); - return; -} -C:\src\tint\test\Shader@0x000001D94063C630(14,3-25): error X3500: array reference cannot be used as an l-value; not natively addressable - diff --git a/test/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.hlsl b/test/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.hlsl deleted file mode 100644 index ed009a4d77..0000000000 --- a/test/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.hlsl +++ /dev/null @@ -1,25 +0,0 @@ -SKIP: FAILED - -cbuffer cbuffer_ubo : register(b0, space0) { - uint4 ubo[1]; -}; - -struct S { - int data[64]; -}; - -RWByteAddressBuffer result : register(u1, space0); -static S s = (S)0; - -void x(inout S p) { - p.data[asint(ubo[0].x)] = 1; -} - -[numthreads(1, 1, 1)] -void f() { - x(s); - result.Store(0u, asuint(s.data[3])); - return; -} -C:\src\tint\test\Shader@0x0000018B80081AA0(13,3-25): error X3500: array reference cannot be used as an l-value; not natively addressable - diff --git a/test/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl b/test/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl new file mode 100644 index 0000000000..df48e4ca1a --- /dev/null +++ b/test/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl @@ -0,0 +1,23 @@ +struct Simulation { + i : u32; +}; + +struct Particle { + position : array, 8>; + lifetime : f32; + color : vec4; + velocity : vec3; +}; + +struct Particles { + p : array; +}; + +[[group(1), binding(3)]] var particles : Particles; +[[group(1), binding(4)]] var sim : Simulation; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var particle = particles.p[0]; + particle.position[sim.i] = particle.position[sim.i]; +} diff --git a/test/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.hlsl b/test/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.hlsl new file mode 100644 index 0000000000..e1302946cf --- /dev/null +++ b/test/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.hlsl @@ -0,0 +1,38 @@ +struct Particle { + float3 position[8]; + float lifetime; + float4 color; + float3 velocity; +}; + +ByteAddressBuffer particles : register(t3, space1); +cbuffer cbuffer_sim : register(b4, space1) { + uint4 sim[1]; +}; + +typedef float3 tint_symbol_3_ret[8]; +tint_symbol_3_ret tint_symbol_3(ByteAddressBuffer buffer, uint offset) { + float3 arr[8] = (float3[8])0; + { + [loop] for(uint i_1 = 0u; (i_1 < 8u); i_1 = (i_1 + 1u)) { + arr[i_1] = asfloat(buffer.Load3((offset + (i_1 * 16u)))); + } + } + return arr; +} + +Particle tint_symbol_2(ByteAddressBuffer buffer, uint offset) { + const Particle tint_symbol_8 = {tint_symbol_3(buffer, (offset + 0u)), asfloat(buffer.Load((offset + 128u))), asfloat(buffer.Load4((offset + 144u))), asfloat(buffer.Load3((offset + 160u)))}; + return tint_symbol_8; +} + +[numthreads(1, 1, 1)] +void main() { + Particle particle = tint_symbol_2(particles, (176u * uint(0))); + { + float3 tint_symbol_1[8] = particle.position; + tint_symbol_1[sim[0].x] = particle.position[sim[0].x]; + particle.position = tint_symbol_1; + } + return; +} diff --git a/test/bug/tint/749.spvasm.expected.hlsl b/test/bug/tint/749.spvasm.expected.hlsl deleted file mode 100644 index 48ad9aef58..0000000000 --- a/test/bug/tint/749.spvasm.expected.hlsl +++ /dev/null @@ -1,1566 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_188 : register(b0, space0) { - uint4 x_188[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_932 = temp; - temp = 0; - temp = x_932; - const float3 x_523 = float3(float3(1.0f, 2.0f, 3.0f).z, float3(1.0f, 2.0f, 3.0f).y, float3(1.0f, 2.0f, 3.0f).z); - const int x_933 = i; - i = 0; - i = x_933; - const int x_28 = i; - const int x_934 = j; - j = 0; - j = x_934; - const float3 x_524 = float3(x_523.y, x_523.x, x_523.y); - const int x_935 = temp; - temp = 0; - temp = x_935; - const int x_30_save = x_28; - const int x_936 = obj.numbers[x_30_save]; - obj.numbers[x_30_save] = 0; - obj.numbers[x_30_save] = x_936; - const int x_31 = obj.numbers[x_30_save]; - const int x_937 = temp; - temp = 0; - temp = x_937; - temp = x_31; - const int x_938 = j; - j = 0; - j = x_938; - const float3 x_525 = float3(x_523.z, float3(1.0f, 2.0f, 3.0f).x, x_523.y); - const int x_939 = i; - i = 0; - i = x_939; - const int x_32 = i; - const int x_940 = obj.numbers[x_30_save]; - obj.numbers[x_30_save] = 0; - obj.numbers[x_30_save] = x_940; - const int x_33 = j; - const int x_941 = i; - i = 0; - i = x_941; - const float3 x_526 = float3(x_525.x, x_525.z, x_525.z); - const int x_942 = obj.numbers[x_30_save]; - obj.numbers[x_30_save] = 0; - obj.numbers[x_30_save] = x_942; - const int x_34_save = x_33; - const int x_35 = obj.numbers[x_34_save]; - const QuicksortObject x_943 = obj; - const int tint_symbol_4[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_5 = {tint_symbol_4}; - obj = tint_symbol_5; - obj = x_943; - const float2 x_527 = float2(x_526.x, x_526.x); - const int x_36_save = x_32; - const float3 x_528 = float3(x_524.x, x_524.z, x_524.x); - obj.numbers[x_36_save] = x_35; - const QuicksortObject x_944 = obj; - const int tint_symbol_6[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_7 = {tint_symbol_6}; - obj = tint_symbol_7; - obj = x_944; - const float3 x_529 = float3(x_526.y, x_526.z, x_526.x); - const int x_945 = i; - i = 0; - i = x_945; - const int x_37 = j; - const int x_946 = temp; - temp = 0; - temp = x_946; - const float2 x_530 = float2(x_529.z, x_529.y); - const int x_947 = obj.numbers[x_34_save]; - obj.numbers[x_34_save] = 0; - obj.numbers[x_34_save] = x_947; - const int x_38 = temp; - const int x_948 = j; - j = 0; - j = x_948; - const float3 x_531 = float3(x_527.x, x_526.y, x_526.x); - const int x_949 = obj.numbers[x_36_save]; - obj.numbers[x_36_save] = 0; - obj.numbers[x_36_save] = x_949; - const QuicksortObject x_950 = obj; - const int tint_symbol_8[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_9 = {tint_symbol_8}; - obj = tint_symbol_9; - obj = x_950; - const float3 x_532 = float3(x_528.x, x_528.y, x_528.x); - const int x_951 = obj.numbers[x_34_save]; - obj.numbers[x_34_save] = 0; - obj.numbers[x_34_save] = x_951; - obj.numbers[x_37] = x_38; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int param_3 = 0; - int i_1 = 0; - int j_1 = 0; - int param_2 = 0; - int param_1 = 0; - int param = 0; - int pivot = 0; - float2 x_537 = float2(0.0f, 0.0f); - float3 x_538 = float3(0.0f, 0.0f, 0.0f); - const int x_952 = h; - h = 0; - h = x_952; - const int x_41 = h; - const int x_953 = l; - l = 0; - l = x_953; - const int x_42_save = x_41; - const int x_954 = obj.numbers[x_42_save]; - obj.numbers[x_42_save] = 0; - obj.numbers[x_42_save] = x_954; - const int x_43 = obj.numbers[x_42_save]; - const int x_955 = param_3; - param_3 = 0; - param_3 = x_955; - const float3 x_534 = float3(float3(1.0f, 2.0f, 3.0f).z, float3(1.0f, 2.0f, 3.0f).x, float3(1.0f, 2.0f, 3.0f).z); - const int x_956 = param_1; - param_1 = 0; - param_1 = x_956; - pivot = x_43; - const int x_45 = l; - const int x_957 = h; - h = 0; - h = x_957; - const int x_958 = j_1; - j_1 = 0; - j_1 = x_958; - const float3 x_535 = float3(x_534.y, x_534.z, x_534.y); - const int x_959 = l; - l = 0; - l = x_959; - i_1 = (x_45 - asint(1u)); - const int x_49 = l; - const float3 x_536 = float3(x_534.x, x_534.z, x_535.x); - j_1 = 10; - const QuicksortObject x_960 = obj; - const int tint_symbol_10[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_11 = {tint_symbol_10}; - obj = tint_symbol_11; - obj = x_960; - [loop] while (true) { - const int x_961 = pivot; - pivot = 0; - pivot = x_961; - const int x_962 = param_1; - param_1 = 0; - param_1 = x_962; - const int x_55 = j_1; - const int x_963 = pivot; - pivot = 0; - pivot = x_963; - x_537 = float2(float3(1.0f, 2.0f, 3.0f).y, float3(1.0f, 2.0f, 3.0f).z); - const QuicksortObject x_964 = obj; - const int tint_symbol_12[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_13 = {tint_symbol_12}; - obj = tint_symbol_13; - obj = x_964; - const int x_56 = h; - const int x_965 = h; - h = 0; - h = x_965; - const int x_966 = param; - param = 0; - param = x_966; - const int x_967 = j_1; - j_1 = 0; - j_1 = x_967; - x_538 = float3(x_534.x, x_537.y, x_534.z); - const int x_968 = param; - param = 0; - param = x_968; - if ((x_55 <= (x_56 - asint(1u)))) { - } else { - break; - } - const int x_60 = j_1; - const int x_969 = obj.numbers[x_42_save]; - obj.numbers[x_42_save] = 0; - obj.numbers[x_42_save] = x_969; - const int x_61_save = x_60; - const int x_970 = h; - h = 0; - h = x_970; - const float3 x_539 = float3(x_537.x, x_535.z, x_537.x); - const int x_971 = param_1; - param_1 = 0; - param_1 = x_971; - const int x_62 = obj.numbers[x_61_save]; - const QuicksortObject x_972 = obj; - const int tint_symbol_14[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_15 = {tint_symbol_14}; - obj = tint_symbol_15; - obj = x_972; - const int x_63 = pivot; - const float2 x_540 = float2(float3(1.0f, 2.0f, 3.0f).y, x_534.z); - const int x_973 = i_1; - i_1 = 0; - i_1 = x_973; - const int x_974 = l; - l = 0; - l = x_974; - const float3 x_541 = float3(x_534.y, x_534.x, x_534.y); - const int x_975 = pivot; - pivot = 0; - pivot = x_975; - if ((x_62 <= x_63)) { - const float3 x_542 = float3(x_541.z, x_541.x, x_541.x); - const int x_976 = param_3; - param_3 = 0; - param_3 = x_976; - const int x_67 = i_1; - const int x_977 = pivot; - pivot = 0; - pivot = x_977; - const float2 x_543 = float2(x_539.x, x_541.y); - const int x_978 = i_1; - i_1 = 0; - i_1 = x_978; - const int x_979 = param; - param = 0; - param = x_979; - i_1 = (x_67 + asint(1u)); - const int x_980 = l; - l = 0; - l = x_980; - const float3 x_544 = float3(float3(1.0f, 2.0f, 3.0f).z, float3(1.0f, 2.0f, 3.0f).y, x_540.x); - const int x_70 = i_1; - const float2 x_545 = float2(x_537.y, x_538.x); - const int x_981 = param; - param = 0; - param = x_981; - param = x_70; - const int x_982 = param; - param = 0; - param = x_982; - const float2 x_546 = float2(x_545.x, x_545.x); - const int x_983 = i_1; - i_1 = 0; - i_1 = x_983; - param_1 = j_1; - const int x_984 = param_3; - param_3 = 0; - param_3 = x_984; - swap_i1_i1_(param, param_1); - const int x_985 = param_1; - param_1 = 0; - param_1 = x_985; - } - const QuicksortObject x_986 = obj; - const int tint_symbol_16[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_17 = {tint_symbol_16}; - obj = tint_symbol_17; - obj = x_986; - { - const int x_987 = h; - h = 0; - h = x_987; - const int x_74 = j_1; - const int x_988 = h; - h = 0; - h = x_988; - const float3 x_547 = float3(x_539.x, x_541.z, x_541.z); - const int x_989 = obj.numbers[x_61_save]; - obj.numbers[x_61_save] = 0; - obj.numbers[x_61_save] = x_989; - const int x_990 = param; - param = 0; - param = x_990; - j_1 = (1 + x_74); - const int x_991 = param_1; - param_1 = 0; - param_1 = x_991; - const float3 x_548 = float3(x_541.y, x_541.z, x_541.x); - const int x_992 = obj.numbers[x_61_save]; - obj.numbers[x_61_save] = 0; - obj.numbers[x_61_save] = x_992; - } - } - const int x_76 = i_1; - const int x_993 = obj.numbers[x_42_save]; - obj.numbers[x_42_save] = 0; - obj.numbers[x_42_save] = x_993; - const float2 x_549 = float2(x_534.x, x_534.y); - const QuicksortObject x_994 = obj; - const int tint_symbol_18[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_19 = {tint_symbol_18}; - obj = tint_symbol_19; - obj = x_994; - const int x_995 = h; - h = 0; - h = x_995; - i_1 = (1 + x_76); - const int x_996 = param_1; - param_1 = 0; - param_1 = x_996; - const int x_79 = i_1; - const int x_997 = j_1; - j_1 = 0; - j_1 = x_997; - const float2 x_550 = float2(x_534.x, x_534.x); - const int x_998 = param_1; - param_1 = 0; - param_1 = x_998; - param_2 = x_79; - const float2 x_551 = float2(x_534.y, x_536.x); - const int x_999 = pivot; - pivot = 0; - pivot = x_999; - const int x_81 = h; - const float2 x_552 = float2(x_550.x, x_549.y); - const int x_1000 = h; - h = 0; - h = x_1000; - param_3 = x_81; - const int x_1001 = i_1; - i_1 = 0; - i_1 = x_1001; - const float2 x_553 = float2(x_549.y, x_552.x); - const int x_1002 = h; - h = 0; - h = x_1002; - swap_i1_i1_(param_2, param_3); - const int x_1003 = l; - l = 0; - l = x_1003; - const float2 x_554 = float2(x_536.z, float3(1.0f, 2.0f, 3.0f).y); - const int x_1004 = param_1; - param_1 = 0; - param_1 = x_1004; - const int x_83 = i_1; - const int x_1005 = param; - param = 0; - param = x_1005; - const float2 x_555 = float2(x_534.y, x_534.x); - const int x_1006 = j_1; - j_1 = 0; - j_1 = x_1006; - return x_83; -} - -void quicksort_() { - int param_4 = 0; - int h_1 = 0; - int p = 0; - int l_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int param_5 = 0; - l_1 = 0; - const int x_1007 = param_5; - param_5 = 0; - param_5 = x_1007; - h_1 = 9; - const int x_1008[10] = stack; - const int tint_symbol_20[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_20; - stack = x_1008; - const float2 x_556 = float2(float3(1.0f, 2.0f, 3.0f).y, float3(1.0f, 2.0f, 3.0f).y); - const int x_1009 = param_5; - param_5 = 0; - param_5 = x_1009; - top = -1; - const int x_1010 = p; - p = 0; - p = x_1010; - const int x_93 = top; - const float2 x_557 = float2(float3(1.0f, 2.0f, 3.0f).x, float3(1.0f, 2.0f, 3.0f).x); - const int x_1011 = p; - p = 0; - p = x_1011; - const int x_94 = (x_93 + asint(1u)); - const int x_1012 = top; - top = 0; - top = x_1012; - const float2 x_558 = float2(x_556.y, x_557.y); - const int x_1013 = param_4; - param_4 = 0; - param_4 = x_1013; - top = x_94; - const int x_1014 = h_1; - h_1 = 0; - h_1 = x_1014; - const float3 x_559 = float3(x_557.y, x_557.x, x_557.x); - const int x_1015 = param_4; - param_4 = 0; - param_4 = x_1015; - const int x_95 = l_1; - const QuicksortObject x_1016 = obj; - const int tint_symbol_21[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_22 = {tint_symbol_21}; - obj = tint_symbol_22; - obj = x_1016; - const float3 x_560 = float3(x_559.y, x_559.x, x_557.x); - const int x_96_save = x_94; - const int x_1017[10] = stack; - const int tint_symbol_23[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_23; - stack = x_1017; - const float3 x_561 = float3(x_556.y, x_556.y, x_556.y); - const int x_1018 = l_1; - l_1 = 0; - l_1 = 0; - stack[x_96_save] = x_95; - const int x_1019 = param_5; - param_5 = 0; - param_5 = x_1019; - const int x_97 = top; - const int x_1020 = param_4; - param_4 = 0; - param_4 = x_1020; - const float3 x_562 = float3(float3(1.0f, 2.0f, 3.0f).z, x_558.y, float3(1.0f, 2.0f, 3.0f).y); - const int x_1021 = stack[x_96_save]; - stack[x_96_save] = 0; - stack[x_96_save] = x_1021; - const int x_98 = (x_97 + 1); - const int x_1022 = stack[x_96_save]; - stack[x_96_save] = 0; - stack[x_96_save] = x_1022; - const float3 x_563 = float3(x_559.x, x_559.z, x_556.y); - top = x_98; - const int x_1023 = param_4; - param_4 = 0; - param_4 = x_1023; - const int x_99 = h_1; - const int x_1024 = param_4; - param_4 = 0; - param_4 = x_1024; - const float3 x_564 = float3(x_558.x, x_561.x, x_558.y); - const int x_1025 = l_1; - l_1 = 0; - l_1 = x_1025; - const int x_100_save = x_98; - const int x_1026 = param_5; - param_5 = 0; - param_5 = x_1026; - const float2 x_565 = float2(x_564.z, x_564.z); - const int x_1027 = p; - p = 0; - p = x_1027; - stack[x_100_save] = x_99; - [loop] while (true) { - const float3 x_566 = float3(x_563.x, x_563.x, x_563.x); - const int x_1028 = h_1; - h_1 = 0; - h_1 = x_1028; - const int x_1029[10] = stack; - const int tint_symbol_24[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_24; - stack = x_1029; - const int x_106 = top; - const int x_1030[10] = stack; - const int tint_symbol_25[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_25; - stack = x_1030; - const float2 x_567 = float2(x_558.x, x_564.z); - const int x_1031 = param_4; - param_4 = 0; - param_4 = x_1031; - if ((x_106 >= asint(0u))) { - } else { - break; - } - const QuicksortObject x_1032 = obj; - const int tint_symbol_26[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_27 = {tint_symbol_26}; - obj = tint_symbol_27; - obj = x_1032; - const float3 x_568 = float3(x_559.y, x_559.x, x_563.y); - const int x_1033 = param_4; - param_4 = 0; - param_4 = x_1033; - const int x_108 = top; - const float3 x_569 = float3(x_565.x, x_567.y, x_565.x); - const int x_1034 = h_1; - h_1 = 0; - h_1 = x_1034; - const float2 x_570 = float2(x_556.x, x_556.x); - const int x_1035 = p; - p = 0; - p = x_1035; - top = (x_108 - asint(1u)); - const int x_1036 = p; - p = 0; - p = x_1036; - const int x_110_save = x_108; - const int x_1037 = stack[x_96_save]; - stack[x_96_save] = 0; - stack[x_96_save] = x_1037; - const int x_111 = stack[x_110_save]; - const int x_1038[10] = stack; - const int tint_symbol_28[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_28; - stack = x_1038; - const float3 x_571 = float3(x_559.y, x_559.x, x_564.y); - const int x_1039 = l_1; - l_1 = 0; - l_1 = x_1039; - h_1 = x_111; - const int x_1040[10] = stack; - const int tint_symbol_29[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_29; - stack = x_1040; - const float2 x_572 = float2(x_562.y, x_561.y); - const int x_1041 = p; - p = 0; - p = x_1041; - const int x_112 = top; - const int x_1042 = param_4; - param_4 = 0; - param_4 = x_1042; - const int x_1043 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1043; - const float2 x_573 = float2(float3(1.0f, 2.0f, 3.0f).y, float3(1.0f, 2.0f, 3.0f).z); - top = (x_112 - 1); - const int x_1044 = param_5; - param_5 = 0; - param_5 = x_1044; - const float3 x_574 = float3(x_570.y, x_565.x, x_570.y); - const int x_1045 = h_1; - h_1 = 0; - h_1 = x_1045; - const int x_114_save = x_112; - const float2 x_575 = float2(x_564.y, x_564.z); - const int x_1046 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1046; - const int x_115 = stack[x_114_save]; - const int x_1047 = p; - p = 0; - p = x_1047; - const float3 x_576 = float3(x_573.y, x_573.y, x_565.x); - const int x_1048 = param_5; - param_5 = 0; - param_5 = x_1048; - l_1 = x_115; - const int x_1049 = top; - top = 0; - top = x_1049; - param_4 = l_1; - const int x_1050 = stack[x_110_save]; - stack[x_110_save] = 0; - stack[x_110_save] = x_1050; - const float2 x_577 = float2(x_569.y, x_569.z); - const int x_120 = h_1; - const float2 x_578 = float2(x_558.x, float3(1.0f, 2.0f, 3.0f).y); - param_5 = x_120; - const int x_1051 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1051; - const int x_121 = performPartition_i1_i1_(param_4, param_5); - const float2 x_579 = float2(x_567.x, x_568.x); - const int x_1052 = param_5; - param_5 = 0; - param_5 = x_1052; - p = x_121; - const int x_1053 = param_4; - param_4 = 0; - param_4 = x_1053; - const int x_122 = p; - const int x_1054 = h_1; - h_1 = 0; - h_1 = x_1054; - const float2 x_580 = float2(x_568.y, x_568.y); - const int x_1055 = l_1; - l_1 = 0; - l_1 = x_1055; - const int x_1056 = h_1; - h_1 = 0; - h_1 = x_1056; - const int x_124 = l_1; - const int x_1057 = stack[x_110_save]; - stack[x_110_save] = 0; - stack[x_110_save] = x_1057; - const int x_1058 = h_1; - h_1 = 0; - h_1 = x_1058; - const float2 x_582 = float2(x_567.y, x_573.x); - const int x_1059 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1059; - if (((x_122 - asint(1u)) > x_124)) { - const int x_1060 = param_4; - param_4 = 0; - param_4 = x_1060; - const int x_128 = top; - const float2 x_583 = float2(x_571.y, x_556.y); - const int x_1061 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1061; - const int x_1062[10] = stack; - const int tint_symbol_30[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_30; - stack = x_1062; - const float2 x_584 = float2(x_569.z, x_569.y); - const float3 x_585 = float3(x_580.y, x_577.x, x_577.x); - const int x_130 = l_1; - const int x_1063 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1063; - const float2 x_586 = float2(x_564.x, x_585.x); - const int x_1064 = param_5; - param_5 = 0; - param_5 = x_1064; - const int x_131_save = (1 + x_128); - const int x_1065 = stack[x_110_save]; - stack[x_110_save] = 0; - stack[x_110_save] = x_1065; - const float3 x_587 = float3(x_566.y, x_566.y, x_563.x); - const int x_1066 = param_5; - param_5 = 0; - param_5 = x_1066; - stack[x_131_save] = x_130; - const int x_132 = top; - const int x_1067 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1067; - const float2 x_588 = float2(x_575.y, x_575.x); - const int x_1068 = stack[x_131_save]; - stack[x_131_save] = 0; - stack[x_131_save] = x_1068; - const int x_133 = asint((1u + asuint(x_132))); - const int x_1069 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1069; - const float3 x_589 = float3(x_576.z, x_588.y, x_576.z); - const int x_1070 = h_1; - h_1 = 0; - h_1 = x_1070; - top = x_133; - const int x_1071[10] = stack; - const int tint_symbol_31[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_31; - stack = x_1071; - const int x_134 = p; - const float2 x_590 = float2(x_576.x, x_573.y); - const int x_1072 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1072; - const int x_136_save = x_133; - const int x_1073 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1073; - stack[x_136_save] = (x_134 - asint(1u)); - const int x_1074 = stack[x_96_save]; - stack[x_96_save] = 0; - stack[x_96_save] = x_1074; - const float2 x_591 = float2(x_569.z, x_569.y); - const int x_1075 = stack[x_136_save]; - stack[x_136_save] = 0; - stack[x_136_save] = x_1075; - } - const int x_1076 = stack[x_96_save]; - stack[x_96_save] = 0; - stack[x_96_save] = x_1076; - const float2 x_592 = float2(float3(1.0f, 2.0f, 3.0f).x, float3(1.0f, 2.0f, 3.0f).y); - const QuicksortObject x_1077 = obj; - const int tint_symbol_32[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_33 = {tint_symbol_32}; - obj = tint_symbol_33; - obj = x_1077; - const int x_137 = p; - const int x_1078 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1078; - const float3 x_593 = float3(x_571.z, x_556.x, x_556.y); - const int x_1079 = p; - p = 0; - p = x_1079; - const float3 x_594 = float3(x_563.z, x_563.x, x_575.x); - const int x_1080 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1080; - const int x_139 = h_1; - const int x_1081 = top; - top = 0; - top = x_1081; - const float3 x_595 = float3(x_560.z, x_568.x, x_560.x); - const int x_1082 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1082; - const int x_1083 = p; - p = 0; - p = x_1083; - if ((asint((1u + asuint(x_137))) < x_139)) { - const int x_1084 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1084; - const float2 x_596 = float2(x_592.y, x_582.x); - const int x_1085 = l_1; - l_1 = 0; - l_1 = x_1085; - const int x_143 = top; - const int x_1086 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1086; - const float3 x_597 = float3(x_562.y, x_560.y, x_560.y); - const int x_144 = (x_143 + 1); - const int x_1087 = param_5; - param_5 = 0; - param_5 = x_1087; - top = x_144; - const int x_1088 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1088; - const int x_145 = p; - const int x_1089 = param_5; - param_5 = 0; - param_5 = x_1089; - const float3 x_599 = float3(x_560.z, x_560.x, x_568.x); - const int x_1090 = p; - p = 0; - p = x_1090; - const float3 x_600 = float3(x_556.x, x_580.x, x_580.x); - const int x_1091 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1091; - const int x_147_save = x_144; - const int x_1092 = stack[x_110_save]; - stack[x_110_save] = 0; - stack[x_110_save] = x_1092; - const float2 x_601 = float2(x_563.x, x_563.y); - stack[x_147_save] = asint((1u + asuint(x_145))); - const int x_1093[10] = stack; - const int tint_symbol_34[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_34; - stack = x_1093; - const int x_148 = top; - const int x_1094 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1094; - const float2 x_602 = float2(x_565.y, x_599.y); - const int x_1095[10] = stack; - const int tint_symbol_35[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - stack = tint_symbol_35; - stack = x_1095; - const int x_149 = (x_148 + asint(1u)); - const int x_1096 = stack[x_147_save]; - stack[x_147_save] = 0; - stack[x_147_save] = x_1096; - top = x_149; - const int x_1097 = param_4; - param_4 = 0; - param_4 = x_1097; - const int x_150 = h_1; - const int x_1098 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1098; - const int x_1099 = stack[x_96_save]; - stack[x_96_save] = 0; - stack[x_96_save] = x_1099; - stack[x_149] = x_150; - const int x_1100 = stack[x_114_save]; - stack[x_114_save] = 0; - stack[x_114_save] = x_1100; - const float3 x_603 = float3(x_568.y, x_564.x, x_564.x); - const int x_1101 = l_1; - l_1 = 0; - l_1 = x_1101; - } - const int x_1102 = stack[x_100_save]; - stack[x_100_save] = 0; - stack[x_100_save] = x_1102; - { - const int x_1103 = l_1; - l_1 = 0; - l_1 = x_1103; - const float2 x_604 = float2(x_563.z, x_564.x); - const QuicksortObject x_1104 = obj; - const int tint_symbol_36[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_37 = {tint_symbol_36}; - obj = tint_symbol_37; - obj = x_1104; - } - } - const int x_1105 = h_1; - h_1 = 0; - h_1 = x_1105; - return; -} - -void main_1() { - float3 color = float3(0.0f, 0.0f, 0.0f); - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - const float2 x_717 = uv; - uv = float2(0.0f, 0.0f); - uv = x_717; - i_2 = 0; - const QuicksortObject x_721 = obj; - const int tint_symbol_38[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_39 = {tint_symbol_38}; - obj = tint_symbol_39; - obj = x_721; - if (true) { - const QuicksortObject x_722 = obj; - const int tint_symbol_40[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_41 = {tint_symbol_40}; - obj = tint_symbol_41; - obj = x_722; - const float2 x_431 = float2(float3(1.0f, 2.0f, 3.0f).x, float3(1.0f, 2.0f, 3.0f).x); - const int x_158 = i_2; - const float2 x_723 = uv; - uv = float2(0.0f, 0.0f); - uv = x_723; - const float3 x_725 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_725; - const float2 x_432 = float2(x_431.y, x_431.y); - const QuicksortObject x_726 = obj; - const int tint_symbol_42[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_43 = {tint_symbol_42}; - obj = tint_symbol_43; - obj = x_726; - } - const QuicksortObject x_756 = obj; - const int tint_symbol_44[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_45 = {tint_symbol_44}; - obj = tint_symbol_45; - obj = x_756; - const float2 x_446 = float2(float2(0.0f, 0.0f).x, float2(0.0f, 0.0f).x); - const int x_757 = i_2; - i_2 = 0; - i_2 = x_757; - quicksort_(); - const QuicksortObject x_758 = obj; - const int tint_symbol_46[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_47 = {tint_symbol_46}; - obj = tint_symbol_47; - obj = x_758; - const float4 x_184 = gl_FragCoord; - const float2 x_759 = uv; - uv = float2(0.0f, 0.0f); - uv = x_759; - const float2 x_447 = float2(float2(0.0f, 0.0f).y, float2(0.0f, 0.0f).y); - const float2 x_760 = uv; - uv = float2(0.0f, 0.0f); - uv = x_760; - const float2 x_185 = float2(x_184.x, x_184.y); - const float3 x_448 = float3(x_185.y, x_446.y, x_446.y); - const QuicksortObject x_761 = obj; - const int tint_symbol_48[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_49 = {tint_symbol_48}; - obj = tint_symbol_49; - obj = x_761; - const float2 x_762 = uv; - uv = float2(0.0f, 0.0f); - uv = x_762; - const float2 x_191 = asfloat(x_188[0].xy); - const QuicksortObject x_763 = obj; - const int tint_symbol_50[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_51 = {tint_symbol_50}; - obj = tint_symbol_51; - obj = x_763; - const float3 x_449 = float3(x_184.y, float3(1.0f, 2.0f, 3.0f).z, x_184.w); - const float3 x_764 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_764; - const float2 x_192 = (x_185 / x_191); - const QuicksortObject x_765 = obj; - const int tint_symbol_52[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_53 = {tint_symbol_52}; - obj = tint_symbol_53; - obj = x_765; - const float2 x_450 = float2(x_447.x, x_185.y); - const float3 x_766 = color; - color = float3(0.0f, 0.0f, 0.0f); - const float3 x_767 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_767; - color = x_766; - uv = x_192; - color = float3(1.0f, 2.0f, 3.0f); - const float3 x_768 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_768; - const float3 x_451 = float3(x_185.x, x_185.y, x_446.y); - const QuicksortObject x_769 = obj; - const int tint_symbol_54[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_55 = {tint_symbol_54}; - obj = tint_symbol_55; - obj = x_769; - const int x_770 = obj.numbers[0u]; - obj.numbers[0u] = 0; - obj.numbers[0u] = x_770; - const int x_201 = obj.numbers[0u]; - const QuicksortObject x_771 = obj; - const int tint_symbol_56[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_57 = {tint_symbol_56}; - obj = tint_symbol_57; - obj = x_771; - const int x_772 = obj.numbers[0u]; - obj.numbers[0u] = 0; - obj.numbers[0u] = x_772; - const float x_206 = color.x; - const float x_773 = color.x; - color.x = 0.0f; - color.x = x_773; - const float2 x_452 = float2(float3(1.0f, 2.0f, 3.0f).z, float3(1.0f, 2.0f, 3.0f).y); - const int x_774 = i_2; - i_2 = 0; - i_2 = x_774; - const QuicksortObject x_775 = obj; - const int tint_symbol_58[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_59 = {tint_symbol_58}; - obj = tint_symbol_59; - obj = x_775; - const float3 x_453 = float3(x_451.x, x_450.x, x_450.y); - color.x = (x_206 + float(x_201)); - const float2 x_776 = uv; - uv = float2(0.0f, 0.0f); - uv = x_776; - const float2 x_777 = uv; - uv = float2(0.0f, 0.0f); - uv = x_777; - const float2 x_454 = float2(x_184.y, x_184.y); - const float x_210 = uv.x; - const float2 x_455 = float2(x_192.y, x_192.x); - const float x_778 = uv.x; - uv.x = 0.0f; - uv.x = x_778; - const QuicksortObject x_779 = obj; - const int tint_symbol_60[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_61 = {tint_symbol_60}; - obj = tint_symbol_61; - obj = x_779; - if ((x_210 > 0.25f)) { - const int x_780 = i_2; - i_2 = 0; - i_2 = x_780; - const int x_781 = obj.numbers[0u]; - obj.numbers[0u] = 0; - obj.numbers[0u] = x_781; - const float3 x_456 = float3(float2(0.0f, 0.0f).y, x_448.y, x_448.y); - const float x_782 = uv.x; - uv.x = 0.0f; - uv.x = x_782; - const int x_216 = obj.numbers[1]; - const QuicksortObject x_783 = obj; - const int tint_symbol_62[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_63 = {tint_symbol_62}; - obj = tint_symbol_63; - obj = x_783; - const float2 x_457 = float2(x_454.x, x_454.x); - const float2 x_784 = uv; - uv = float2(0.0f, 0.0f); - uv = x_784; - const QuicksortObject x_785 = obj; - const int tint_symbol_64[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_65 = {tint_symbol_64}; - obj = tint_symbol_65; - obj = x_785; - const float2 x_458 = float2(float3(1.0f, 2.0f, 3.0f).z, float2(0.0f, 0.0f).y); - const int x_786 = i_2; - i_2 = 0; - i_2 = x_786; - const float x_219 = color[0]; - const float x_787 = color[0]; - color[0] = 0.0f; - color[0] = x_787; - const float3 x_788 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_788; - const float3 x_789 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_789; - const float3 x_459 = float3(x_454.y, x_454.y, x_447.y); - const float x_790 = color[0]; - color[0] = 0.0f; - color[0] = x_790; - color.x = (float(x_216) + x_219); - const int x_791 = obj.numbers[0u]; - obj.numbers[0u] = 0; - obj.numbers[0u] = x_791; - } - const float x_792 = uv.x; - uv.x = 0.0f; - uv.x = x_792; - const float x_793 = uv.x; - uv.x = 0.0f; - uv.x = x_793; - const float x_223 = uv.x; - const float x_794 = uv.x; - uv.x = 0.0f; - uv.x = x_794; - const float3 x_460 = float3(x_453.z, x_453.y, x_453.y); - const float2 x_795 = uv; - uv = float2(0.0f, 0.0f); - uv = x_795; - const float x_796 = uv.x; - uv.x = 0.0f; - uv.x = x_796; - const float2 x_461 = float2(float2(0.0f, 0.0f).y, float2(0.0f, 0.0f).y); - const float x_797 = uv.x; - uv.x = 0.0f; - uv.x = x_797; - if ((x_223 > 0.5f)) { - const float x_798 = uv.x; - uv.x = 0.0f; - uv.x = x_798; - const float2 x_462 = float2(x_446.x, x_446.x); - const float x_799 = color.x; - color.x = 0.0f; - color.x = x_799; - const float x_800 = color.x; - color.x = 0.0f; - color.x = x_800; - const float3 x_463 = float3(x_453.x, x_453.z, x_461.y); - const float x_801 = color.x; - color.x = 0.0f; - color.x = x_801; - const int x_230 = obj.numbers[2u]; - const float x_802 = uv.x; - uv.x = 0.0f; - uv.x = x_802; - const float x_803 = color.x; - color.x = 0.0f; - color.x = x_803; - const int x_804 = obj.numbers[2u]; - obj.numbers[2u] = 0; - obj.numbers[2u] = x_804; - const float2 x_464 = float2(x_450.y, x_191.x); - const float x_805 = color.y; - color.y = 0.0f; - color.y = x_805; - const float x_234 = color.y; - const int x_806 = obj.numbers[2u]; - obj.numbers[2u] = 0; - obj.numbers[2u] = x_806; - const float2 x_465 = float2(x_463.x, x_185.x); - const float x_807 = color.x; - color.x = 0.0f; - color.x = x_807; - const int x_808 = i_2; - i_2 = 0; - i_2 = x_808; - const float2 x_466 = float2(x_455.y, float2(0.0f, 0.0f).y); - const int x_809 = i_2; - i_2 = 0; - i_2 = x_809; - color.y = (float(x_230) + x_234); - const float x_810 = uv.x; - uv.x = 0.0f; - uv.x = x_810; - } - const int x_811 = i_2; - i_2 = 0; - i_2 = x_811; - const float2 x_467 = float2(x_191.x, x_191.x); - const float x_812 = uv.x; - uv.x = 0.0f; - uv.x = x_812; - const float x_238 = uv[0]; - const float3 x_813 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_813; - const float x_814 = color.x; - color.x = 0.0f; - color.x = x_814; - if ((x_238 > 0.75f)) { - const float x_815 = color.x; - color.x = 0.0f; - color.x = x_815; - const int x_245 = obj.numbers[3]; - const float x_816 = color.x; - color.x = 0.0f; - color.x = x_816; - const QuicksortObject x_817 = obj; - const int tint_symbol_66[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_67 = {tint_symbol_66}; - obj = tint_symbol_67; - obj = x_817; - const float3 x_468 = float3(x_467.x, x_467.x, x_467.x); - const float x_818 = uv[0]; - uv[0] = 0.0f; - uv[0] = x_818; - const float x_819 = uv.x; - uv.x = 0.0f; - uv.x = x_819; - const float x_249 = color.z; - const float3 x_820 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_820; - const float3 x_469 = float3(x_467.x, x_191.y, x_467.y); - const float x_821 = color.z; - color.z = 0.0f; - color.z = x_821; - const int x_822 = obj.numbers[0u]; - obj.numbers[0u] = 0; - obj.numbers[0u] = x_822; - const float2 x_470 = float2(float2(0.0f, 0.0f).x, float2(0.0f, 0.0f).y); - const float x_823 = color.z; - color.z = 0.0f; - color.z = x_823; - color.z = (x_249 + float(x_245)); - const float2 x_824 = uv; - uv = float2(0.0f, 0.0f); - uv = x_824; - const float2 x_471 = float2(x_470.y, x_470.y); - } - const float x_825 = uv[0]; - uv[0] = 0.0f; - uv[0] = x_825; - const float3 x_472 = float3(x_454.x, x_454.y, x_454.y); - const int x_254 = obj.numbers[4]; - const float x_826 = uv[0]; - uv[0] = 0.0f; - uv[0] = x_826; - const float3 x_827 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_827; - const float3 x_473 = float3(x_446.y, x_453.x, x_453.x); - const int x_828 = obj.numbers[4]; - obj.numbers[4] = 0; - obj.numbers[4] = x_828; - const float2 x_474 = float2(x_191.x, x_184.z); - const float x_829 = uv.x; - uv.x = 0.0f; - uv.x = x_829; - const float x_257 = color.y; - const float x_830 = color.y; - color.y = 0.0f; - color.y = x_830; - const float2 x_475 = float2(x_467.x, x_450.x); - const float x_831 = uv.x; - uv.x = 0.0f; - uv.x = x_831; - const float x_832 = color.x; - color.x = 0.0f; - color.x = x_832; - const float2 x_476 = float2(x_451.z, x_460.y); - color.y = (x_257 + float(x_254)); - const float3 x_477 = float3(float2(0.0f, 0.0f).x, x_472.x, float2(0.0f, 0.0f).y); - const float x_833 = uv.x; - uv.x = 0.0f; - uv.x = x_833; - const float x_834 = color.x; - color.x = 0.0f; - color.x = x_834; - const float2 x_478 = float2(x_472.x, x_472.y); - const float x_835 = uv.y; - uv.y = 0.0f; - uv.y = x_835; - const float x_261 = uv.y; - const int x_836 = i_2; - i_2 = 0; - i_2 = x_836; - const float3 x_479 = float3(float2(0.0f, 0.0f).y, x_454.y, float2(0.0f, 0.0f).x); - const int x_837 = obj.numbers[0u]; - obj.numbers[0u] = 0; - obj.numbers[0u] = x_837; - const float x_838 = color.y; - color.y = 0.0f; - color.y = x_838; - const float3 x_480 = float3(x_446.x, x_446.x, float2(0.0f, 0.0f).y); - const float x_839 = uv.x; - uv.x = 0.0f; - uv.x = x_839; - if ((x_261 > 0.25f)) { - const float2 x_481 = float2(x_447.x, x_480.z); - const float3 x_840 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_840; - const int x_267 = obj.numbers[5u]; - const float x_841 = color.x; - color.x = 0.0f; - color.x = x_841; - const int x_842 = i_2; - i_2 = 0; - i_2 = x_842; - const int x_843 = i_2; - i_2 = 0; - i_2 = x_843; - const float x_270 = color.x; - const float x_844 = uv[0]; - uv[0] = 0.0f; - uv[0] = x_844; - const float3 x_482 = float3(x_455.x, x_475.y, x_455.y); - const QuicksortObject x_845 = obj; - const int tint_symbol_68[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_69 = {tint_symbol_68}; - obj = tint_symbol_69; - obj = x_845; - const float x_846 = uv.y; - uv.y = 0.0f; - uv.y = x_846; - const int x_847 = i_2; - i_2 = 0; - i_2 = x_847; - const float3 x_483 = float3(x_184.w, x_184.w, x_192.x); - const float x_848 = uv.x; - uv.x = 0.0f; - uv.x = x_848; - color.x = (float(x_267) + x_270); - const float3 x_484 = float3(x_454.y, x_450.x, x_454.y); - const float x_849 = uv.x; - uv.x = 0.0f; - uv.x = x_849; - } - const float x_850 = color.x; - color.x = 0.0f; - color.x = x_850; - const float3 x_485 = float3(x_467.x, x_450.y, x_450.x); - const float x_851 = uv.y; - uv.y = 0.0f; - uv.y = x_851; - const int x_852 = obj.numbers[4]; - obj.numbers[4] = 0; - obj.numbers[4] = x_852; - const float x_274 = uv.y; - const int x_853 = obj.numbers[0u]; - obj.numbers[0u] = 0; - obj.numbers[0u] = x_853; - if ((x_274 > 0.5f)) { - const float x_854 = uv.x; - uv.x = 0.0f; - uv.x = x_854; - const float2 x_486 = float2(x_480.y, x_455.y); - const float x_855 = color.y; - color.y = 0.0f; - color.y = x_855; - const float2 x_487 = float2(x_449.z, x_449.y); - const float x_856 = uv.y; - uv.y = 0.0f; - uv.y = x_856; - const int x_280 = obj.numbers[6u]; - const float x_857 = uv.y; - uv.y = 0.0f; - uv.y = x_857; - const int x_858 = i_2; - i_2 = 0; - i_2 = x_858; - const int x_859 = obj.numbers[4]; - obj.numbers[4] = 0; - obj.numbers[4] = x_859; - const float2 x_488 = float2(x_473.z, x_473.y); - const float x_283 = color.y; - const float2 x_860 = uv; - uv = float2(0.0f, 0.0f); - uv = x_860; - const float x_861 = color.x; - color.x = 0.0f; - color.x = x_861; - const float2 x_489 = float2(x_475.y, x_475.x); - const int x_862 = obj.numbers[6u]; - obj.numbers[6u] = 0; - obj.numbers[6u] = x_862; - const int x_863 = obj.numbers[6u]; - obj.numbers[6u] = 0; - obj.numbers[6u] = x_863; - const float2 x_490 = float2(x_480.z, x_480.z); - const QuicksortObject x_864 = obj; - const int tint_symbol_70[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_71 = {tint_symbol_70}; - obj = tint_symbol_71; - obj = x_864; - color.y = (float(x_280) + x_283); - const float x_865 = color.x; - color.x = 0.0f; - color.x = x_865; - const float2 x_491 = float2(float3(1.0f, 2.0f, 3.0f).y, x_454.x); - const float x_866 = color.y; - color.y = 0.0f; - color.y = x_866; - } - const float2 x_492 = float2(x_455.y, x_455.y); - const float x_867 = color.x; - color.x = 0.0f; - color.x = x_867; - const float x_287 = uv.y; - const QuicksortObject x_868 = obj; - const int tint_symbol_72[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_73 = {tint_symbol_72}; - obj = tint_symbol_73; - obj = x_868; - const float2 x_493 = float2(x_475.x, x_475.y); - const float x_869 = uv[0]; - uv[0] = 0.0f; - uv[0] = x_869; - const float x_870 = color.y; - color.y = 0.0f; - color.y = x_870; - const float3 x_494 = float3(x_191.x, x_191.y, x_191.y); - const int x_871 = obj.numbers[4]; - obj.numbers[4] = 0; - obj.numbers[4] = x_871; - if ((x_287 > 0.75f)) { - const float3 x_872 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_872; - const float x_873 = color.x; - color.x = 0.0f; - color.x = x_873; - const float3 x_495 = float3(x_192.y, x_192.x, x_192.y); - const float3 x_874 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_874; - const int x_293 = obj.numbers[7]; - const float x_875 = uv.x; - uv.x = 0.0f; - uv.x = x_875; - const float3 x_496 = float3(x_475.x, x_467.y, x_467.x); - const float x_876 = color.y; - color.y = 0.0f; - color.y = x_876; - const float2 x_497 = float2(x_477.x, x_461.y); - const int x_877 = obj.numbers[0u]; - obj.numbers[0u] = 0; - obj.numbers[0u] = x_877; - const float x_878 = color.y; - color.y = 0.0f; - color.y = x_878; - const float3 x_498 = float3(x_478.x, x_478.y, x_478.x); - const float x_879 = color.x; - color.x = 0.0f; - color.x = x_879; - const float x_296 = color.z; - const float x_880 = uv.y; - uv.y = 0.0f; - uv.y = x_880; - const float2 x_499 = float2(x_184.x, x_184.y); - const float x_881 = uv.x; - uv.x = 0.0f; - uv.x = x_881; - const float x_882 = uv.y; - uv.y = 0.0f; - uv.y = x_882; - const float x_883 = uv.y; - uv.y = 0.0f; - uv.y = x_883; - const float3 x_500 = float3(x_499.y, x_499.y, x_494.z); - const float x_884 = color.z; - color.z = 0.0f; - color.z = x_884; - color.z = (float(x_293) + x_296); - const float x_885 = color.y; - color.y = 0.0f; - color.y = x_885; - const float2 x_501 = float2(x_453.x, x_453.z); - const float x_886 = color.x; - color.x = 0.0f; - color.x = x_886; - } - const int x_887 = i_2; - i_2 = 0; - i_2 = x_887; - const float2 x_502 = float2(x_451.y, x_192.y); - const float2 x_888 = uv; - uv = float2(0.0f, 0.0f); - uv = x_888; - const int x_301 = obj.numbers[8]; - const int x_889 = i_2; - i_2 = 0; - i_2 = x_889; - const float2 x_503 = float2(x_185.x, x_451.z); - const int x_890 = obj.numbers[8]; - obj.numbers[8] = 0; - obj.numbers[8] = x_890; - const float x_891 = color.y; - color.y = 0.0f; - color.y = x_891; - const float2 x_504 = float2(x_453.y, float2(0.0f, 0.0f).x); - const float x_892 = color.x; - color.x = 0.0f; - color.x = x_892; - const float3 x_505 = float3(x_504.x, x_504.y, x_504.x); - const float x_893 = color.z; - color.z = 0.0f; - color.z = x_893; - const float x_304 = color.z; - const float x_894 = color.x; - color.x = 0.0f; - color.x = x_894; - const float2 x_506 = float2(x_493.x, x_492.x); - const int x_895 = obj.numbers[4]; - obj.numbers[4] = 0; - obj.numbers[4] = x_895; - const float x_896 = uv.y; - uv.y = 0.0f; - uv.y = x_896; - const float2 x_507 = float2(x_461.x, x_447.x); - const float x_897 = color.y; - color.y = 0.0f; - color.y = x_897; - color.z = (x_304 + float(x_301)); - const float2 x_898 = uv; - uv = float2(0.0f, 0.0f); - uv = x_898; - const float x_899 = uv.x; - uv.x = 0.0f; - uv.x = x_899; - const float3 x_508 = float3(x_461.y, x_461.x, x_506.y); - const float x_900 = uv.x; - uv.x = 0.0f; - uv.x = x_900; - const float x_308 = uv.x; - const float x_901 = color.y; - color.y = 0.0f; - color.y = x_901; - const float3 x_509 = float3(x_503.y, x_503.x, x_448.z); - const float x_902 = uv.y; - uv.y = 0.0f; - uv.y = x_902; - const float x_310 = uv.y; - const float x_903 = uv.y; - uv.y = 0.0f; - uv.y = x_903; - const float x_904 = color.z; - color.z = 0.0f; - color.z = x_904; - const float3 x_510 = float3(float3(1.0f, 2.0f, 3.0f).y, x_485.y, x_485.z); - const float x_905 = color.z; - color.z = 0.0f; - color.z = x_905; - const int x_906 = i_2; - i_2 = 0; - i_2 = x_906; - const float2 x_511 = float2(x_485.z, x_485.y); - const float3 x_907 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_907; - const float x_908 = uv.y; - uv.y = 0.0f; - uv.y = x_908; - const float3 x_512 = float3(x_455.y, x_455.y, x_455.y); - const int x_909 = obj.numbers[4]; - obj.numbers[4] = 0; - obj.numbers[4] = x_909; - if ((abs((x_308 - x_310)) < 0.25f)) { - const float x_910 = uv.x; - uv.x = 0.0f; - uv.x = x_910; - const QuicksortObject x_911 = obj; - const int tint_symbol_74[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_75 = {tint_symbol_74}; - obj = tint_symbol_75; - obj = x_911; - const float3 x_513 = float3(x_505.z, x_505.x, x_448.x); - const int x_912 = obj.numbers[8]; - obj.numbers[8] = 0; - obj.numbers[8] = x_912; - const int x_317 = obj.numbers[9u]; - const float3 x_514 = float3(x_474.y, x_474.y, x_474.y); - const float x_913 = uv.y; - uv.y = 0.0f; - uv.y = x_913; - const float x_320 = color.x; - const float x_914 = uv.y; - uv.y = 0.0f; - uv.y = x_914; - const float2 x_515 = float2(x_502.x, x_502.y); - const float x_915 = color.x; - color.x = 0.0f; - color.x = x_915; - const float3 x_916 = color; - color = float3(0.0f, 0.0f, 0.0f); - color = x_916; - const float2 x_516 = float2(x_452.x, x_452.x); - const float2 x_917 = uv; - uv = float2(0.0f, 0.0f); - uv = x_917; - const float x_918 = uv.x; - uv.x = 0.0f; - uv.x = x_918; - const float3 x_517 = float3(float2(0.0f, 0.0f).x, float2(0.0f, 0.0f).x, float2(0.0f, 0.0f).y); - color.x = (float(x_317) + x_320); - const float x_919 = color.x; - color.x = 0.0f; - color.x = x_919; - const float3 x_518 = float3(x_480.y, x_508.x, x_480.x); - const float x_920 = color.x; - color.x = 0.0f; - color.x = x_920; - } - const float x_921 = uv.y; - uv.y = 0.0f; - uv.y = x_921; - const float3 x_325 = color; - const float x_922 = uv[0]; - uv[0] = 0.0f; - uv[0] = x_922; - const float3 x_519 = float3(x_447.x, x_446.x, x_446.y); - const float3 x_326 = normalize(x_325); - const float x_923 = uv.x; - uv.x = 0.0f; - uv.x = x_923; - const QuicksortObject x_924 = obj; - const int tint_symbol_76[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_77 = {tint_symbol_76}; - obj = tint_symbol_77; - obj = x_924; - const QuicksortObject x_925 = obj; - const int tint_symbol_78[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_79 = {tint_symbol_78}; - obj = tint_symbol_79; - obj = x_925; - const float x_926 = color.y; - color.y = 0.0f; - color.y = x_926; - const float2 x_520 = float2(x_506.y, x_519.y); - const float x_927 = color.y; - color.y = 0.0f; - color.y = x_927; - const float4 x_330 = float4(x_326.x, x_326.y, x_326.z, 1.0f); - const float x_928 = uv.y; - uv.y = 0.0f; - uv.y = x_928; - const float3 x_521 = float3(float3(1.0f, 2.0f, 3.0f).y, float3(1.0f, 2.0f, 3.0f).y, x_520.y); - const float x_929 = uv.x; - uv.x = 0.0f; - uv.x = x_929; - x_GLF_color = x_330; - const QuicksortObject x_930 = obj; - const int tint_symbol_80[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const QuicksortObject tint_symbol_81 = {tint_symbol_80}; - obj = tint_symbol_81; - obj = x_930; - const float3 x_522 = float3(x_330.w, x_330.y, x_493.x); - const float x_931 = color.x; - color.x = 0.0f; - color.x = x_931; - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol_1 { - float4 gl_FragCoord_param : SV_Position; -}; -struct tint_symbol_2 { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner(float4 gl_FragCoord_param) { - gl_FragCoord = gl_FragCoord_param; - main_1(); - const main_out tint_symbol_82 = {x_GLF_color}; - return tint_symbol_82; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x000001EB41548320(156,10-21): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/bug/tint/998.wgsl.expected.hlsl b/test/bug/tint/998.wgsl.expected.hlsl deleted file mode 100644 index 30eb1a0c55..0000000000 --- a/test/bug/tint/998.wgsl.expected.hlsl +++ /dev/null @@ -1,21 +0,0 @@ -SKIP: FAILED - -cbuffer cbuffer_constants : register(b0, space1) { - uint4 constants[1]; -}; - -RWByteAddressBuffer result : register(u1, space1); - -struct S { - uint data[3]; -}; - -static S s = (S)0; - -[numthreads(1, 1, 1)] -void main() { - s.data[constants[0].x] = 0u; - return; -} -C:\src\tint\test\Shader@0x00000150124FBBE0(15,3-24): error X3500: array reference cannot be used as an l-value; not natively addressable - diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl new file mode 100644 index 0000000000..379856e989 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl @@ -0,0 +1,22 @@ +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + for (var i: i32 = 0; i < 4; i = i + 1) { + s1.a1[uniforms.i] = v; + } +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.hlsl new file mode 100644 index 0000000000..f82b13f649 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.hlsl @@ -0,0 +1,26 @@ +struct InnerS { + int v; +}; +struct OuterS { + InnerS a1[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s1 = (OuterS)0; + { + [loop] for(int i = 0; (i < 4); i = (i + 1)) { + { + InnerS tint_symbol_1[8] = s1.a1; + tint_symbol_1[uniforms[0].x] = v; + s1.a1 = tint_symbol_1; + } + } + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl new file mode 100644 index 0000000000..5ca583618e --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl @@ -0,0 +1,22 @@ +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + for (var i: i32 = 0; i < 4; s1.a1[uniforms.i] = v) { + i = i + 1; + } +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.hlsl new file mode 100644 index 0000000000..382880aa98 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.hlsl @@ -0,0 +1,29 @@ +struct InnerS { + int v; +}; +struct OuterS { + InnerS a1[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s1 = (OuterS)0; + { + int i = 0; + [loop] while (true) { + if (!((i < 4))) { break; } + i = (i + 1); + { + InnerS tint_symbol_1[8] = s1.a1; + tint_symbol_1[uniforms[0].x] = v; + s1.a1 = tint_symbol_1; + } + } + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl new file mode 100644 index 0000000000..d9dd6b2968 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl @@ -0,0 +1,22 @@ +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + var i: i32 = 0; + for (s1.a1[uniforms.i] = v; i < 4; i = i + 1) { + } +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.hlsl new file mode 100644 index 0000000000..78f5452e2c --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.hlsl @@ -0,0 +1,27 @@ +struct InnerS { + int v; +}; +struct OuterS { + InnerS a1[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s1 = (OuterS)0; + int i = 0; + { + { + InnerS tint_symbol_1[8] = s1.a1; + tint_symbol_1[uniforms[0].x] = v; + s1.a1 = tint_symbol_1; + } + [loop] for(; (i < 4); i = (i + 1)) { + } + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl new file mode 100644 index 0000000000..9d569e306c --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl @@ -0,0 +1,31 @@ +struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a2 : array; +}; + +struct OuterS { + a1 : array; +}; + +var nextIndex : u32; +fn getNextIndex() -> u32 { + nextIndex = nextIndex + 1u; + return nextIndex; +} + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s : OuterS; + s.a1[getNextIndex()].a2[uniforms.j] = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.hlsl new file mode 100644 index 0000000000..eff5fb2be9 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.hlsl @@ -0,0 +1,35 @@ +struct InnerS { + int v; +}; +struct S1 { + InnerS a2[8]; +}; +struct OuterS { + S1 a1[8]; +}; + +static uint nextIndex = 0u; + +uint getNextIndex() { + nextIndex = (nextIndex + 1u); + return nextIndex; +} + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s = (OuterS)0; + { + S1 tint_symbol_1[8] = s.a1; + const uint tint_symbol_2_save = getNextIndex(); + InnerS tint_symbol_3[8] = tint_symbol_1[tint_symbol_2_save].a2; + tint_symbol_3[uniforms[0].y] = v; + tint_symbol_1[tint_symbol_2_save].a2 = tint_symbol_3; + s.a1 = tint_symbol_1; + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl new file mode 100644 index 0000000000..2268109fbe --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl @@ -0,0 +1,21 @@ +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + s1.a1[uniforms.i] = v; + //s1.a1[0] = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.hlsl new file mode 100644 index 0000000000..15ddcb2011 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +struct InnerS { + int v; +}; +struct OuterS { + InnerS a1[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s1 = (OuterS)0; + { + InnerS tint_symbol_1[8] = s1.a1; + tint_symbol_1[uniforms[0].x] = v; + s1.a1 = tint_symbol_1; + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl new file mode 100644 index 0000000000..2f0e920379 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl @@ -0,0 +1,21 @@ +struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array, 8>; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + s1.a1[uniforms.i][uniforms.j] = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.hlsl new file mode 100644 index 0000000000..6ebca2ea12 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +struct InnerS { + int v; +}; +struct OuterS { + InnerS a1[8][8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s1 = (OuterS)0; + { + InnerS tint_symbol_1[8][8] = s1.a1; + tint_symbol_1[uniforms[0].x][uniforms[0].y] = v; + s1.a1 = tint_symbol_1; + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl new file mode 100644 index 0000000000..2dfdfc80b1 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl @@ -0,0 +1,24 @@ +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + s2 : InnerS; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + s1.a1[uniforms.i].s2 = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.hlsl new file mode 100644 index 0000000000..24cee3d2d0 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.hlsl @@ -0,0 +1,25 @@ +struct InnerS { + int v; +}; +struct S1 { + InnerS s2; +}; +struct OuterS { + S1 a1[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s1 = (OuterS)0; + { + S1 tint_symbol_1[8] = s1.a1; + tint_symbol_1[uniforms[0].x].s2 = v; + s1.a1 = tint_symbol_1; + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl new file mode 100644 index 0000000000..c8d97e5f7d --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl @@ -0,0 +1,25 @@ +struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a2 : array; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s : OuterS; + s.a1[uniforms.i].a2[uniforms.j] = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.hlsl new file mode 100644 index 0000000000..f4113725bf --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.hlsl @@ -0,0 +1,28 @@ +struct InnerS { + int v; +}; +struct S1 { + InnerS a2[8]; +}; +struct OuterS { + S1 a1[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s = (OuterS)0; + { + S1 tint_symbol_1[8] = s.a1; + const uint tint_symbol_2_save = uniforms[0].x; + InnerS tint_symbol_3[8] = tint_symbol_1[tint_symbol_2_save].a2; + tint_symbol_3[uniforms[0].y] = v; + tint_symbol_1[tint_symbol_2_save].a2 = tint_symbol_3; + s.a1 = tint_symbol_1; + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl new file mode 100644 index 0000000000..99ad0f05b6 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl @@ -0,0 +1,20 @@ +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; +[[binding(0), group(0)]] var s1 : OuterS; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + s1.a1[uniforms.i] = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.hlsl new file mode 100644 index 0000000000..4ae06055e9 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.hlsl @@ -0,0 +1,19 @@ +struct InnerS { + int v; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; +RWByteAddressBuffer s1 : register(u0, space0); + +void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, InnerS value) { + buffer.Store((offset + 0u), asuint(value.v)); +} + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + tint_symbol_1(s1, (4u * uniforms[0].x), v); + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl new file mode 100644 index 0000000000..0d40e81c17 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl @@ -0,0 +1,25 @@ +struct Uniforms { + i : u32; + j : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a2 : array; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; +[[binding(0), group(0)]] var s : OuterS; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + s.a1[uniforms.i].a2[uniforms.j] = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.hlsl new file mode 100644 index 0000000000..222fd91b33 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.hlsl @@ -0,0 +1,19 @@ +struct InnerS { + int v; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; +RWByteAddressBuffer s : register(u0, space0); + +void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, InnerS value) { + buffer.Store((offset + 0u), asuint(value.v)); +} + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + tint_symbol_1(s, ((32u * uniforms[0].x) + (4u * uniforms[0].y)), v); + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl new file mode 100644 index 0000000000..3c67742466 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl @@ -0,0 +1,16 @@ +struct Uniforms { + i : u32; +}; + +struct OuterS { + m1 : mat2x4; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var s1 : OuterS; + s1.m1[uniforms.i] = vec4(1.0); + s1.m1[uniforms.i][uniforms.i] = 1.0; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.hlsl new file mode 100644 index 0000000000..819665dc43 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.hlsl @@ -0,0 +1,33 @@ +void set_vector_float2x4(inout float2x4 mat, int col, float4 val) { + switch (col) { + case 0: mat[0] = val; break; + case 1: mat[1] = val; break; + } +} + +void set_scalar_float2x4(inout float2x4 mat, int col, int row, float val) { + switch (col) { + case 0: + mat[0] = (row.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : mat[0]; + break; + case 1: + mat[1] = (row.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : mat[1]; + break; + } +} + +struct OuterS { + float2x4 m1; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + OuterS s1 = (OuterS)0; + set_vector_float2x4(s1.m1, uniforms[0].x, float4((1.0f).xxxx)); + set_scalar_float2x4(s1.m1, uniforms[0].x, uniforms[0].x, 1.0f); + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl new file mode 100644 index 0000000000..1fcd3975d9 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl @@ -0,0 +1,22 @@ +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; + a2 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + s1.a1[uniforms.i] = v; + s1.a2[uniforms.i] = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.hlsl new file mode 100644 index 0000000000..aa6d6bc26c --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.hlsl @@ -0,0 +1,28 @@ +struct InnerS { + int v; +}; +struct OuterS { + InnerS a1[8]; + InnerS a2[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s1 = (OuterS)0; + { + InnerS tint_symbol_1[8] = s1.a1; + tint_symbol_1[uniforms[0].x] = v; + s1.a1 = tint_symbol_1; + } + { + InnerS tint_symbol_3[8] = s1.a2; + tint_symbol_3[uniforms[0].x] = v; + s1.a2 = tint_symbol_3; + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl new file mode 100644 index 0000000000..bff1418116 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl @@ -0,0 +1,24 @@ +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct S1 { + a : array; +}; + +struct OuterS { + s2 : S1; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + s1.s2.a[uniforms.i] = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.hlsl new file mode 100644 index 0000000000..47f844cb55 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.hlsl @@ -0,0 +1,25 @@ +struct InnerS { + int v; +}; +struct S1 { + InnerS a[8]; +}; +struct OuterS { + S1 s2; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s1 = (OuterS)0; + { + InnerS tint_symbol_1[8] = s1.s2.a; + tint_symbol_1[uniforms[0].x] = v; + s1.s2.a = tint_symbol_1; + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl new file mode 100644 index 0000000000..578124ff90 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl @@ -0,0 +1,15 @@ +struct Uniforms { + i : u32; +}; + +struct OuterS { + v1 : vec3; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var s1 : OuterS; + s1.v1[uniforms.i] = 1.0; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl.expected.hlsl new file mode 100644 index 0000000000..dc3f4150c2 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl.expected.hlsl @@ -0,0 +1,18 @@ +void set_float3(inout float3 vec, int idx, float val) { + vec = (idx.xxx == int3(0, 1, 2)) ? val.xxx : vec; +} + +struct OuterS { + float3 v1; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + OuterS s1 = (OuterS)0; + set_float3(s1.v1, uniforms[0].x, 1.0f); + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl new file mode 100644 index 0000000000..c8b46c5014 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl @@ -0,0 +1,21 @@ +struct Uniforms { + i : u32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +fn f(i: u32) -> u32 { + return i + 1u; +} + +[[stage(compute), workgroup_size(1)]] +fn main() { + var s1 : OuterS; + var v : vec3; + v[s1.a1[uniforms.i]] = 1.0; + v[f(s1.a1[uniforms.i])] = 1.0; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.hlsl new file mode 100644 index 0000000000..a3509f9a7a --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +void set_float3(inout float3 vec, int idx, float val) { + vec = (idx.xxx == int3(0, 1, 2)) ? val.xxx : vec; +} + +struct OuterS { + uint a1[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +uint f(uint i) { + return (i + 1u); +} + +[numthreads(1, 1, 1)] +void main() { + OuterS s1 = (OuterS)0; + float3 v = float3(0.0f, 0.0f, 0.0f); + set_float3(v, s1.a1[uniforms[0].x], 1.0f); + set_float3(v, f(s1.a1[uniforms[0].x]), 1.0f); + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl new file mode 100644 index 0000000000..b44dcfa789 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl @@ -0,0 +1,21 @@ +struct Uniforms { + i : u32; +}; + +struct InnerS { + v : i32; +}; + +struct OuterS { + a1 : array; +}; + +[[group(1), binding(4)]] var uniforms : Uniforms; + +[[stage(compute), workgroup_size(1)]] +fn main() { + var v : InnerS; + var s1 : OuterS; + let p = &(s1.a1[uniforms.i]); + *p = v; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.hlsl new file mode 100644 index 0000000000..8cedd87bd3 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +struct InnerS { + int v; +}; +struct OuterS { + InnerS a1[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +[numthreads(1, 1, 1)] +void main() { + InnerS v = (InnerS)0; + OuterS s1 = (OuterS)0; + const uint p_save = uniforms[0].x; + { + InnerS tint_symbol_1[8] = s1.a1; + tint_symbol_1[p_save] = v; + s1.a1 = tint_symbol_1; + } + return; +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl b/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl new file mode 100644 index 0000000000..2391e14e66 --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl @@ -0,0 +1,21 @@ +struct Uniforms { + i : u32; +}; +struct InnerS { + v : i32; +}; +struct OuterS { + a1 : array; +}; +[[group(1), binding(4)]] var uniforms : Uniforms; + +fn f(p : ptr) { + var v : InnerS; + (*p).a1[uniforms.i] = v; +} + +[[stage(compute), workgroup_size(1)]] +fn main() { + var s1 : OuterS; + f(&s1); +} diff --git a/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.hlsl b/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.hlsl new file mode 100644 index 0000000000..bdaae4df4f --- /dev/null +++ b/test/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.hlsl @@ -0,0 +1,26 @@ +struct InnerS { + int v; +}; +struct OuterS { + InnerS a1[8]; +}; + +cbuffer cbuffer_uniforms : register(b4, space1) { + uint4 uniforms[1]; +}; + +void f(inout OuterS p) { + InnerS v = (InnerS)0; + { + InnerS tint_symbol_1[8] = p.a1; + tint_symbol_1[uniforms[0].x] = v; + p.a1 = tint_symbol_1; + } +} + +[numthreads(1, 1, 1)] +void main() { + OuterS s1 = (OuterS)0; + f(s1); + return; +} diff --git a/test/vk-gl-cts/graphicsfuzz/arr-value-set-to-arr-value-squared/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/arr-value-set-to-arr-value-squared/0-opt.spvasm.expected.hlsl deleted file mode 100644 index ff5204bd57..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/arr-value-set-to-arr-value-squared/0-opt.spvasm.expected.hlsl +++ /dev/null @@ -1,165 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_30 : register(b0, space0) { - uint4 x_30[1]; -}; - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_92 = i; - const int x_94 = obj.numbers[x_92]; - temp = x_94; - const int x_95 = i; - const int x_96 = j; - const int x_98 = obj.numbers[x_96]; - obj.numbers[x_95] = x_98; - const int x_100 = j; - obj.numbers[x_100] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_104 = h; - const int x_106 = obj.numbers[x_104]; - pivot = x_106; - const int x_107 = l; - i_1 = (x_107 - 1); - const int x_109 = l; - j_1 = x_109; - [loop] while (true) { - const int x_114 = j_1; - const int x_115 = h; - if ((x_114 <= (x_115 - 1))) { - } else { - break; - } - const int x_121 = obj.numbers[j_1]; - if ((x_121 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_135 = h; - param_3 = x_135; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_141 = (top + 1); - top = x_141; - stack[x_141] = l_1; - const int x_145 = (top + 1); - top = x_145; - stack[x_145] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_155 = top; - top = (x_155 - 1); - const int x_158 = stack[x_155]; - h_1 = x_158; - const int x_159 = top; - top = (x_159 - 1); - const int x_162 = stack[x_159]; - l_1 = x_162; - param_4 = l_1; - param_5 = h_1; - const int x_165 = performPartition_i1_i1_(param_4, param_5); - p = x_165; - if (((p - 1) > l_1)) { - const int x_173 = (top + 1); - top = x_173; - stack[x_173] = l_1; - const int x_177 = (top + 1); - top = x_177; - stack[x_177] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_188 = (top + 1); - top = x_188; - stack[x_188] = (p + 1); - const int x_193 = (top + 1); - top = x_193; - stack[x_193] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_71 = i_2; - const int x_74 = obj.numbers[i_2]; - const int x_77 = obj.numbers[i_2]; - obj.numbers[x_71] = (x_74 * x_77); - } - } - quicksort_(); - const int x_84 = obj.numbers[0]; - const int x_86 = obj.numbers[4]; - if ((x_84 < x_86)) { - x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f); - } else { - x_GLF_color = float4(0.0f, 1.0f, 0.0f, 1.0f); - } - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_1 = {x_GLF_color}; - return tint_symbol_1; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x00000246B5D89100(124,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x00000246B5D89100(123,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/arr-value-set-to-arr-value-squared/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/arr-value-set-to-arr-value-squared/0-opt.wgsl.expected.hlsl deleted file mode 100644 index e0e6c28f3e..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/arr-value-set-to-arr-value-squared/0-opt.wgsl.expected.hlsl +++ /dev/null @@ -1,165 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_30 : register(b0, space0) { - uint4 x_30[1]; -}; - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_92 = i; - const int x_94 = obj.numbers[x_92]; - temp = x_94; - const int x_95 = i; - const int x_96 = j; - const int x_98 = obj.numbers[x_96]; - obj.numbers[x_95] = x_98; - const int x_100 = j; - obj.numbers[x_100] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_104 = h; - const int x_106 = obj.numbers[x_104]; - pivot = x_106; - const int x_107 = l; - i_1 = (x_107 - 1); - const int x_109 = l; - j_1 = x_109; - [loop] while (true) { - const int x_114 = j_1; - const int x_115 = h; - if ((x_114 <= (x_115 - 1))) { - } else { - break; - } - const int x_121 = obj.numbers[j_1]; - if ((x_121 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_135 = h; - param_3 = x_135; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_141 = (top + 1); - top = x_141; - stack[x_141] = l_1; - const int x_145 = (top + 1); - top = x_145; - stack[x_145] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_155 = top; - top = (x_155 - 1); - const int x_158 = stack[x_155]; - h_1 = x_158; - const int x_159 = top; - top = (x_159 - 1); - const int x_162 = stack[x_159]; - l_1 = x_162; - param_4 = l_1; - param_5 = h_1; - const int x_165 = performPartition_i1_i1_(param_4, param_5); - p = x_165; - if (((p - 1) > l_1)) { - const int x_173 = (top + 1); - top = x_173; - stack[x_173] = l_1; - const int x_177 = (top + 1); - top = x_177; - stack[x_177] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_188 = (top + 1); - top = x_188; - stack[x_188] = (p + 1); - const int x_193 = (top + 1); - top = x_193; - stack[x_193] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_71 = i_2; - const int x_74 = obj.numbers[i_2]; - const int x_77 = obj.numbers[i_2]; - obj.numbers[x_71] = (x_74 * x_77); - } - } - quicksort_(); - const int x_84 = obj.numbers[0]; - const int x_86 = obj.numbers[4]; - if ((x_84 < x_86)) { - x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f); - } else { - x_GLF_color = float4(0.0f, 1.0f, 0.0f, 1.0f); - } - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_1 = {x_GLF_color}; - return tint_symbol_1; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x000001BEDA24CD50(124,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000001BEDA24CD50(123,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.spvasm.expected.hlsl index 206ce4b78c..9de3ba3488 100755 --- a/test/vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.spvasm.expected.hlsl @@ -37,5 +37,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x000001F6BB717E80(9,19-22): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\ull0.0:31: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.wgsl.expected.hlsl index cc278fa799..139e7dc8d3 100755 --- a/test/vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.wgsl.expected.hlsl @@ -1,6 +1,6 @@ SKIP: FAILED -vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.wgsl:16:5 warning: code is unreachable +vk-gl-cts/graphicsfuzz/color-set-in-for-loop/0-opt.wgsl:15:5 warning: code is unreachable return; ^^^^^^ @@ -40,5 +40,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x00000141CAFC4AB0(9,19-22): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\u1hm0.0:31: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/cov-copy-prop-arrays-no-stores/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/cov-copy-prop-arrays-no-stores/0-opt.spvasm.expected.hlsl deleted file mode 100644 index be9d33fa00..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/cov-copy-prop-arrays-no-stores/0-opt.spvasm.expected.hlsl +++ /dev/null @@ -1,49 +0,0 @@ -SKIP: FAILED - -struct Array { - int values[2]; -}; - -cbuffer cbuffer_x_7 : register(b0, space0) { - uint4 x_7[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void main_1() { - Array a = (Array)0; - Array b = (Array)0; - float one = 0.0f; - const int x_10 = asint(x_7[0].x); - a.values[x_10] = 1; - b = a; - one = 0.0f; - const int x_11 = asint(x_7[0].x); - const int x_12 = b.values[x_11]; - if ((x_12 == 1)) { - one = 1.0f; - } - x_GLF_color = float4(one, 0.0f, 0.0f, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_2 = {x_GLF_color}; - return tint_symbol_2; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x0000026DA3D26220(15,3-16): error X3500: array reference cannot be used as an l-value; not natively addressable - diff --git a/test/vk-gl-cts/graphicsfuzz/cov-copy-prop-arrays-no-stores/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/cov-copy-prop-arrays-no-stores/0-opt.wgsl.expected.hlsl deleted file mode 100644 index db056c7cc5..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/cov-copy-prop-arrays-no-stores/0-opt.wgsl.expected.hlsl +++ /dev/null @@ -1,49 +0,0 @@ -SKIP: FAILED - -struct Array { - int values[2]; -}; - -cbuffer cbuffer_x_7 : register(b0, space0) { - uint4 x_7[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void main_1() { - Array a = (Array)0; - Array b = (Array)0; - float one = 0.0f; - const int x_10 = asint(x_7[0].x); - a.values[x_10] = 1; - b = a; - one = 0.0f; - const int x_11 = asint(x_7[0].x); - const int x_12 = b.values[x_11]; - if ((x_12 == 1)) { - one = 1.0f; - } - x_GLF_color = float4(one, 0.0f, 0.0f, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_2 = {x_GLF_color}; - return tint_symbol_2; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x0000024C52B7BDB0(15,3-16): error X3500: array reference cannot be used as an l-value; not natively addressable - diff --git a/test/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.spvasm.expected.hlsl index 281f92da41..fbd491a865 100755 --- a/test/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.spvasm.expected.hlsl @@ -82,18 +82,9 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(15,8-20): warning X3556: integer modulus may be much slower, try using uints if possible. -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x000001BF7F9DDFF0(24,25-28): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\u1jmg.0:77: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.wgsl.expected.hlsl index a4a3eae425..8eaa7c8afb 100755 --- a/test/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.wgsl.expected.hlsl @@ -82,18 +82,9 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x0000012C749BFE70(15,8-20): warning X3556: integer modulus may be much slower, try using uints if possible. -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000012C749BFE70(24,18-29): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000012C749BFE70(24,25-28): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\u1v1c.0:77: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/cov-struct-float-array-mix-uniform-vectors/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/cov-struct-float-array-mix-uniform-vectors/0-opt.spvasm.expected.hlsl deleted file mode 100644 index f9ef66b7c4..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/cov-struct-float-array-mix-uniform-vectors/0-opt.spvasm.expected.hlsl +++ /dev/null @@ -1,94 +0,0 @@ -SKIP: FAILED - -struct S { - float numbers[3]; -}; - -cbuffer cbuffer_x_7 : register(b1, space0) { - uint4 x_7[5]; -}; -cbuffer cbuffer_x_9 : register(b2, space0) { - uint4 x_9[1]; -}; -cbuffer cbuffer_x_12 : register(b3, space0) { - uint4 x_12[1]; -}; -cbuffer cbuffer_x_15 : register(b0, space0) { - uint4 x_15[2]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void main_1() { - S obj = (S)0; - float a = 0.0f; - float2 x_49 = float2(0.0f, 0.0f); - float b = 0.0f; - const float x_51 = asfloat(x_7[3].x); - const float x_53 = asfloat(x_7[2].x); - const float x_55 = asfloat(x_7[4].x); - const float tint_symbol_6[3] = {x_51, x_53, x_55}; - const S tint_symbol_7 = {tint_symbol_6}; - obj = tint_symbol_7; - const float x_59 = asfloat(x_9[0].x); - const uint scalar_offset = ((16u * uint(0))) / 4; - const float x_62 = asfloat(x_7[scalar_offset / 4][scalar_offset % 4]); - obj.numbers[int(x_59)] = x_62; - const float x_65 = asfloat(x_9[0].x); - const uint scalar_offset_1 = ((16u * uint(0))) / 4; - const float x_67 = asfloat(x_7[scalar_offset_1 / 4][scalar_offset_1 % 4]); - if ((x_65 > x_67)) { - const float2 x_73 = asfloat(x_9[0].xy); - x_49 = x_73; - } else { - const float2 x_75 = asfloat(x_12[0].xy); - x_49 = x_75; - } - const float x_77 = x_49.y; - a = x_77; - const uint scalar_offset_2 = ((16u * uint(0))) / 4; - const float x_79 = asfloat(x_7[scalar_offset_2 / 4][scalar_offset_2 % 4]); - const float x_80 = a; - const uint scalar_offset_3 = ((16u * uint(0))) / 4; - const int x_82 = asint(x_15[scalar_offset_3 / 4][scalar_offset_3 % 4]); - const float x_84 = obj.numbers[x_82]; - b = lerp(x_79, x_80, x_84); - const float x_86 = b; - const float x_88 = asfloat(x_7[2].x); - const float x_91 = asfloat(x_7[1].x); - if ((distance(x_86, x_88) < x_91)) { - const uint scalar_offset_4 = ((16u * uint(0))) / 4; - const int x_97 = asint(x_15[scalar_offset_4 / 4][scalar_offset_4 % 4]); - const int x_100 = asint(x_15[1].x); - const int x_103 = asint(x_15[1].x); - const uint scalar_offset_5 = ((16u * uint(0))) / 4; - const int x_106 = asint(x_15[scalar_offset_5 / 4][scalar_offset_5 % 4]); - x_GLF_color = float4(float(x_97), float(x_100), float(x_103), float(x_106)); - } else { - const int x_110 = asint(x_15[1].x); - const float x_111 = float(x_110); - x_GLF_color = float4(x_111, x_111, x_111, x_111); - } - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_8 = {x_GLF_color}; - return tint_symbol_8; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x0000018BDF85D170(33,3-24): error X3500: array reference cannot be used as an l-value; not natively addressable - diff --git a/test/vk-gl-cts/graphicsfuzz/cov-struct-float-array-mix-uniform-vectors/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/cov-struct-float-array-mix-uniform-vectors/0-opt.wgsl.expected.hlsl deleted file mode 100644 index 1457ead33b..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/cov-struct-float-array-mix-uniform-vectors/0-opt.wgsl.expected.hlsl +++ /dev/null @@ -1,94 +0,0 @@ -SKIP: FAILED - -struct S { - float numbers[3]; -}; - -cbuffer cbuffer_x_7 : register(b1, space0) { - uint4 x_7[5]; -}; -cbuffer cbuffer_x_9 : register(b2, space0) { - uint4 x_9[1]; -}; -cbuffer cbuffer_x_12 : register(b3, space0) { - uint4 x_12[1]; -}; -cbuffer cbuffer_x_15 : register(b0, space0) { - uint4 x_15[2]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void main_1() { - S obj = (S)0; - float a = 0.0f; - float2 x_49 = float2(0.0f, 0.0f); - float b = 0.0f; - const float x_51 = asfloat(x_7[3].x); - const float x_53 = asfloat(x_7[2].x); - const float x_55 = asfloat(x_7[4].x); - const float tint_symbol_6[3] = {x_51, x_53, x_55}; - const S tint_symbol_7 = {tint_symbol_6}; - obj = tint_symbol_7; - const float x_59 = asfloat(x_9[0].x); - const uint scalar_offset = ((16u * uint(0))) / 4; - const float x_62 = asfloat(x_7[scalar_offset / 4][scalar_offset % 4]); - obj.numbers[int(x_59)] = x_62; - const float x_65 = asfloat(x_9[0].x); - const uint scalar_offset_1 = ((16u * uint(0))) / 4; - const float x_67 = asfloat(x_7[scalar_offset_1 / 4][scalar_offset_1 % 4]); - if ((x_65 > x_67)) { - const float2 x_73 = asfloat(x_9[0].xy); - x_49 = x_73; - } else { - const float2 x_75 = asfloat(x_12[0].xy); - x_49 = x_75; - } - const float x_77 = x_49.y; - a = x_77; - const uint scalar_offset_2 = ((16u * uint(0))) / 4; - const float x_79 = asfloat(x_7[scalar_offset_2 / 4][scalar_offset_2 % 4]); - const float x_80 = a; - const uint scalar_offset_3 = ((16u * uint(0))) / 4; - const int x_82 = asint(x_15[scalar_offset_3 / 4][scalar_offset_3 % 4]); - const float x_84 = obj.numbers[x_82]; - b = lerp(x_79, x_80, x_84); - const float x_86 = b; - const float x_88 = asfloat(x_7[2].x); - const float x_91 = asfloat(x_7[1].x); - if ((distance(x_86, x_88) < x_91)) { - const uint scalar_offset_4 = ((16u * uint(0))) / 4; - const int x_97 = asint(x_15[scalar_offset_4 / 4][scalar_offset_4 % 4]); - const int x_100 = asint(x_15[1].x); - const int x_103 = asint(x_15[1].x); - const uint scalar_offset_5 = ((16u * uint(0))) / 4; - const int x_106 = asint(x_15[scalar_offset_5 / 4][scalar_offset_5 % 4]); - x_GLF_color = float4(float(x_97), float(x_100), float(x_103), float(x_106)); - } else { - const int x_110 = asint(x_15[1].x); - const float x_111 = float(x_110); - x_GLF_color = float4(x_111, x_111, x_111, x_111); - } - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_8 = {x_GLF_color}; - return tint_symbol_8; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x00000172CC1515F0(33,3-24): error X3500: array reference cannot be used as an l-value; not natively addressable - diff --git a/test/vk-gl-cts/graphicsfuzz/cov-tail-duplicator-infinite-loops/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/cov-tail-duplicator-infinite-loops/0-opt.spvasm.expected.hlsl index 7d321664e5..4317cbed87 100755 --- a/test/vk-gl-cts/graphicsfuzz/cov-tail-duplicator-infinite-loops/0-opt.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/cov-tail-duplicator-infinite-loops/0-opt.spvasm.expected.hlsl @@ -93,5 +93,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x000002502549E0E0(21,19-22): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\u1r54.0:88: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/cov-tail-duplicator-infinite-loops/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/cov-tail-duplicator-infinite-loops/0-opt.wgsl.expected.hlsl index c6eed98b10..4f9ecd68c1 100755 --- a/test/vk-gl-cts/graphicsfuzz/cov-tail-duplicator-infinite-loops/0-opt.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/cov-tail-duplicator-infinite-loops/0-opt.wgsl.expected.hlsl @@ -93,5 +93,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x000002497A3112E0(21,19-22): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\usgc.0:88: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/function-with-uniform-return/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/function-with-uniform-return/0-opt.spvasm.expected.hlsl index d1579f549a..232826e760 100755 --- a/test/vk-gl-cts/graphicsfuzz/function-with-uniform-return/0-opt.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/function-with-uniform-return/0-opt.spvasm.expected.hlsl @@ -67,5 +67,9 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x000001DE747F22A0(13,17-20): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\u17p0.0:62: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/function-with-uniform-return/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/function-with-uniform-return/0-opt.wgsl.expected.hlsl index e99e9c158c..52d72d68df 100755 --- a/test/vk-gl-cts/graphicsfuzz/function-with-uniform-return/0-opt.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/function-with-uniform-return/0-opt.wgsl.expected.hlsl @@ -67,5 +67,9 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x0000024AE2EDC600(13,17-20): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\uvqg.0:62: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/loops-ifs-continues-call/0.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/loops-ifs-continues-call/0.spvasm.expected.hlsl deleted file mode 100644 index 3b9109c84c..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/loops-ifs-continues-call/0.spvasm.expected.hlsl +++ /dev/null @@ -1,93 +0,0 @@ -SKIP: FAILED - -struct BinarySearchObject { - int prime_numbers[10]; -}; - -cbuffer cbuffer_x_8 : register(b0, space0) { - uint4 x_8[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -int binarySearch_struct_BinarySearchObject_i1_10_1_(inout BinarySearchObject obj) { - int m = 0; - [loop] while (true) { - const float x_91 = asfloat(x_8[0].x); - if ((x_91 > 1.0f)) { - } else { - break; - } - const float x_95 = asfloat(x_8[0].x); - m = int(x_95); - const int x_15 = obj.prime_numbers[m]; - if ((x_15 == 1)) { - return 1; - } - } - return 1; -} - -void main_1() { - int i = 0; - BinarySearchObject obj_1 = (BinarySearchObject)0; - BinarySearchObject param = (BinarySearchObject)0; - i = 0; - { - [loop] for(; (i < 10); i = (i + 1)) { - if ((i != 3)) { - const int x_18 = i; - const float x_67 = asfloat(x_8[0].x); - if (((x_18 - int(x_67)) == 4)) { - obj_1.prime_numbers[i] = 11; - } else { - if ((i == 6)) { - obj_1.prime_numbers[i] = 17; - } - continue; - } - } - [loop] while (true) { - { - const float x_82 = asfloat(x_8[0].y); - if ((0.0f > x_82)) { - } else { - break; - } - } - } - } - } - param = obj_1; - const int x_26 = binarySearch_struct_BinarySearchObject_i1_10_1_(param); - x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_2 = {x_GLF_color}; - return tint_symbol_2; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x0000016C5E617FA0(47,14-25): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000016C5E617FA0(47,14-25): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000016C5E617FA0(47,14-25): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000016C5E617FA0(47,14-25): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000016C5E617FA0(47,14-25): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000016C5E617FA0(47,14-25): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000016C5E617FA0(39,11-32): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x0000016C5E617FA0(34,12-39): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/loops-ifs-continues-call/0.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/loops-ifs-continues-call/0.wgsl.expected.hlsl deleted file mode 100644 index 3c9719c846..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/loops-ifs-continues-call/0.wgsl.expected.hlsl +++ /dev/null @@ -1,93 +0,0 @@ -SKIP: FAILED - -struct BinarySearchObject { - int prime_numbers[10]; -}; - -cbuffer cbuffer_x_8 : register(b0, space0) { - uint4 x_8[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -int binarySearch_struct_BinarySearchObject_i1_10_1_(inout BinarySearchObject obj) { - int m = 0; - [loop] while (true) { - const float x_91 = asfloat(x_8[0].x); - if ((x_91 > 1.0f)) { - } else { - break; - } - const float x_95 = asfloat(x_8[0].x); - m = int(x_95); - const int x_15 = obj.prime_numbers[m]; - if ((x_15 == 1)) { - return 1; - } - } - return 1; -} - -void main_1() { - int i = 0; - BinarySearchObject obj_1 = (BinarySearchObject)0; - BinarySearchObject param = (BinarySearchObject)0; - i = 0; - { - [loop] for(; (i < 10); i = (i + 1)) { - if ((i != 3)) { - const int x_18 = i; - const float x_67 = asfloat(x_8[0].x); - if (((x_18 - int(x_67)) == 4)) { - obj_1.prime_numbers[i] = 11; - } else { - if ((i == 6)) { - obj_1.prime_numbers[i] = 17; - } - continue; - } - } - [loop] while (true) { - { - const float x_82 = asfloat(x_8[0].y); - if ((0.0f > x_82)) { - } else { - break; - } - } - } - } - } - param = obj_1; - const int x_26 = binarySearch_struct_BinarySearchObject_i1_10_1_(param); - x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_2 = {x_GLF_color}; - return tint_symbol_2; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x0000022E4AE186A0(47,14-25): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000022E4AE186A0(47,14-25): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000022E4AE186A0(47,14-25): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000022E4AE186A0(47,14-25): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000022E4AE186A0(47,14-25): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x0000022E4AE186A0(47,14-25): warning X3551: infinite loop detected - loop writes no values -C:\src\tint\test\Shader@0x0000022E4AE186A0(39,11-32): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x0000022E4AE186A0(34,12-39): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/returned-boolean-in-vector/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/returned-boolean-in-vector/0-opt.spvasm.expected.hlsl index 9c26cbbe90..7dc5ef7f96 100755 --- a/test/vk-gl-cts/graphicsfuzz/returned-boolean-in-vector/0-opt.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/returned-boolean-in-vector/0-opt.spvasm.expected.hlsl @@ -115,3 +115,5 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } +Internal compiler error: access violation. Attempted to read from address 0x0000000000000048 + diff --git a/test/vk-gl-cts/graphicsfuzz/returned-boolean-in-vector/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/returned-boolean-in-vector/0-opt.wgsl.expected.hlsl index 9c26cbbe90..7dc5ef7f96 100755 --- a/test/vk-gl-cts/graphicsfuzz/returned-boolean-in-vector/0-opt.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/returned-boolean-in-vector/0-opt.wgsl.expected.hlsl @@ -115,3 +115,5 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } +Internal compiler error: access violation. Attempted to read from address 0x0000000000000048 + diff --git a/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-dontinline/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-dontinline/0-opt.spvasm.expected.hlsl deleted file mode 100644 index cd7206ed15..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-dontinline/0-opt.spvasm.expected.hlsl +++ /dev/null @@ -1,224 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_32 : register(b0, space0) { - uint4 x_32[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_225 = i; - const int x_227 = obj.numbers[x_225]; - temp = x_227; - const int x_228 = i; - const int x_229 = j; - const int x_231 = obj.numbers[x_229]; - obj.numbers[x_228] = x_231; - const int x_233 = j; - obj.numbers[x_233] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_237 = h; - const int x_239 = obj.numbers[x_237]; - pivot = x_239; - const int x_240 = l; - i_1 = (x_240 - 1); - const int x_242 = l; - j_1 = x_242; - [loop] while (true) { - const int x_247 = j_1; - const int x_248 = h; - if ((x_247 <= (x_248 - 1))) { - } else { - break; - } - const int x_254 = obj.numbers[j_1]; - if ((x_254 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - i_1 = (i_1 + 1); - param_2 = i_1; - const int x_269 = h; - param_3 = x_269; - swap_i1_i1_(param_2, param_3); - return i_1; -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_274 = (top + 1); - top = x_274; - stack[x_274] = l_1; - const int x_278 = (top + 1); - top = x_278; - stack[x_278] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_288 = top; - top = (x_288 - 1); - const int x_291 = stack[x_288]; - h_1 = x_291; - const int x_292 = top; - top = (x_292 - 1); - const int x_295 = stack[x_292]; - l_1 = x_295; - param_4 = l_1; - param_5 = h_1; - const int x_298 = performPartition_i1_i1_(param_4, param_5); - p = x_298; - if (((p - 1) > l_1)) { - const int x_306 = (top + 1); - top = x_306; - stack[x_306] = l_1; - const int x_310 = (top + 1); - top = x_310; - stack[x_310] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_321 = (top + 1); - top = x_321; - stack[x_321] = (p + 1); - const int x_326 = (top + 1); - top = x_326; - stack[x_326] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_92 = i_2; - const int x_95 = obj.numbers[i_2]; - const int x_98 = obj.numbers[i_2]; - obj.numbers[x_92] = (x_95 * x_98); - } - } - quicksort_(); - const float4 x_104 = gl_FragCoord; - const float2 x_107 = asfloat(x_32[0].xy); - uv = (float2(x_104.x, x_104.y) / x_107); - color = float3(1.0f, 2.0f, 3.0f); - const int x_110 = obj.numbers[0]; - const float x_113 = color.x; - color.x = (x_113 + float(x_110)); - const float x_117 = uv.x; - if ((x_117 > 0.25f)) { - const int x_122 = obj.numbers[1]; - const float x_125 = color.x; - color.x = (x_125 + float(x_122)); - } - const float x_129 = uv.x; - if ((x_129 > 0.5f)) { - const int x_134 = obj.numbers[2]; - const float x_137 = color.y; - color.y = (x_137 + float(x_134)); - } - const float x_141 = uv.x; - if ((x_141 > 0.75f)) { - const int x_146 = obj.numbers[3]; - const float x_149 = color.z; - color.z = (x_149 + float(x_146)); - } - const int x_153 = obj.numbers[4]; - const float x_156 = color.y; - color.y = (x_156 + float(x_153)); - const float x_160 = uv.y; - if ((x_160 > 0.25f)) { - const int x_165 = obj.numbers[5]; - const float x_168 = color.x; - color.x = (x_168 + float(x_165)); - } - const float x_172 = uv.y; - if ((x_172 > 0.5f)) { - const int x_177 = obj.numbers[6]; - const float x_180 = color.y; - color.y = (x_180 + float(x_177)); - } - const float x_184 = uv.y; - if ((x_184 > 0.75f)) { - const int x_189 = obj.numbers[7]; - const float x_192 = color.z; - color.z = (x_192 + float(x_189)); - } - const int x_196 = obj.numbers[8]; - const float x_199 = color.z; - color.z = (x_199 + float(x_196)); - const float x_203 = uv.x; - const float x_205 = uv.y; - if ((abs((x_203 - x_205)) < 0.25f)) { - const int x_212 = obj.numbers[9]; - const float x_215 = color.x; - color.x = (x_215 + float(x_212)); - } - const float3 x_219 = normalize(color); - x_GLF_color = float4(x_219.x, x_219.y, x_219.z, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol_1 { - float4 gl_FragCoord_param : SV_Position; -}; -struct tint_symbol_2 { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner(float4 gl_FragCoord_param) { - gl_FragCoord = gl_FragCoord_param; - main_1(); - const main_out tint_symbol_4 = {x_GLF_color}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x000001609F0E92A0(128,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000001609F0E92A0(127,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-dontinline/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-dontinline/0-opt.wgsl.expected.hlsl deleted file mode 100644 index 0f29d11ac9..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-dontinline/0-opt.wgsl.expected.hlsl +++ /dev/null @@ -1,224 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_32 : register(b0, space0) { - uint4 x_32[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_225 = i; - const int x_227 = obj.numbers[x_225]; - temp = x_227; - const int x_228 = i; - const int x_229 = j; - const int x_231 = obj.numbers[x_229]; - obj.numbers[x_228] = x_231; - const int x_233 = j; - obj.numbers[x_233] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_237 = h; - const int x_239 = obj.numbers[x_237]; - pivot = x_239; - const int x_240 = l; - i_1 = (x_240 - 1); - const int x_242 = l; - j_1 = x_242; - [loop] while (true) { - const int x_247 = j_1; - const int x_248 = h; - if ((x_247 <= (x_248 - 1))) { - } else { - break; - } - const int x_254 = obj.numbers[j_1]; - if ((x_254 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - i_1 = (i_1 + 1); - param_2 = i_1; - const int x_269 = h; - param_3 = x_269; - swap_i1_i1_(param_2, param_3); - return i_1; -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_274 = (top + 1); - top = x_274; - stack[x_274] = l_1; - const int x_278 = (top + 1); - top = x_278; - stack[x_278] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_288 = top; - top = (x_288 - 1); - const int x_291 = stack[x_288]; - h_1 = x_291; - const int x_292 = top; - top = (x_292 - 1); - const int x_295 = stack[x_292]; - l_1 = x_295; - param_4 = l_1; - param_5 = h_1; - const int x_298 = performPartition_i1_i1_(param_4, param_5); - p = x_298; - if (((p - 1) > l_1)) { - const int x_306 = (top + 1); - top = x_306; - stack[x_306] = l_1; - const int x_310 = (top + 1); - top = x_310; - stack[x_310] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_321 = (top + 1); - top = x_321; - stack[x_321] = (p + 1); - const int x_326 = (top + 1); - top = x_326; - stack[x_326] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_92 = i_2; - const int x_95 = obj.numbers[i_2]; - const int x_98 = obj.numbers[i_2]; - obj.numbers[x_92] = (x_95 * x_98); - } - } - quicksort_(); - const float4 x_104 = gl_FragCoord; - const float2 x_107 = asfloat(x_32[0].xy); - uv = (float2(x_104.x, x_104.y) / x_107); - color = float3(1.0f, 2.0f, 3.0f); - const int x_110 = obj.numbers[0]; - const float x_113 = color.x; - color.x = (x_113 + float(x_110)); - const float x_117 = uv.x; - if ((x_117 > 0.25f)) { - const int x_122 = obj.numbers[1]; - const float x_125 = color.x; - color.x = (x_125 + float(x_122)); - } - const float x_129 = uv.x; - if ((x_129 > 0.5f)) { - const int x_134 = obj.numbers[2]; - const float x_137 = color.y; - color.y = (x_137 + float(x_134)); - } - const float x_141 = uv.x; - if ((x_141 > 0.75f)) { - const int x_146 = obj.numbers[3]; - const float x_149 = color.z; - color.z = (x_149 + float(x_146)); - } - const int x_153 = obj.numbers[4]; - const float x_156 = color.y; - color.y = (x_156 + float(x_153)); - const float x_160 = uv.y; - if ((x_160 > 0.25f)) { - const int x_165 = obj.numbers[5]; - const float x_168 = color.x; - color.x = (x_168 + float(x_165)); - } - const float x_172 = uv.y; - if ((x_172 > 0.5f)) { - const int x_177 = obj.numbers[6]; - const float x_180 = color.y; - color.y = (x_180 + float(x_177)); - } - const float x_184 = uv.y; - if ((x_184 > 0.75f)) { - const int x_189 = obj.numbers[7]; - const float x_192 = color.z; - color.z = (x_192 + float(x_189)); - } - const int x_196 = obj.numbers[8]; - const float x_199 = color.z; - color.z = (x_199 + float(x_196)); - const float x_203 = uv.x; - const float x_205 = uv.y; - if ((abs((x_203 - x_205)) < 0.25f)) { - const int x_212 = obj.numbers[9]; - const float x_215 = color.x; - color.x = (x_215 + float(x_212)); - } - const float3 x_219 = normalize(color); - x_GLF_color = float4(x_219.x, x_219.y, x_219.z, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol_1 { - float4 gl_FragCoord_param : SV_Position; -}; -struct tint_symbol_2 { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner(float4 gl_FragCoord_param) { - gl_FragCoord = gl_FragCoord_param; - main_1(); - const main_out tint_symbol_4 = {x_GLF_color}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x00000219A1C1C120(128,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x00000219A1C1C120(127,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-mat-func-param/1.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-mat-func-param/1.spvasm.expected.hlsl deleted file mode 100644 index fb3266e98a..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-mat-func-param/1.spvasm.expected.hlsl +++ /dev/null @@ -1,224 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_32 : register(b0, space0) { - uint4 x_32[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j, float3x3 x_228) { - int temp = 0; - const int x_230 = i; - const int x_232 = obj.numbers[x_230]; - temp = x_232; - const int x_233 = i; - const int x_234 = j; - const int x_236 = obj.numbers[x_234]; - obj.numbers[x_233] = x_236; - const int x_238 = j; - obj.numbers[x_238] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_242 = h; - const int x_244 = obj.numbers[x_242]; - pivot = x_244; - const int x_245 = l; - i_1 = (x_245 - 1); - const int x_247 = l; - j_1 = x_247; - [loop] while (true) { - const int x_252 = j_1; - const int x_253 = h; - if ((x_252 <= (x_253 - 1))) { - } else { - break; - } - const int x_259 = obj.numbers[j_1]; - if ((x_259 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1, float3x3(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f))); - } - { - j_1 = (j_1 + 1); - } - } - i_1 = (i_1 + 1); - param_2 = i_1; - const int x_274 = h; - param_3 = x_274; - swap_i1_i1_(param_2, param_3, float3x3(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f))); - return i_1; -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_279 = (top + 1); - top = x_279; - stack[x_279] = l_1; - const int x_283 = (top + 1); - top = x_283; - stack[x_283] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_293 = top; - top = (x_293 - 1); - const int x_296 = stack[x_293]; - h_1 = x_296; - const int x_297 = top; - top = (x_297 - 1); - const int x_300 = stack[x_297]; - l_1 = x_300; - param_4 = l_1; - param_5 = h_1; - const int x_303 = performPartition_i1_i1_(param_4, param_5); - p = x_303; - if (((p - 1) > l_1)) { - const int x_311 = (top + 1); - top = x_311; - stack[x_311] = l_1; - const int x_315 = (top + 1); - top = x_315; - stack[x_315] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_326 = (top + 1); - top = x_326; - stack[x_326] = (p + 1); - const int x_331 = (top + 1); - top = x_331; - stack[x_331] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_96 = i_2; - const int x_99 = obj.numbers[i_2]; - const int x_102 = obj.numbers[i_2]; - obj.numbers[x_96] = (x_99 * x_102); - } - } - quicksort_(); - const float4 x_108 = gl_FragCoord; - const float2 x_111 = asfloat(x_32[0].xy); - uv = (float2(x_108.x, x_108.y) / x_111); - color = float3(1.0f, 2.0f, 3.0f); - const int x_114 = obj.numbers[0]; - const float x_117 = color.x; - color.x = (x_117 + float(x_114)); - const float x_121 = uv.x; - if ((x_121 > 0.25f)) { - const int x_126 = obj.numbers[1]; - const float x_129 = color.x; - color.x = (x_129 + float(x_126)); - } - const float x_133 = uv.x; - if ((x_133 > 0.5f)) { - const int x_138 = obj.numbers[2]; - const float x_141 = color.y; - color.y = (x_141 + float(x_138)); - } - const float x_145 = uv.x; - if ((x_145 > 0.75f)) { - const int x_150 = obj.numbers[3]; - const float x_153 = color.z; - color.z = (x_153 + float(x_150)); - } - const int x_157 = obj.numbers[4]; - const float x_160 = color.y; - color.y = (x_160 + float(x_157)); - const float x_164 = uv.y; - if ((x_164 > 0.25f)) { - const int x_169 = obj.numbers[5]; - const float x_172 = color.x; - color.x = (x_172 + float(x_169)); - } - const float x_176 = uv.y; - if ((x_176 > 0.5f)) { - const int x_181 = obj.numbers[6]; - const float x_184 = color.y; - color.y = (x_184 + float(x_181)); - } - const float x_188 = uv.y; - if ((x_188 > 0.75f)) { - const int x_193 = obj.numbers[7]; - const float x_196 = color.z; - color.z = (x_196 + float(x_193)); - } - const int x_200 = obj.numbers[8]; - const float x_203 = color.z; - color.z = (x_203 + float(x_200)); - const float x_207 = uv.x; - const float x_209 = uv.y; - if ((abs((x_207 - x_209)) < 0.25f)) { - const int x_216 = obj.numbers[9]; - const float x_219 = color.x; - color.x = (x_219 + float(x_216)); - } - const float3 x_223 = normalize(color); - x_GLF_color = float4(x_223.x, x_223.y, x_223.z, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol_1 { - float4 gl_FragCoord_param : SV_Position; -}; -struct tint_symbol_2 { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner(float4 gl_FragCoord_param) { - gl_FragCoord = gl_FragCoord_param; - main_1(); - const main_out tint_symbol_4 = {x_GLF_color}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x0000029339D00EC0(128,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x0000029339D00EC0(127,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-mat-func-param/1.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-mat-func-param/1.wgsl.expected.hlsl deleted file mode 100644 index f7856693d5..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/spv-stable-quicksort-mat-func-param/1.wgsl.expected.hlsl +++ /dev/null @@ -1,224 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_32 : register(b0, space0) { - uint4 x_32[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j, float3x3 x_228) { - int temp = 0; - const int x_230 = i; - const int x_232 = obj.numbers[x_230]; - temp = x_232; - const int x_233 = i; - const int x_234 = j; - const int x_236 = obj.numbers[x_234]; - obj.numbers[x_233] = x_236; - const int x_238 = j; - obj.numbers[x_238] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_242 = h; - const int x_244 = obj.numbers[x_242]; - pivot = x_244; - const int x_245 = l; - i_1 = (x_245 - 1); - const int x_247 = l; - j_1 = x_247; - [loop] while (true) { - const int x_252 = j_1; - const int x_253 = h; - if ((x_252 <= (x_253 - 1))) { - } else { - break; - } - const int x_259 = obj.numbers[j_1]; - if ((x_259 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1, float3x3(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f))); - } - { - j_1 = (j_1 + 1); - } - } - i_1 = (i_1 + 1); - param_2 = i_1; - const int x_274 = h; - param_3 = x_274; - swap_i1_i1_(param_2, param_3, float3x3(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f))); - return i_1; -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_279 = (top + 1); - top = x_279; - stack[x_279] = l_1; - const int x_283 = (top + 1); - top = x_283; - stack[x_283] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_293 = top; - top = (x_293 - 1); - const int x_296 = stack[x_293]; - h_1 = x_296; - const int x_297 = top; - top = (x_297 - 1); - const int x_300 = stack[x_297]; - l_1 = x_300; - param_4 = l_1; - param_5 = h_1; - const int x_303 = performPartition_i1_i1_(param_4, param_5); - p = x_303; - if (((p - 1) > l_1)) { - const int x_311 = (top + 1); - top = x_311; - stack[x_311] = l_1; - const int x_315 = (top + 1); - top = x_315; - stack[x_315] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_326 = (top + 1); - top = x_326; - stack[x_326] = (p + 1); - const int x_331 = (top + 1); - top = x_331; - stack[x_331] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_96 = i_2; - const int x_99 = obj.numbers[i_2]; - const int x_102 = obj.numbers[i_2]; - obj.numbers[x_96] = (x_99 * x_102); - } - } - quicksort_(); - const float4 x_108 = gl_FragCoord; - const float2 x_111 = asfloat(x_32[0].xy); - uv = (float2(x_108.x, x_108.y) / x_111); - color = float3(1.0f, 2.0f, 3.0f); - const int x_114 = obj.numbers[0]; - const float x_117 = color.x; - color.x = (x_117 + float(x_114)); - const float x_121 = uv.x; - if ((x_121 > 0.25f)) { - const int x_126 = obj.numbers[1]; - const float x_129 = color.x; - color.x = (x_129 + float(x_126)); - } - const float x_133 = uv.x; - if ((x_133 > 0.5f)) { - const int x_138 = obj.numbers[2]; - const float x_141 = color.y; - color.y = (x_141 + float(x_138)); - } - const float x_145 = uv.x; - if ((x_145 > 0.75f)) { - const int x_150 = obj.numbers[3]; - const float x_153 = color.z; - color.z = (x_153 + float(x_150)); - } - const int x_157 = obj.numbers[4]; - const float x_160 = color.y; - color.y = (x_160 + float(x_157)); - const float x_164 = uv.y; - if ((x_164 > 0.25f)) { - const int x_169 = obj.numbers[5]; - const float x_172 = color.x; - color.x = (x_172 + float(x_169)); - } - const float x_176 = uv.y; - if ((x_176 > 0.5f)) { - const int x_181 = obj.numbers[6]; - const float x_184 = color.y; - color.y = (x_184 + float(x_181)); - } - const float x_188 = uv.y; - if ((x_188 > 0.75f)) { - const int x_193 = obj.numbers[7]; - const float x_196 = color.z; - color.z = (x_196 + float(x_193)); - } - const int x_200 = obj.numbers[8]; - const float x_203 = color.z; - color.z = (x_203 + float(x_200)); - const float x_207 = uv.x; - const float x_209 = uv.y; - if ((abs((x_207 - x_209)) < 0.25f)) { - const int x_216 = obj.numbers[9]; - const float x_219 = color.x; - color.x = (x_219 + float(x_216)); - } - const float3 x_223 = normalize(color); - x_GLF_color = float4(x_223.x, x_223.y, x_223.z, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol_1 { - float4 gl_FragCoord_param : SV_Position; -}; -struct tint_symbol_2 { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner(float4 gl_FragCoord_param) { - gl_FragCoord = gl_FragCoord_param; - main_1(); - const main_out tint_symbol_4 = {x_GLF_color}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x000001F0DC256BE0(128,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000001F0DC256BE0(127,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.spvasm.expected.hlsl index 4a7eed3d2e..1626926b51 100755 --- a/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.spvasm.expected.hlsl @@ -1108,6 +1108,77 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x0000016CFDF12D00(123,5-17): warning X3557: loop only executes for 1 iteration(s), forcing loop to unroll -C:\src\tint\test\Shader@0x0000016CFDF12D00(54,27-30): error X3696: infinite loop detected - loop never exits +C:\src\temp\u1p00.0:147:5: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1p00.0:1033:20: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] + if ((x_570 == asint(x_574))) { + ~~~~~~^~~~~~~~~~~~~~~ +C:\src\temp\u1p00.0:1033:20: note: remove extraneous parentheses around the comparison to silence this warning + if ((x_570 == asint(x_574))) { + ~ ^ ~ +C:\src\temp\u1p00.0:1033:20: note: use '=' to turn this equality comparison into an assignment + if ((x_570 == asint(x_574))) { + ^~ + = +C:\src\temp\u1p00.0:1043:20: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] + if ((x_570 == asint(-1))) { + ~~~~~~^~~~~~~~~~~~ +C:\src\temp\u1p00.0:1043:20: note: remove extraneous parentheses around the comparison to silence this warning + if ((x_570 == asint(-1))) { + ~ ^ ~ +C:\src\temp\u1p00.0:1043:20: note: use '=' to turn this equality comparison into an assignment + if ((x_570 == asint(-1))) { + ^~ + = +C:\src\temp\u1p00.0:983:5: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1p00.0:1060:14: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] + if ((x_572 == asint(20))) { + ~~~~~~^~~~~~~~~~~~ +C:\src\temp\u1p00.0:1060:14: note: remove extraneous parentheses around the comparison to silence this warning + if ((x_572 == asint(20))) { + ~ ^ ~ +C:\src\temp\u1p00.0:1060:14: note: use '=' to turn this equality comparison into an assignment + if ((x_572 == asint(20))) { + ^~ + = +C:\src\temp\u1p00.0:27:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1p00.0:254:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1p00.0:356:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1p00.0:458:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1p00.0:560:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1p00.0:662:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1p00.0:764:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1p00.0:866:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +error: validation errors +C:\src\temp\u1p00.0:1085: error: Loop must have break. +C:\src\temp\u1p00.0:1085: error: Loop must have break. +C:\src\temp\u1p00.0:1085: error: Loop must have break. +C:\src\temp\u1p00.0:1085: error: Loop must have break. +C:\src\temp\u1p00.0:1085: error: Loop must have break. +C:\src\temp\u1p00.0:1085: error: Loop must have break. +C:\src\temp\u1p00.0:1085: error: Loop must have break. +C:\src\temp\u1p00.0:1085: error: Loop must have break. +C:\src\temp\u1p00.0:1085: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl.expected.hlsl index 0b0dee91f0..711e15f2f0 100755 --- a/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl.expected.hlsl @@ -1,74 +1,74 @@ SKIP: FAILED -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:61:15 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:60:15 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:99:11 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:98:11 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:171:17 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:170:17 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:209:13 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:208:13 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:268:15 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:267:15 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:306:11 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:305:11 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:359:15 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:358:15 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:397:11 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:396:11 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:450:15 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:449:15 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:488:11 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:487:11 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:541:15 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:540:15 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:579:11 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:578:11 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:632:15 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:631:15 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:670:11 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:669:11 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:723:15 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:722:15 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:761:11 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:760:11 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:814:15 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:813:15 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:852:11 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/1.wgsl:851:11 warning: code is unreachable return; ^^^^^^ @@ -1162,6 +1162,77 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x0000023795628100(123,5-17): warning X3557: loop only executes for 1 iteration(s), forcing loop to unroll -C:\src\tint\test\Shader@0x0000023795628100(54,27-30): error X3696: infinite loop detected - loop never exits +C:\src\temp\u1660.0:147:5: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1660.0:1033:20: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] + if ((x_570 == asint(x_574))) { + ~~~~~~^~~~~~~~~~~~~~~ +C:\src\temp\u1660.0:1033:20: note: remove extraneous parentheses around the comparison to silence this warning + if ((x_570 == asint(x_574))) { + ~ ^ ~ +C:\src\temp\u1660.0:1033:20: note: use '=' to turn this equality comparison into an assignment + if ((x_570 == asint(x_574))) { + ^~ + = +C:\src\temp\u1660.0:1043:20: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] + if ((x_570 == asint(-1))) { + ~~~~~~^~~~~~~~~~~~ +C:\src\temp\u1660.0:1043:20: note: remove extraneous parentheses around the comparison to silence this warning + if ((x_570 == asint(-1))) { + ~ ^ ~ +C:\src\temp\u1660.0:1043:20: note: use '=' to turn this equality comparison into an assignment + if ((x_570 == asint(-1))) { + ^~ + = +C:\src\temp\u1660.0:983:5: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1660.0:1060:14: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] + if ((x_572 == asint(20))) { + ~~~~~~^~~~~~~~~~~~ +C:\src\temp\u1660.0:1060:14: note: remove extraneous parentheses around the comparison to silence this warning + if ((x_572 == asint(20))) { + ~ ^ ~ +C:\src\temp\u1660.0:1060:14: note: use '=' to turn this equality comparison into an assignment + if ((x_572 == asint(20))) { + ^~ + = +C:\src\temp\u1660.0:27:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1660.0:254:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1660.0:356:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1660.0:458:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1660.0:560:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1660.0:662:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1660.0:764:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +C:\src\temp\u1660.0:866:3: warning: expression result unused [-Wunused-value] + 0u; + ^~ +error: validation errors +C:\src\temp\u1660.0:1085: error: Loop must have break. +C:\src\temp\u1660.0:1085: error: Loop must have break. +C:\src\temp\u1660.0:1085: error: Loop must have break. +C:\src\temp\u1660.0:1085: error: Loop must have break. +C:\src\temp\u1660.0:1085: error: Loop must have break. +C:\src\temp\u1660.0:1085: error: Loop must have break. +C:\src\temp\u1660.0:1085: error: Loop must have break. +C:\src\temp\u1660.0:1085: error: Loop must have break. +C:\src\temp\u1660.0:1085: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.spvasm.expected.hlsl index f2edc085ae..b1c2176fa3 100644 --- a/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.spvasm.expected.hlsl @@ -92,7 +92,11 @@ void insert_i1_i1_(inout int treeIndex, inout int data_1) { int identity_i1_(inout int a) { const int x_202 = a; const int x_203 = a; - obj.numbers[x_202] = x_203; + { + int tint_symbol_1[10] = obj.numbers; + tint_symbol_1[x_202] = x_203; + obj.numbers = tint_symbol_1; + } const int x_206 = obj.numbers[2]; return x_206; } @@ -264,22 +268,22 @@ void main_1() { struct main_out { float4 x_GLF_color_1; }; -struct tint_symbol { +struct tint_symbol_2 { float4 x_GLF_color_1 : SV_Target0; }; main_out main_inner() { main_1(); - const main_out tint_symbol_2 = {x_GLF_color}; - return tint_symbol_2; + const main_out tint_symbol_4 = {x_GLF_color}; + return tint_symbol_4; } -tint_symbol main() { +tint_symbol_2 main() { const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; + tint_symbol_2 wrapper_result = (tint_symbol_2)0; wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x000002117DDC0DA0(32,10-21): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] -C:\src\tint\test\Shader@0x000002117DDC0DA0(203,12-42): error X3531: can't unroll loops marked with loop attribute +C:\src\tint\test\Shader@0x0000019568397DE0(32,10-21): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] +internal error: compilation aborted unexpectedly diff --git a/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl.expected.hlsl index cb24484753..b75d35238e 100644 --- a/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl.expected.hlsl @@ -1,14 +1,14 @@ SKIP: FAILED -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl:71:7 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl:70:7 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl:94:7 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl:93:7 warning: code is unreachable return; ^^^^^^ -vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl:96:5 warning: code is unreachable +vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl:95:5 warning: code is unreachable return; ^^^^^^ @@ -101,7 +101,11 @@ void insert_i1_i1_(inout int treeIndex, inout int data_1) { int identity_i1_(inout int a) { const int x_202 = a; const int x_203 = a; - obj.numbers[x_202] = x_203; + { + int tint_symbol_1[10] = obj.numbers; + tint_symbol_1[x_202] = x_203; + obj.numbers = tint_symbol_1; + } const int x_206 = obj.numbers[2]; return x_206; } @@ -273,22 +277,22 @@ void main_1() { struct main_out { float4 x_GLF_color_1; }; -struct tint_symbol { +struct tint_symbol_2 { float4 x_GLF_color_1 : SV_Target0; }; main_out main_inner() { main_1(); - const main_out tint_symbol_2 = {x_GLF_color}; - return tint_symbol_2; + const main_out tint_symbol_4 = {x_GLF_color}; + return tint_symbol_4; } -tint_symbol main() { +tint_symbol_2 main() { const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; + tint_symbol_2 wrapper_result = (tint_symbol_2)0; wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x00000219E1FE81C0(32,10-21): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] -C:\src\tint\test\Shader@0x00000219E1FE81C0(203,12-42): error X3531: can't unroll loops marked with loop attribute +C:\src\tint\test\Shader@0x0000016D6EA06C40(32,10-21): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] +internal error: compilation aborted unexpectedly diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-conditional-bitwise-or-clamp/1.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-conditional-bitwise-or-clamp/1.spvasm.expected.hlsl deleted file mode 100644 index 49e137d975..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-conditional-bitwise-or-clamp/1.spvasm.expected.hlsl +++ /dev/null @@ -1,242 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b0, space0) { - uint4 x_34[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_230 = i; - const int x_232 = obj.numbers[x_230]; - temp = x_232; - const int x_233 = i; - const int x_234 = j; - const int x_236 = obj.numbers[x_234]; - obj.numbers[x_233] = x_236; - const int x_238 = j; - obj.numbers[x_238] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_242 = h; - const int x_244 = obj.numbers[x_242]; - pivot = x_244; - const int x_245 = l; - i_1 = (x_245 - 1); - const int x_247 = l; - j_1 = x_247; - [loop] while (true) { - const int x_252 = j_1; - const int x_253 = h; - if ((x_252 <= (x_253 - 1))) { - } else { - break; - } - const int x_259 = obj.numbers[j_1]; - if ((x_259 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - i_1 = (i_1 + 1); - param_2 = i_1; - const int x_274 = h; - param_3 = x_274; - swap_i1_i1_(param_2, param_3); - return i_1; -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int int_a = 0; - int x_278 = 0; - int x_279 = 0; - int clamp_a = 0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_281 = (top + 1); - top = x_281; - stack[x_281] = l_1; - const float x_285 = gl_FragCoord.y; - if ((x_285 >= 0.0f)) { - const int x_290 = h_1; - if (false) { - x_279 = 1; - } else { - x_279 = (h_1 << asuint(0)); - } - x_278 = (x_290 | x_279); - } else { - x_278 = 1; - } - int_a = x_278; - clamp_a = clamp(h_1, h_1, int_a); - const int x_304 = (top + 1); - top = x_304; - stack[x_304] = (clamp_a / 1); - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_315 = top; - top = (x_315 - 1); - const int x_318 = stack[x_315]; - h_1 = x_318; - const int x_319 = top; - top = (x_319 - 1); - const int x_322 = stack[x_319]; - l_1 = x_322; - param_4 = l_1; - param_5 = h_1; - const int x_325 = performPartition_i1_i1_(param_4, param_5); - p = x_325; - if (((p - 1) > l_1)) { - const int x_333 = (top + 1); - top = x_333; - stack[x_333] = l_1; - const int x_337 = (top + 1); - top = x_337; - stack[x_337] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_348 = (top + 1); - top = x_348; - stack[x_348] = (p + 1); - const int x_353 = (top + 1); - top = x_353; - stack[x_353] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_97 = i_2; - const int x_100 = obj.numbers[i_2]; - const int x_103 = obj.numbers[i_2]; - obj.numbers[x_97] = (x_100 * x_103); - } - } - quicksort_(); - const float4 x_109 = gl_FragCoord; - const float2 x_112 = asfloat(x_34[0].xy); - uv = (float2(x_109.x, x_109.y) / x_112); - color = float3(1.0f, 2.0f, 3.0f); - const int x_115 = obj.numbers[0]; - const float x_118 = color.x; - color.x = (x_118 + float(x_115)); - const float x_122 = uv.x; - if ((x_122 > 0.25f)) { - const int x_127 = obj.numbers[1]; - const float x_130 = color.x; - color.x = (x_130 + float(x_127)); - } - const float x_134 = uv.x; - if ((x_134 > 0.5f)) { - const int x_139 = obj.numbers[2]; - const float x_142 = color.y; - color.y = (x_142 + float(x_139)); - } - const float x_146 = uv.x; - if ((x_146 > 0.75f)) { - const int x_151 = obj.numbers[3]; - const float x_154 = color.z; - color.z = (x_154 + float(x_151)); - } - const int x_158 = obj.numbers[4]; - const float x_161 = color.y; - color.y = (x_161 + float(x_158)); - const float x_165 = uv.y; - if ((x_165 > 0.25f)) { - const int x_170 = obj.numbers[5]; - const float x_173 = color.x; - color.x = (x_173 + float(x_170)); - } - const float x_177 = uv.y; - if ((x_177 > 0.5f)) { - const int x_182 = obj.numbers[6]; - const float x_185 = color.y; - color.y = (x_185 + float(x_182)); - } - const float x_189 = uv.y; - if ((x_189 > 0.75f)) { - const int x_194 = obj.numbers[7]; - const float x_197 = color.z; - color.z = (x_197 + float(x_194)); - } - const int x_201 = obj.numbers[8]; - const float x_204 = color.z; - color.z = (x_204 + float(x_201)); - const float x_208 = uv.x; - const float x_210 = uv.y; - if ((abs((x_208 - x_210)) < 0.25f)) { - const int x_217 = obj.numbers[9]; - const float x_220 = color.x; - color.x = (x_220 + float(x_217)); - } - const float3 x_224 = normalize(color); - x_GLF_color = float4(x_224.x, x_224.y, x_224.z, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol_1 { - float4 gl_FragCoord_param : SV_Position; -}; -struct tint_symbol_2 { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner(float4 gl_FragCoord_param) { - gl_FragCoord = gl_FragCoord_param; - main_1(); - const main_out tint_symbol_4 = {x_GLF_color}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x00000240D57880E0(146,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x00000240D57880E0(145,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-conditional-bitwise-or-clamp/1.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-conditional-bitwise-or-clamp/1.wgsl.expected.hlsl deleted file mode 100644 index 013dea44db..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-conditional-bitwise-or-clamp/1.wgsl.expected.hlsl +++ /dev/null @@ -1,242 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b0, space0) { - uint4 x_34[1]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_230 = i; - const int x_232 = obj.numbers[x_230]; - temp = x_232; - const int x_233 = i; - const int x_234 = j; - const int x_236 = obj.numbers[x_234]; - obj.numbers[x_233] = x_236; - const int x_238 = j; - obj.numbers[x_238] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_242 = h; - const int x_244 = obj.numbers[x_242]; - pivot = x_244; - const int x_245 = l; - i_1 = (x_245 - 1); - const int x_247 = l; - j_1 = x_247; - [loop] while (true) { - const int x_252 = j_1; - const int x_253 = h; - if ((x_252 <= (x_253 - 1))) { - } else { - break; - } - const int x_259 = obj.numbers[j_1]; - if ((x_259 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - i_1 = (i_1 + 1); - param_2 = i_1; - const int x_274 = h; - param_3 = x_274; - swap_i1_i1_(param_2, param_3); - return i_1; -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int int_a = 0; - int x_278 = 0; - int x_279 = 0; - int clamp_a = 0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_281 = (top + 1); - top = x_281; - stack[x_281] = l_1; - const float x_285 = gl_FragCoord.y; - if ((x_285 >= 0.0f)) { - const int x_290 = h_1; - if (false) { - x_279 = 1; - } else { - x_279 = (h_1 << asuint(0)); - } - x_278 = (x_290 | x_279); - } else { - x_278 = 1; - } - int_a = x_278; - clamp_a = clamp(h_1, h_1, int_a); - const int x_304 = (top + 1); - top = x_304; - stack[x_304] = (clamp_a / 1); - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_315 = top; - top = (x_315 - 1); - const int x_318 = stack[x_315]; - h_1 = x_318; - const int x_319 = top; - top = (x_319 - 1); - const int x_322 = stack[x_319]; - l_1 = x_322; - param_4 = l_1; - param_5 = h_1; - const int x_325 = performPartition_i1_i1_(param_4, param_5); - p = x_325; - if (((p - 1) > l_1)) { - const int x_333 = (top + 1); - top = x_333; - stack[x_333] = l_1; - const int x_337 = (top + 1); - top = x_337; - stack[x_337] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_348 = (top + 1); - top = x_348; - stack[x_348] = (p + 1); - const int x_353 = (top + 1); - top = x_353; - stack[x_353] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_97 = i_2; - const int x_100 = obj.numbers[i_2]; - const int x_103 = obj.numbers[i_2]; - obj.numbers[x_97] = (x_100 * x_103); - } - } - quicksort_(); - const float4 x_109 = gl_FragCoord; - const float2 x_112 = asfloat(x_34[0].xy); - uv = (float2(x_109.x, x_109.y) / x_112); - color = float3(1.0f, 2.0f, 3.0f); - const int x_115 = obj.numbers[0]; - const float x_118 = color.x; - color.x = (x_118 + float(x_115)); - const float x_122 = uv.x; - if ((x_122 > 0.25f)) { - const int x_127 = obj.numbers[1]; - const float x_130 = color.x; - color.x = (x_130 + float(x_127)); - } - const float x_134 = uv.x; - if ((x_134 > 0.5f)) { - const int x_139 = obj.numbers[2]; - const float x_142 = color.y; - color.y = (x_142 + float(x_139)); - } - const float x_146 = uv.x; - if ((x_146 > 0.75f)) { - const int x_151 = obj.numbers[3]; - const float x_154 = color.z; - color.z = (x_154 + float(x_151)); - } - const int x_158 = obj.numbers[4]; - const float x_161 = color.y; - color.y = (x_161 + float(x_158)); - const float x_165 = uv.y; - if ((x_165 > 0.25f)) { - const int x_170 = obj.numbers[5]; - const float x_173 = color.x; - color.x = (x_173 + float(x_170)); - } - const float x_177 = uv.y; - if ((x_177 > 0.5f)) { - const int x_182 = obj.numbers[6]; - const float x_185 = color.y; - color.y = (x_185 + float(x_182)); - } - const float x_189 = uv.y; - if ((x_189 > 0.75f)) { - const int x_194 = obj.numbers[7]; - const float x_197 = color.z; - color.z = (x_197 + float(x_194)); - } - const int x_201 = obj.numbers[8]; - const float x_204 = color.z; - color.z = (x_204 + float(x_201)); - const float x_208 = uv.x; - const float x_210 = uv.y; - if ((abs((x_208 - x_210)) < 0.25f)) { - const int x_217 = obj.numbers[9]; - const float x_220 = color.x; - color.x = (x_220 + float(x_217)); - } - const float3 x_224 = normalize(color); - x_GLF_color = float4(x_224.x, x_224.y, x_224.z, 1.0f); - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol_1 { - float4 gl_FragCoord_param : SV_Position; -}; -struct tint_symbol_2 { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner(float4 gl_FragCoord_param) { - gl_FragCoord = gl_FragCoord_param; - main_1(); - const main_out tint_symbol_4 = {x_GLF_color}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} -C:\src\tint\test\Shader@0x000001EE8601E080(146,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000001EE8601E080(145,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/0-opt.spvasm.expected.hlsl deleted file mode 100644 index 68cfc73aec..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/0-opt.spvasm.expected.hlsl +++ /dev/null @@ -1,230 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b0, space0) { - uint4 x_34[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_239 = i; - const int x_241 = obj.numbers[x_239]; - temp = x_241; - const int x_242 = i; - const int x_243 = j; - const int x_245 = obj.numbers[x_243]; - obj.numbers[x_242] = x_245; - const int x_247 = j; - obj.numbers[x_247] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_251 = h; - const int x_253 = obj.numbers[x_251]; - pivot = x_253; - const int x_254 = l; - i_1 = (x_254 - 1); - const int x_256 = l; - j_1 = x_256; - [loop] while (true) { - const int x_261 = j_1; - const int x_262 = h; - if ((x_261 <= (x_262 - 1))) { - } else { - break; - } - const int x_268 = obj.numbers[j_1]; - if ((x_268 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_282 = h; - param_3 = x_282; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_288 = (top + 1); - top = x_288; - stack[x_288] = l_1; - const int x_292 = (top + 1); - top = x_292; - stack[x_292] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_302 = top; - top = (x_302 - 1); - const int x_305 = stack[x_302]; - h_1 = x_305; - const int x_306 = top; - top = (x_306 - 1); - const int x_309 = stack[x_306]; - l_1 = x_309; - param_4 = l_1; - param_5 = h_1; - const int x_312 = performPartition_i1_i1_(param_4, param_5); - p = x_312; - if (((p - 1) > l_1)) { - const int x_320 = (top + 1); - top = x_320; - stack[x_320] = l_1; - const int x_324 = (top + 1); - top = x_324; - stack[x_324] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_335 = (top + 1); - top = x_335; - stack[x_335] = (p + 1); - const int x_340 = (top + 1); - top = x_340; - stack[x_340] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_104 = i_2; - const int x_107 = obj.numbers[i_2]; - const int x_110 = obj.numbers[i_2]; - obj.numbers[x_104] = (x_107 * x_110); - } - } - quicksort_(); - const float4 x_116 = x_GLF_FragCoord; - const float2 x_119 = asfloat(x_34[0].xy); - uv = (float2(x_116.x, x_116.y) / x_119); - color = float3(1.0f, 2.0f, 3.0f); - const int x_122 = obj.numbers[0]; - const float x_125 = color.x; - color.x = (x_125 + float(x_122)); - const float x_129 = uv.x; - if ((x_129 > 0.25f)) { - const int x_134 = obj.numbers[1]; - const float x_137 = color.x; - color.x = (x_137 + float(x_134)); - } - const float x_141 = uv.x; - if ((x_141 > 0.5f)) { - const int x_146 = obj.numbers[2]; - const float x_149 = color.y; - color.y = (x_149 + float(x_146)); - } - const float x_153 = uv.x; - if ((x_153 > 0.75f)) { - const int x_158 = obj.numbers[3]; - const float x_161 = color.z; - color.z = (x_161 + float(x_158)); - } - const int x_165 = obj.numbers[4]; - const float x_168 = color.y; - color.y = (x_168 + float(x_165)); - const float x_172 = uv.y; - if ((x_172 > 0.25f)) { - const int x_177 = obj.numbers[5]; - const float x_180 = color.x; - color.x = (x_180 + float(x_177)); - } - const float x_184 = uv.y; - if ((x_184 > 0.5f)) { - const int x_189 = obj.numbers[6]; - const float x_192 = color.y; - color.y = (x_192 + float(x_189)); - } - const float x_196 = uv.y; - if ((x_196 > 0.75f)) { - const int x_201 = obj.numbers[7]; - const float x_204 = color.z; - color.z = (x_204 + float(x_201)); - } - const int x_208 = obj.numbers[8]; - const float x_211 = color.z; - color.z = (x_211 + float(x_208)); - const float x_215 = uv.x; - const float x_217 = uv.y; - if ((abs((x_215 - x_217)) < 0.25f)) { - const int x_224 = obj.numbers[9]; - const float x_227 = color.x; - color.x = (x_227 + float(x_224)); - } - const float3 x_231 = normalize(color); - frag_color = float4(x_231.x, x_231.y, x_231.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_4 = {frag_color, gl_Position}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} -C:\src\tint\test\Shader@0x000001E481EDD080(130,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000001E481EDD080(129,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/0-opt.wgsl.expected.hlsl deleted file mode 100644 index 21d9cc20ea..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/0-opt.wgsl.expected.hlsl +++ /dev/null @@ -1,230 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b0, space0) { - uint4 x_34[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_239 = i; - const int x_241 = obj.numbers[x_239]; - temp = x_241; - const int x_242 = i; - const int x_243 = j; - const int x_245 = obj.numbers[x_243]; - obj.numbers[x_242] = x_245; - const int x_247 = j; - obj.numbers[x_247] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_251 = h; - const int x_253 = obj.numbers[x_251]; - pivot = x_253; - const int x_254 = l; - i_1 = (x_254 - 1); - const int x_256 = l; - j_1 = x_256; - [loop] while (true) { - const int x_261 = j_1; - const int x_262 = h; - if ((x_261 <= (x_262 - 1))) { - } else { - break; - } - const int x_268 = obj.numbers[j_1]; - if ((x_268 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_282 = h; - param_3 = x_282; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_288 = (top + 1); - top = x_288; - stack[x_288] = l_1; - const int x_292 = (top + 1); - top = x_292; - stack[x_292] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_302 = top; - top = (x_302 - 1); - const int x_305 = stack[x_302]; - h_1 = x_305; - const int x_306 = top; - top = (x_306 - 1); - const int x_309 = stack[x_306]; - l_1 = x_309; - param_4 = l_1; - param_5 = h_1; - const int x_312 = performPartition_i1_i1_(param_4, param_5); - p = x_312; - if (((p - 1) > l_1)) { - const int x_320 = (top + 1); - top = x_320; - stack[x_320] = l_1; - const int x_324 = (top + 1); - top = x_324; - stack[x_324] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_335 = (top + 1); - top = x_335; - stack[x_335] = (p + 1); - const int x_340 = (top + 1); - top = x_340; - stack[x_340] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_104 = i_2; - const int x_107 = obj.numbers[i_2]; - const int x_110 = obj.numbers[i_2]; - obj.numbers[x_104] = (x_107 * x_110); - } - } - quicksort_(); - const float4 x_116 = x_GLF_FragCoord; - const float2 x_119 = asfloat(x_34[0].xy); - uv = (float2(x_116.x, x_116.y) / x_119); - color = float3(1.0f, 2.0f, 3.0f); - const int x_122 = obj.numbers[0]; - const float x_125 = color.x; - color.x = (x_125 + float(x_122)); - const float x_129 = uv.x; - if ((x_129 > 0.25f)) { - const int x_134 = obj.numbers[1]; - const float x_137 = color.x; - color.x = (x_137 + float(x_134)); - } - const float x_141 = uv.x; - if ((x_141 > 0.5f)) { - const int x_146 = obj.numbers[2]; - const float x_149 = color.y; - color.y = (x_149 + float(x_146)); - } - const float x_153 = uv.x; - if ((x_153 > 0.75f)) { - const int x_158 = obj.numbers[3]; - const float x_161 = color.z; - color.z = (x_161 + float(x_158)); - } - const int x_165 = obj.numbers[4]; - const float x_168 = color.y; - color.y = (x_168 + float(x_165)); - const float x_172 = uv.y; - if ((x_172 > 0.25f)) { - const int x_177 = obj.numbers[5]; - const float x_180 = color.x; - color.x = (x_180 + float(x_177)); - } - const float x_184 = uv.y; - if ((x_184 > 0.5f)) { - const int x_189 = obj.numbers[6]; - const float x_192 = color.y; - color.y = (x_192 + float(x_189)); - } - const float x_196 = uv.y; - if ((x_196 > 0.75f)) { - const int x_201 = obj.numbers[7]; - const float x_204 = color.z; - color.z = (x_204 + float(x_201)); - } - const int x_208 = obj.numbers[8]; - const float x_211 = color.z; - color.z = (x_211 + float(x_208)); - const float x_215 = uv.x; - const float x_217 = uv.y; - if ((abs((x_215 - x_217)) < 0.25f)) { - const int x_224 = obj.numbers[9]; - const float x_227 = color.x; - color.x = (x_227 + float(x_224)); - } - const float3 x_231 = normalize(color); - frag_color = float4(x_231.x, x_231.y, x_231.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_4 = {frag_color, gl_Position}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} -C:\src\tint\test\Shader@0x000001D05546D140(130,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000001D05546D140(129,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/2-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/2-opt.spvasm.expected.hlsl deleted file mode 100644 index dd028536ee..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/2-opt.spvasm.expected.hlsl +++ /dev/null @@ -1,238 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_33 : register(b0, space0) { - uint4 x_33[1]; -}; -cbuffer cbuffer_x_36 : register(b1, space0) { - uint4 x_36[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_250 = i; - const int x_252 = obj.numbers[x_250]; - temp = x_252; - const int x_253 = i; - const int x_254 = j; - const int x_256 = obj.numbers[x_254]; - obj.numbers[x_253] = x_256; - const int x_258 = j; - obj.numbers[x_258] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_262 = h; - const int x_264 = obj.numbers[x_262]; - pivot = x_264; - const int x_265 = l; - i_1 = (x_265 - 1); - const int x_267 = l; - j_1 = x_267; - [loop] while (true) { - const int x_272 = j_1; - const int x_273 = h; - if ((x_272 <= (x_273 - 1))) { - } else { - break; - } - const int x_279 = obj.numbers[j_1]; - if ((x_279 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_293 = h; - param_3 = x_293; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_299 = (top + 1); - top = x_299; - stack[x_299] = l_1; - const int x_303 = (top + 1); - top = x_303; - stack[x_303] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_313 = top; - top = (x_313 - 1); - const int x_316 = stack[x_313]; - h_1 = x_316; - const int x_317 = top; - top = (x_317 - 1); - const int x_320 = stack[x_317]; - l_1 = x_320; - param_4 = l_1; - param_5 = h_1; - const int x_323 = performPartition_i1_i1_(param_4, param_5); - p = x_323; - if (((p - 1) > l_1)) { - const int x_331 = (top + 1); - top = x_331; - stack[x_331] = l_1; - const int x_335 = (top + 1); - top = x_335; - stack[x_335] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_346 = (top + 1); - top = x_346; - stack[x_346] = (p + 1); - const int x_351 = (top + 1); - top = x_351; - stack[x_351] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const float x_109 = asfloat(x_33[0].x); - const float x_111 = asfloat(x_33[0].y); - if ((x_109 > x_111)) { - break; - } - const int x_115 = i_2; - const int x_118 = obj.numbers[i_2]; - const int x_121 = obj.numbers[i_2]; - obj.numbers[x_115] = (x_118 * x_121); - } - } - quicksort_(); - const float4 x_127 = x_GLF_FragCoord; - const float2 x_130 = asfloat(x_36[0].xy); - uv = (float2(x_127.x, x_127.y) / x_130); - color = float3(1.0f, 2.0f, 3.0f); - const int x_133 = obj.numbers[0]; - const float x_136 = color.x; - color.x = (x_136 + float(x_133)); - const float x_140 = uv.x; - if ((x_140 > 0.25f)) { - const int x_145 = obj.numbers[1]; - const float x_148 = color.x; - color.x = (x_148 + float(x_145)); - } - const float x_152 = uv.x; - if ((x_152 > 0.5f)) { - const int x_157 = obj.numbers[2]; - const float x_160 = color.y; - color.y = (x_160 + float(x_157)); - } - const float x_164 = uv.x; - if ((x_164 > 0.75f)) { - const int x_169 = obj.numbers[3]; - const float x_172 = color.z; - color.z = (x_172 + float(x_169)); - } - const int x_176 = obj.numbers[4]; - const float x_179 = color.y; - color.y = (x_179 + float(x_176)); - const float x_183 = uv.y; - if ((x_183 > 0.25f)) { - const int x_188 = obj.numbers[5]; - const float x_191 = color.x; - color.x = (x_191 + float(x_188)); - } - const float x_195 = uv.y; - if ((x_195 > 0.5f)) { - const int x_200 = obj.numbers[6]; - const float x_203 = color.y; - color.y = (x_203 + float(x_200)); - } - const float x_207 = uv.y; - if ((x_207 > 0.75f)) { - const int x_212 = obj.numbers[7]; - const float x_215 = color.z; - color.z = (x_215 + float(x_212)); - } - const int x_219 = obj.numbers[8]; - const float x_222 = color.z; - color.z = (x_222 + float(x_219)); - const float x_226 = uv.x; - const float x_228 = uv.y; - if ((abs((x_226 - x_228)) < 0.25f)) { - const int x_235 = obj.numbers[9]; - const float x_238 = color.x; - color.x = (x_238 + float(x_235)); - } - const float3 x_242 = normalize(color); - frag_color = float4(x_242.x, x_242.y, x_242.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_5 = {frag_color, gl_Position}; - return tint_symbol_5; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} -C:\src\tint\test\Shader@0x00000277FFA71560(133,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x00000277FFA71560(132,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/2-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/2-opt.wgsl.expected.hlsl deleted file mode 100644 index c0c9cf28a3..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-for-loop-with-injection/2-opt.wgsl.expected.hlsl +++ /dev/null @@ -1,238 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_33 : register(b0, space0) { - uint4 x_33[1]; -}; -cbuffer cbuffer_x_36 : register(b1, space0) { - uint4 x_36[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_250 = i; - const int x_252 = obj.numbers[x_250]; - temp = x_252; - const int x_253 = i; - const int x_254 = j; - const int x_256 = obj.numbers[x_254]; - obj.numbers[x_253] = x_256; - const int x_258 = j; - obj.numbers[x_258] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_262 = h; - const int x_264 = obj.numbers[x_262]; - pivot = x_264; - const int x_265 = l; - i_1 = (x_265 - 1); - const int x_267 = l; - j_1 = x_267; - [loop] while (true) { - const int x_272 = j_1; - const int x_273 = h; - if ((x_272 <= (x_273 - 1))) { - } else { - break; - } - const int x_279 = obj.numbers[j_1]; - if ((x_279 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_293 = h; - param_3 = x_293; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_299 = (top + 1); - top = x_299; - stack[x_299] = l_1; - const int x_303 = (top + 1); - top = x_303; - stack[x_303] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_313 = top; - top = (x_313 - 1); - const int x_316 = stack[x_313]; - h_1 = x_316; - const int x_317 = top; - top = (x_317 - 1); - const int x_320 = stack[x_317]; - l_1 = x_320; - param_4 = l_1; - param_5 = h_1; - const int x_323 = performPartition_i1_i1_(param_4, param_5); - p = x_323; - if (((p - 1) > l_1)) { - const int x_331 = (top + 1); - top = x_331; - stack[x_331] = l_1; - const int x_335 = (top + 1); - top = x_335; - stack[x_335] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_346 = (top + 1); - top = x_346; - stack[x_346] = (p + 1); - const int x_351 = (top + 1); - top = x_351; - stack[x_351] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const float x_109 = asfloat(x_33[0].x); - const float x_111 = asfloat(x_33[0].y); - if ((x_109 > x_111)) { - break; - } - const int x_115 = i_2; - const int x_118 = obj.numbers[i_2]; - const int x_121 = obj.numbers[i_2]; - obj.numbers[x_115] = (x_118 * x_121); - } - } - quicksort_(); - const float4 x_127 = x_GLF_FragCoord; - const float2 x_130 = asfloat(x_36[0].xy); - uv = (float2(x_127.x, x_127.y) / x_130); - color = float3(1.0f, 2.0f, 3.0f); - const int x_133 = obj.numbers[0]; - const float x_136 = color.x; - color.x = (x_136 + float(x_133)); - const float x_140 = uv.x; - if ((x_140 > 0.25f)) { - const int x_145 = obj.numbers[1]; - const float x_148 = color.x; - color.x = (x_148 + float(x_145)); - } - const float x_152 = uv.x; - if ((x_152 > 0.5f)) { - const int x_157 = obj.numbers[2]; - const float x_160 = color.y; - color.y = (x_160 + float(x_157)); - } - const float x_164 = uv.x; - if ((x_164 > 0.75f)) { - const int x_169 = obj.numbers[3]; - const float x_172 = color.z; - color.z = (x_172 + float(x_169)); - } - const int x_176 = obj.numbers[4]; - const float x_179 = color.y; - color.y = (x_179 + float(x_176)); - const float x_183 = uv.y; - if ((x_183 > 0.25f)) { - const int x_188 = obj.numbers[5]; - const float x_191 = color.x; - color.x = (x_191 + float(x_188)); - } - const float x_195 = uv.y; - if ((x_195 > 0.5f)) { - const int x_200 = obj.numbers[6]; - const float x_203 = color.y; - color.y = (x_203 + float(x_200)); - } - const float x_207 = uv.y; - if ((x_207 > 0.75f)) { - const int x_212 = obj.numbers[7]; - const float x_215 = color.z; - color.z = (x_215 + float(x_212)); - } - const int x_219 = obj.numbers[8]; - const float x_222 = color.z; - color.z = (x_222 + float(x_219)); - const float x_226 = uv.x; - const float x_228 = uv.y; - if ((abs((x_226 - x_228)) < 0.25f)) { - const int x_235 = obj.numbers[9]; - const float x_238 = color.x; - color.x = (x_238 + float(x_235)); - } - const float3 x_242 = normalize(color); - frag_color = float4(x_242.x, x_242.y, x_242.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_5 = {frag_color, gl_Position}; - return tint_symbol_5; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} -C:\src\tint\test\Shader@0x000001A3B2C08520(133,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000001A3B2C08520(132,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/0.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/0.spvasm.expected.hlsl deleted file mode 100644 index 9867861b15..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/0.spvasm.expected.hlsl +++ /dev/null @@ -1,317 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b0, space0) { - uint4 x_34[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void main_1() { - int x_90 = 0; - int x_91 = 0; - int x_92 = 0; - int x_93 = 0; - int x_94 = 0; - int x_95 = 0; - int x_96 = 0; - int x_97 = 0; - int x_98 = 0; - int x_99 = 0; - int x_100 = 0; - int x_101 = 0; - int x_102 = 0; - int x_103[10] = (int[10])0; - int x_104 = 0; - int x_105 = 0; - int x_106 = 0; - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_121 = i_2; - const int x_124 = obj.numbers[i_2]; - const int x_127 = obj.numbers[i_2]; - obj.numbers[x_121] = (x_124 * x_127); - } - } - x_100 = 0; - x_101 = 9; - x_102 = -1; - const int x_133 = (x_102 + 1); - x_102 = x_133; - x_103[x_133] = x_100; - const int x_137 = (x_102 + 1); - x_102 = x_137; - x_103[x_137] = x_101; - [loop] while (true) { - if ((x_102 >= 0)) { - } else { - break; - } - const int x_147 = x_102; - x_102 = (x_147 - 1); - const int x_150 = x_103[x_147]; - x_101 = x_150; - const int x_151 = x_102; - x_102 = (x_151 - 1); - const int x_154 = x_103[x_151]; - x_100 = x_154; - x_105 = x_100; - x_106 = x_101; - const int x_159 = obj.numbers[x_106]; - x_92 = x_159; - x_93 = (x_105 - 1); - x_94 = x_105; - { - [loop] for(; (x_94 <= (x_106 - 1)); x_94 = (x_94 + 1)) { - const int x_174 = obj.numbers[x_94]; - if ((x_174 <= x_92)) { - x_93 = (x_93 + 1); - x_95 = x_93; - x_96 = x_94; - const int x_185 = obj.numbers[x_95]; - x_91 = x_185; - const int x_186 = x_95; - const int x_189 = obj.numbers[x_96]; - obj.numbers[x_186] = x_189; - obj.numbers[x_96] = x_91; - } - } - } - x_97 = (x_93 + 1); - x_98 = x_106; - const int x_201 = obj.numbers[x_97]; - x_90 = x_201; - const int x_202 = x_97; - const int x_205 = obj.numbers[x_98]; - obj.numbers[x_202] = x_205; - obj.numbers[x_98] = x_90; - x_99 = (x_93 + 1); - x_104 = x_99; - if (((x_104 - 1) > x_100)) { - const int x_220 = (x_102 + 1); - x_102 = x_220; - x_103[x_220] = x_100; - const int x_224 = (x_102 + 1); - x_102 = x_224; - x_103[x_224] = (x_104 - 1); - } - if (((x_104 + 1) < x_101)) { - const int x_235 = (x_102 + 1); - x_102 = x_235; - x_103[x_235] = (x_104 + 1); - const int x_240 = (x_102 + 1); - x_102 = x_240; - x_103[x_240] = x_101; - } - } - const float4 x_243 = x_GLF_FragCoord; - const float2 x_246 = asfloat(x_34[0].xy); - uv = (float2(x_243.x, x_243.y) / x_246); - color = float3(1.0f, 2.0f, 3.0f); - const int x_249 = obj.numbers[0]; - const float x_252 = color.x; - color.x = (x_252 + float(x_249)); - const float x_256 = uv.x; - if ((x_256 > 0.25f)) { - const int x_261 = obj.numbers[1]; - const float x_264 = color.x; - color.x = (x_264 + float(x_261)); - } - const float x_268 = uv.x; - if ((x_268 > 0.5f)) { - const int x_273 = obj.numbers[2]; - const float x_276 = color.y; - color.y = (x_276 + float(x_273)); - } - const float x_280 = uv.x; - if ((x_280 > 0.75f)) { - const int x_285 = obj.numbers[3]; - const float x_288 = color.z; - color.z = (x_288 + float(x_285)); - } - const int x_292 = obj.numbers[4]; - const float x_295 = color.y; - color.y = (x_295 + float(x_292)); - const float x_299 = uv.y; - if ((x_299 > 0.25f)) { - const int x_304 = obj.numbers[5]; - const float x_307 = color.x; - color.x = (x_307 + float(x_304)); - } - const float x_311 = uv.y; - if ((x_311 > 0.5f)) { - const int x_316 = obj.numbers[6]; - const float x_319 = color.y; - color.y = (x_319 + float(x_316)); - } - const float x_323 = uv.y; - if ((x_323 > 0.75f)) { - const int x_328 = obj.numbers[7]; - const float x_331 = color.z; - color.z = (x_331 + float(x_328)); - } - const int x_335 = obj.numbers[8]; - const float x_338 = color.z; - color.z = (x_338 + float(x_335)); - const float x_342 = uv.x; - const float x_344 = uv.y; - if ((abs((x_342 - x_344)) < 0.25f)) { - const int x_351 = obj.numbers[9]; - const float x_354 = color.x; - color.x = (x_354 + float(x_351)); - } - const float3 x_358 = normalize(color); - frag_color = float4(x_358.x, x_358.y, x_358.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_4 = {frag_color, gl_Position}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_366 = i; - const int x_368 = obj.numbers[x_366]; - temp = x_368; - const int x_369 = i; - const int x_370 = j; - const int x_372 = obj.numbers[x_370]; - obj.numbers[x_369] = x_372; - const int x_374 = j; - obj.numbers[x_374] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_378 = h; - const int x_380 = obj.numbers[x_378]; - pivot = x_380; - const int x_381 = l; - i_1 = (x_381 - 1); - const int x_383 = l; - j_1 = x_383; - [loop] while (true) { - const int x_388 = j_1; - const int x_389 = h; - if ((x_388 <= (x_389 - 1))) { - } else { - break; - } - const int x_395 = obj.numbers[j_1]; - if ((x_395 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_409 = h; - param_3 = x_409; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_415 = (top + 1); - top = x_415; - stack[x_415] = l_1; - const int x_419 = (top + 1); - top = x_419; - stack[x_419] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_429 = top; - top = (x_429 - 1); - const int x_432 = stack[x_429]; - h_1 = x_432; - const int x_433 = top; - top = (x_433 - 1); - const int x_436 = stack[x_433]; - l_1 = x_436; - param_4 = l_1; - param_5 = h_1; - const int x_439 = performPartition_i1_i1_(param_4, param_5); - p = x_439; - if (((p - 1) > l_1)) { - const int x_447 = (top + 1); - top = x_447; - stack[x_447] = l_1; - const int x_451 = (top + 1); - top = x_451; - stack[x_451] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_462 = (top + 1); - top = x_462; - stack[x_462] = (p + 1); - const int x_467 = (top + 1); - top = x_467; - stack[x_467] = h_1; - } - } - return; -} -C:\src\tint\test\Shader@0x0000028832314060(39,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x0000028832314060(38,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/0.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/0.wgsl.expected.hlsl deleted file mode 100644 index 0727d5b5ae..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/0.wgsl.expected.hlsl +++ /dev/null @@ -1,317 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b0, space0) { - uint4 x_34[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void main_1() { - int x_90 = 0; - int x_91 = 0; - int x_92 = 0; - int x_93 = 0; - int x_94 = 0; - int x_95 = 0; - int x_96 = 0; - int x_97 = 0; - int x_98 = 0; - int x_99 = 0; - int x_100 = 0; - int x_101 = 0; - int x_102 = 0; - int x_103[10] = (int[10])0; - int x_104 = 0; - int x_105 = 0; - int x_106 = 0; - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_121 = i_2; - const int x_124 = obj.numbers[i_2]; - const int x_127 = obj.numbers[i_2]; - obj.numbers[x_121] = (x_124 * x_127); - } - } - x_100 = 0; - x_101 = 9; - x_102 = -1; - const int x_133 = (x_102 + 1); - x_102 = x_133; - x_103[x_133] = x_100; - const int x_137 = (x_102 + 1); - x_102 = x_137; - x_103[x_137] = x_101; - [loop] while (true) { - if ((x_102 >= 0)) { - } else { - break; - } - const int x_147 = x_102; - x_102 = (x_147 - 1); - const int x_150 = x_103[x_147]; - x_101 = x_150; - const int x_151 = x_102; - x_102 = (x_151 - 1); - const int x_154 = x_103[x_151]; - x_100 = x_154; - x_105 = x_100; - x_106 = x_101; - const int x_159 = obj.numbers[x_106]; - x_92 = x_159; - x_93 = (x_105 - 1); - x_94 = x_105; - { - [loop] for(; (x_94 <= (x_106 - 1)); x_94 = (x_94 + 1)) { - const int x_174 = obj.numbers[x_94]; - if ((x_174 <= x_92)) { - x_93 = (x_93 + 1); - x_95 = x_93; - x_96 = x_94; - const int x_185 = obj.numbers[x_95]; - x_91 = x_185; - const int x_186 = x_95; - const int x_189 = obj.numbers[x_96]; - obj.numbers[x_186] = x_189; - obj.numbers[x_96] = x_91; - } - } - } - x_97 = (x_93 + 1); - x_98 = x_106; - const int x_201 = obj.numbers[x_97]; - x_90 = x_201; - const int x_202 = x_97; - const int x_205 = obj.numbers[x_98]; - obj.numbers[x_202] = x_205; - obj.numbers[x_98] = x_90; - x_99 = (x_93 + 1); - x_104 = x_99; - if (((x_104 - 1) > x_100)) { - const int x_220 = (x_102 + 1); - x_102 = x_220; - x_103[x_220] = x_100; - const int x_224 = (x_102 + 1); - x_102 = x_224; - x_103[x_224] = (x_104 - 1); - } - if (((x_104 + 1) < x_101)) { - const int x_235 = (x_102 + 1); - x_102 = x_235; - x_103[x_235] = (x_104 + 1); - const int x_240 = (x_102 + 1); - x_102 = x_240; - x_103[x_240] = x_101; - } - } - const float4 x_243 = x_GLF_FragCoord; - const float2 x_246 = asfloat(x_34[0].xy); - uv = (float2(x_243.x, x_243.y) / x_246); - color = float3(1.0f, 2.0f, 3.0f); - const int x_249 = obj.numbers[0]; - const float x_252 = color.x; - color.x = (x_252 + float(x_249)); - const float x_256 = uv.x; - if ((x_256 > 0.25f)) { - const int x_261 = obj.numbers[1]; - const float x_264 = color.x; - color.x = (x_264 + float(x_261)); - } - const float x_268 = uv.x; - if ((x_268 > 0.5f)) { - const int x_273 = obj.numbers[2]; - const float x_276 = color.y; - color.y = (x_276 + float(x_273)); - } - const float x_280 = uv.x; - if ((x_280 > 0.75f)) { - const int x_285 = obj.numbers[3]; - const float x_288 = color.z; - color.z = (x_288 + float(x_285)); - } - const int x_292 = obj.numbers[4]; - const float x_295 = color.y; - color.y = (x_295 + float(x_292)); - const float x_299 = uv.y; - if ((x_299 > 0.25f)) { - const int x_304 = obj.numbers[5]; - const float x_307 = color.x; - color.x = (x_307 + float(x_304)); - } - const float x_311 = uv.y; - if ((x_311 > 0.5f)) { - const int x_316 = obj.numbers[6]; - const float x_319 = color.y; - color.y = (x_319 + float(x_316)); - } - const float x_323 = uv.y; - if ((x_323 > 0.75f)) { - const int x_328 = obj.numbers[7]; - const float x_331 = color.z; - color.z = (x_331 + float(x_328)); - } - const int x_335 = obj.numbers[8]; - const float x_338 = color.z; - color.z = (x_338 + float(x_335)); - const float x_342 = uv.x; - const float x_344 = uv.y; - if ((abs((x_342 - x_344)) < 0.25f)) { - const int x_351 = obj.numbers[9]; - const float x_354 = color.x; - color.x = (x_354 + float(x_351)); - } - const float3 x_358 = normalize(color); - frag_color = float4(x_358.x, x_358.y, x_358.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_4 = {frag_color, gl_Position}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_366 = i; - const int x_368 = obj.numbers[x_366]; - temp = x_368; - const int x_369 = i; - const int x_370 = j; - const int x_372 = obj.numbers[x_370]; - obj.numbers[x_369] = x_372; - const int x_374 = j; - obj.numbers[x_374] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_378 = h; - const int x_380 = obj.numbers[x_378]; - pivot = x_380; - const int x_381 = l; - i_1 = (x_381 - 1); - const int x_383 = l; - j_1 = x_383; - [loop] while (true) { - const int x_388 = j_1; - const int x_389 = h; - if ((x_388 <= (x_389 - 1))) { - } else { - break; - } - const int x_395 = obj.numbers[j_1]; - if ((x_395 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_409 = h; - param_3 = x_409; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_415 = (top + 1); - top = x_415; - stack[x_415] = l_1; - const int x_419 = (top + 1); - top = x_419; - stack[x_419] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_429 = top; - top = (x_429 - 1); - const int x_432 = stack[x_429]; - h_1 = x_432; - const int x_433 = top; - top = (x_433 - 1); - const int x_436 = stack[x_433]; - l_1 = x_436; - param_4 = l_1; - param_5 = h_1; - const int x_439 = performPartition_i1_i1_(param_4, param_5); - p = x_439; - if (((p - 1) > l_1)) { - const int x_447 = (top + 1); - top = x_447; - stack[x_447] = l_1; - const int x_451 = (top + 1); - top = x_451; - stack[x_451] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_462 = (top + 1); - top = x_462; - stack[x_462] = (p + 1); - const int x_467 = (top + 1); - top = x_467; - stack[x_467] = h_1; - } - } - return; -} -C:\src\tint\test\Shader@0x0000028832C83FA0(39,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x0000028832C83FA0(38,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/2.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/2.spvasm.expected.hlsl deleted file mode 100644 index cb5a69156c..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/2.spvasm.expected.hlsl +++ /dev/null @@ -1,295 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b0, space0) { - uint4 x_34[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -int performPartition_i1_i1_(inout int l, inout int h) { - int x_314 = 0; - int x_315 = 0; - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_316 = h; - const int x_318 = obj.numbers[x_316]; - pivot = x_318; - const int x_319 = l; - i_1 = (x_319 - 1); - const int x_321 = l; - j_1 = x_321; - [loop] while (true) { - const int x_326 = j_1; - const int x_327 = h; - if ((x_326 <= (x_327 - 1))) { - } else { - break; - } - const int x_333 = obj.numbers[j_1]; - if ((x_333 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - const int x_344 = obj.numbers[param]; - x_315 = x_344; - const int x_345 = param; - const int x_348 = obj.numbers[param_1]; - obj.numbers[x_345] = x_348; - obj.numbers[param_1] = x_315; - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_357 = h; - param_3 = x_357; - const int x_360 = obj.numbers[param_2]; - x_314 = x_360; - const int x_361 = param_2; - const int x_364 = obj.numbers[param_3]; - obj.numbers[x_361] = x_364; - obj.numbers[param_3] = x_314; - if (false) { - } else { - return (i_1 + 1); - } - return 0; -} - -void main_1() { - int x_91 = 0; - int x_92 = 0; - int x_93 = 0; - int x_94[10] = (int[10])0; - int x_95 = 0; - int x_96 = 0; - int x_97 = 0; - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_112 = i_2; - const int x_115 = obj.numbers[i_2]; - const int x_118 = obj.numbers[i_2]; - obj.numbers[x_112] = (x_115 * x_118); - } - } - x_91 = 0; - x_92 = 9; - x_93 = -1; - const int x_124 = (x_93 + 1); - x_93 = x_124; - x_94[x_124] = x_91; - const int x_128 = (x_93 + 1); - x_93 = x_128; - x_94[x_128] = x_92; - [loop] while (true) { - if ((x_93 >= 0)) { - } else { - break; - } - const int x_138 = x_93; - x_93 = (x_138 - 1); - const int x_141 = x_94[x_138]; - x_92 = x_141; - const int x_142 = x_93; - x_93 = (x_142 - 1); - const int x_145 = x_94[x_142]; - x_91 = x_145; - x_96 = x_91; - x_97 = x_92; - const int x_148 = performPartition_i1_i1_(x_96, x_97); - x_95 = x_148; - if (((x_95 - 1) > x_91)) { - const int x_156 = (x_93 + 1); - x_93 = x_156; - x_94[x_156] = x_91; - const int x_160 = (x_93 + 1); - x_93 = x_160; - x_94[x_160] = (x_95 - 1); - } - if (((x_95 + 1) < x_92)) { - const int x_171 = (x_93 + 1); - x_93 = x_171; - x_94[x_171] = (x_95 + 1); - const int x_176 = (x_93 + 1); - x_93 = x_176; - x_94[x_176] = x_92; - } - } - const float4 x_179 = x_GLF_FragCoord; - const float2 x_182 = asfloat(x_34[0].xy); - uv = (float2(x_179.x, x_179.y) / x_182); - color = float3(1.0f, 2.0f, 3.0f); - const int x_185 = obj.numbers[0]; - const float x_188 = color.x; - color.x = (x_188 + float(x_185)); - const float x_192 = uv.x; - if ((x_192 > 0.25f)) { - const int x_197 = obj.numbers[1]; - const float x_200 = color.x; - color.x = (x_200 + float(x_197)); - } - const float x_204 = uv.x; - if ((x_204 > 0.5f)) { - const int x_209 = obj.numbers[2]; - const float x_212 = color.y; - color.y = (x_212 + float(x_209)); - } - const float x_216 = uv.x; - if ((x_216 > 0.75f)) { - const int x_221 = obj.numbers[3]; - const float x_224 = color.z; - color.z = (x_224 + float(x_221)); - } - const int x_228 = obj.numbers[4]; - const float x_231 = color.y; - color.y = (x_231 + float(x_228)); - const float x_235 = uv.y; - if ((x_235 > 0.25f)) { - const int x_240 = obj.numbers[5]; - const float x_243 = color.x; - color.x = (x_243 + float(x_240)); - } - const float x_247 = uv.y; - if ((x_247 > 0.5f)) { - const int x_252 = obj.numbers[6]; - const float x_255 = color.y; - color.y = (x_255 + float(x_252)); - } - const float x_259 = uv.y; - if ((x_259 > 0.75f)) { - const int x_264 = obj.numbers[7]; - const float x_267 = color.z; - color.z = (x_267 + float(x_264)); - } - const int x_271 = obj.numbers[8]; - const float x_274 = color.z; - color.z = (x_274 + float(x_271)); - const float x_278 = uv.x; - const float x_280 = uv.y; - if ((abs((x_278 - x_280)) < 0.25f)) { - const int x_287 = obj.numbers[9]; - const float x_290 = color.x; - color.x = (x_290 + float(x_287)); - } - const float3 x_294 = normalize(color); - frag_color = float4(x_294.x, x_294.y, x_294.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_4 = {frag_color, gl_Position}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_302 = i; - const int x_304 = obj.numbers[x_302]; - temp = x_304; - const int x_305 = i; - const int x_306 = j; - const int x_308 = obj.numbers[x_306]; - obj.numbers[x_305] = x_308; - const int x_310 = j; - obj.numbers[x_310] = temp; - return; -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_377 = (top + 1); - top = x_377; - stack[x_377] = l_1; - const int x_381 = (top + 1); - top = x_381; - stack[x_381] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_391 = top; - top = (x_391 - 1); - const int x_394 = stack[x_391]; - h_1 = x_394; - const int x_395 = top; - top = (x_395 - 1); - const int x_398 = stack[x_395]; - l_1 = x_398; - param_4 = l_1; - param_5 = h_1; - const int x_401 = performPartition_i1_i1_(param_4, param_5); - p = x_401; - if (((p - 1) > l_1)) { - const int x_409 = (top + 1); - top = x_409; - stack[x_409] = l_1; - const int x_413 = (top + 1); - top = x_413; - stack[x_413] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_424 = (top + 1); - top = x_424; - stack[x_424] = (p + 1); - const int x_429 = (top + 1); - top = x_429; - stack[x_429] = h_1; - } - } - return; -} -C:\src\tint\test\Shader@0x000002B401B06060(85,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000002B401B06060(84,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/2.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/2.wgsl.expected.hlsl deleted file mode 100644 index d7f564da8d..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-if-false-else-return/2.wgsl.expected.hlsl +++ /dev/null @@ -1,295 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b0, space0) { - uint4 x_34[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -int performPartition_i1_i1_(inout int l, inout int h) { - int x_314 = 0; - int x_315 = 0; - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_316 = h; - const int x_318 = obj.numbers[x_316]; - pivot = x_318; - const int x_319 = l; - i_1 = (x_319 - 1); - const int x_321 = l; - j_1 = x_321; - [loop] while (true) { - const int x_326 = j_1; - const int x_327 = h; - if ((x_326 <= (x_327 - 1))) { - } else { - break; - } - const int x_333 = obj.numbers[j_1]; - if ((x_333 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - const int x_344 = obj.numbers[param]; - x_315 = x_344; - const int x_345 = param; - const int x_348 = obj.numbers[param_1]; - obj.numbers[x_345] = x_348; - obj.numbers[param_1] = x_315; - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_357 = h; - param_3 = x_357; - const int x_360 = obj.numbers[param_2]; - x_314 = x_360; - const int x_361 = param_2; - const int x_364 = obj.numbers[param_3]; - obj.numbers[x_361] = x_364; - obj.numbers[param_3] = x_314; - if (false) { - } else { - return (i_1 + 1); - } - return 0; -} - -void main_1() { - int x_91 = 0; - int x_92 = 0; - int x_93 = 0; - int x_94[10] = (int[10])0; - int x_95 = 0; - int x_96 = 0; - int x_97 = 0; - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_112 = i_2; - const int x_115 = obj.numbers[i_2]; - const int x_118 = obj.numbers[i_2]; - obj.numbers[x_112] = (x_115 * x_118); - } - } - x_91 = 0; - x_92 = 9; - x_93 = -1; - const int x_124 = (x_93 + 1); - x_93 = x_124; - x_94[x_124] = x_91; - const int x_128 = (x_93 + 1); - x_93 = x_128; - x_94[x_128] = x_92; - [loop] while (true) { - if ((x_93 >= 0)) { - } else { - break; - } - const int x_138 = x_93; - x_93 = (x_138 - 1); - const int x_141 = x_94[x_138]; - x_92 = x_141; - const int x_142 = x_93; - x_93 = (x_142 - 1); - const int x_145 = x_94[x_142]; - x_91 = x_145; - x_96 = x_91; - x_97 = x_92; - const int x_148 = performPartition_i1_i1_(x_96, x_97); - x_95 = x_148; - if (((x_95 - 1) > x_91)) { - const int x_156 = (x_93 + 1); - x_93 = x_156; - x_94[x_156] = x_91; - const int x_160 = (x_93 + 1); - x_93 = x_160; - x_94[x_160] = (x_95 - 1); - } - if (((x_95 + 1) < x_92)) { - const int x_171 = (x_93 + 1); - x_93 = x_171; - x_94[x_171] = (x_95 + 1); - const int x_176 = (x_93 + 1); - x_93 = x_176; - x_94[x_176] = x_92; - } - } - const float4 x_179 = x_GLF_FragCoord; - const float2 x_182 = asfloat(x_34[0].xy); - uv = (float2(x_179.x, x_179.y) / x_182); - color = float3(1.0f, 2.0f, 3.0f); - const int x_185 = obj.numbers[0]; - const float x_188 = color.x; - color.x = (x_188 + float(x_185)); - const float x_192 = uv.x; - if ((x_192 > 0.25f)) { - const int x_197 = obj.numbers[1]; - const float x_200 = color.x; - color.x = (x_200 + float(x_197)); - } - const float x_204 = uv.x; - if ((x_204 > 0.5f)) { - const int x_209 = obj.numbers[2]; - const float x_212 = color.y; - color.y = (x_212 + float(x_209)); - } - const float x_216 = uv.x; - if ((x_216 > 0.75f)) { - const int x_221 = obj.numbers[3]; - const float x_224 = color.z; - color.z = (x_224 + float(x_221)); - } - const int x_228 = obj.numbers[4]; - const float x_231 = color.y; - color.y = (x_231 + float(x_228)); - const float x_235 = uv.y; - if ((x_235 > 0.25f)) { - const int x_240 = obj.numbers[5]; - const float x_243 = color.x; - color.x = (x_243 + float(x_240)); - } - const float x_247 = uv.y; - if ((x_247 > 0.5f)) { - const int x_252 = obj.numbers[6]; - const float x_255 = color.y; - color.y = (x_255 + float(x_252)); - } - const float x_259 = uv.y; - if ((x_259 > 0.75f)) { - const int x_264 = obj.numbers[7]; - const float x_267 = color.z; - color.z = (x_267 + float(x_264)); - } - const int x_271 = obj.numbers[8]; - const float x_274 = color.z; - color.z = (x_274 + float(x_271)); - const float x_278 = uv.x; - const float x_280 = uv.y; - if ((abs((x_278 - x_280)) < 0.25f)) { - const int x_287 = obj.numbers[9]; - const float x_290 = color.x; - color.x = (x_290 + float(x_287)); - } - const float3 x_294 = normalize(color); - frag_color = float4(x_294.x, x_294.y, x_294.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_4 = {frag_color, gl_Position}; - return tint_symbol_4; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_302 = i; - const int x_304 = obj.numbers[x_302]; - temp = x_304; - const int x_305 = i; - const int x_306 = j; - const int x_308 = obj.numbers[x_306]; - obj.numbers[x_305] = x_308; - const int x_310 = j; - obj.numbers[x_310] = temp; - return; -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_377 = (top + 1); - top = x_377; - stack[x_377] = l_1; - const int x_381 = (top + 1); - top = x_381; - stack[x_381] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_391 = top; - top = (x_391 - 1); - const int x_394 = stack[x_391]; - h_1 = x_394; - const int x_395 = top; - top = (x_395 - 1); - const int x_398 = stack[x_395]; - l_1 = x_398; - param_4 = l_1; - param_5 = h_1; - const int x_401 = performPartition_i1_i1_(param_4, param_5); - p = x_401; - if (((p - 1) > l_1)) { - const int x_409 = (top + 1); - top = x_409; - stack[x_409] = l_1; - const int x_413 = (top + 1); - top = x_413; - stack[x_413] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_424 = (top + 1); - top = x_424; - stack[x_424] = (p + 1); - const int x_429 = (top + 1); - top = x_429; - stack[x_429] = h_1; - } - } - return; -} -C:\src\tint\test\Shader@0x000001381E0F76E0(85,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000001381E0F76E0(84,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-max-value-as-index/2-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-max-value-as-index/2-opt.spvasm.expected.hlsl deleted file mode 100644 index 8860431152..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-max-value-as-index/2-opt.spvasm.expected.hlsl +++ /dev/null @@ -1,236 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b1, space0) { - uint4 x_34[1]; -}; -cbuffer cbuffer_x_37 : register(b0, space0) { - uint4 x_37[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_257 = i; - const int x_259 = obj.numbers[x_257]; - temp = x_259; - const int x_260 = i; - const int x_261 = j; - const int x_263 = obj.numbers[x_261]; - obj.numbers[x_260] = x_263; - const int x_265 = j; - obj.numbers[x_265] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_269 = h; - const int x_271 = obj.numbers[x_269]; - pivot = x_271; - const int x_272 = l; - i_1 = (x_272 - 1); - const int x_274 = l; - j_1 = x_274; - [loop] while (true) { - const int x_279 = j_1; - const int x_280 = h; - if ((x_279 <= (x_280 - 1))) { - } else { - break; - } - const int x_286 = obj.numbers[j_1]; - if ((x_286 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_300 = h; - param_3 = x_300; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_306 = (top + 1); - top = x_306; - stack[x_306] = l_1; - const int x_310 = (top + 1); - top = x_310; - stack[x_310] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_320 = top; - top = (x_320 - 1); - const int x_323 = stack[x_320]; - h_1 = x_323; - const int x_324 = top; - top = (x_324 - 1); - const int x_327 = stack[x_324]; - l_1 = x_327; - param_4 = l_1; - param_5 = h_1; - const int x_330 = performPartition_i1_i1_(param_4, param_5); - p = x_330; - if (((p - 1) > l_1)) { - const int x_338 = (top + 1); - top = x_338; - stack[x_338] = l_1; - const int x_342 = (top + 1); - top = x_342; - stack[x_342] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_353 = (top + 1); - top = x_353; - stack[x_353] = (p + 1); - const int x_358 = (top + 1); - top = x_358; - stack[x_358] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_108 = i_2; - const int x_111 = obj.numbers[i_2]; - const int x_114 = obj.numbers[i_2]; - obj.numbers[x_108] = (x_111 * x_114); - } - } - quicksort_(); - const float4 x_120 = x_GLF_FragCoord; - const float2 x_123 = asfloat(x_34[0].xy); - uv = (float2(x_120.x, x_120.y) / x_123); - color = float3(1.0f, 2.0f, 3.0f); - const int x_126 = obj.numbers[0]; - const float x_129 = color.x; - color.x = (x_129 + float(x_126)); - const float x_133 = uv.x; - if ((x_133 > 0.25f)) { - const int x_138 = obj.numbers[1]; - const float x_141 = color.x; - color.x = (x_141 + float(x_138)); - } - const float x_145 = uv.x; - if ((x_145 > 0.5f)) { - const float x_150 = asfloat(x_37[0].y); - const int x_155 = obj.numbers[max((2 * int(x_150)), 2)]; - const float x_158 = asfloat(x_37[0].y); - const int x_163 = obj.numbers[max((2 * int(x_158)), 2)]; - const float x_167 = color.y; - color.y = (x_167 + max(float(x_155), float(x_163))); - } - const float x_171 = uv.x; - if ((x_171 > 0.75f)) { - const int x_176 = obj.numbers[3]; - const float x_179 = color.z; - color.z = (x_179 + float(x_176)); - } - const int x_183 = obj.numbers[4]; - const float x_186 = color.y; - color.y = (x_186 + float(x_183)); - const float x_190 = uv.y; - if ((x_190 > 0.25f)) { - const int x_195 = obj.numbers[5]; - const float x_198 = color.x; - color.x = (x_198 + float(x_195)); - } - const float x_202 = uv.y; - if ((x_202 > 0.5f)) { - const int x_207 = obj.numbers[6]; - const float x_210 = color.y; - color.y = (x_210 + float(x_207)); - } - const float x_214 = uv.y; - if ((x_214 > 0.75f)) { - const int x_219 = obj.numbers[7]; - const float x_222 = color.z; - color.z = (x_222 + float(x_219)); - } - const int x_226 = obj.numbers[8]; - const float x_229 = color.z; - color.z = (x_229 + float(x_226)); - const float x_233 = uv.x; - const float x_235 = uv.y; - if ((abs((x_233 - x_235)) < 0.25f)) { - const int x_242 = obj.numbers[9]; - const float x_245 = color.x; - color.x = (x_245 + float(x_242)); - } - const float3 x_249 = normalize(color); - frag_color = float4(x_249.x, x_249.y, x_249.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_5 = {frag_color, gl_Position}; - return tint_symbol_5; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} -C:\src\tint\test\Shader@0x0000015776479900(133,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x0000015776479900(132,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-max-value-as-index/2-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/stable-quicksort-max-value-as-index/2-opt.wgsl.expected.hlsl deleted file mode 100644 index dc4f441d55..0000000000 --- a/test/vk-gl-cts/graphicsfuzz/stable-quicksort-max-value-as-index/2-opt.wgsl.expected.hlsl +++ /dev/null @@ -1,236 +0,0 @@ -SKIP: FAILED - -struct QuicksortObject { - int numbers[10]; -}; - -static QuicksortObject obj = (QuicksortObject)0; -static float4 x_GLF_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 x_GLF_pos = float4(0.0f, 0.0f, 0.0f, 0.0f); -cbuffer cbuffer_x_34 : register(b1, space0) { - uint4 x_34[1]; -}; -cbuffer cbuffer_x_37 : register(b0, space0) { - uint4 x_37[1]; -}; -static float4 frag_color = float4(0.0f, 0.0f, 0.0f, 0.0f); -static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void swap_i1_i1_(inout int i, inout int j) { - int temp = 0; - const int x_257 = i; - const int x_259 = obj.numbers[x_257]; - temp = x_259; - const int x_260 = i; - const int x_261 = j; - const int x_263 = obj.numbers[x_261]; - obj.numbers[x_260] = x_263; - const int x_265 = j; - obj.numbers[x_265] = temp; - return; -} - -int performPartition_i1_i1_(inout int l, inout int h) { - int pivot = 0; - int i_1 = 0; - int j_1 = 0; - int param = 0; - int param_1 = 0; - int param_2 = 0; - int param_3 = 0; - const int x_269 = h; - const int x_271 = obj.numbers[x_269]; - pivot = x_271; - const int x_272 = l; - i_1 = (x_272 - 1); - const int x_274 = l; - j_1 = x_274; - [loop] while (true) { - const int x_279 = j_1; - const int x_280 = h; - if ((x_279 <= (x_280 - 1))) { - } else { - break; - } - const int x_286 = obj.numbers[j_1]; - if ((x_286 <= pivot)) { - i_1 = (i_1 + 1); - param = i_1; - param_1 = j_1; - swap_i1_i1_(param, param_1); - } - { - j_1 = (j_1 + 1); - } - } - param_2 = (i_1 + 1); - const int x_300 = h; - param_3 = x_300; - swap_i1_i1_(param_2, param_3); - return (i_1 + 1); -} - -void quicksort_() { - int l_1 = 0; - int h_1 = 0; - int top = 0; - int stack[10] = (int[10])0; - int p = 0; - int param_4 = 0; - int param_5 = 0; - l_1 = 0; - h_1 = 9; - top = -1; - const int x_306 = (top + 1); - top = x_306; - stack[x_306] = l_1; - const int x_310 = (top + 1); - top = x_310; - stack[x_310] = h_1; - [loop] while (true) { - if ((top >= 0)) { - } else { - break; - } - const int x_320 = top; - top = (x_320 - 1); - const int x_323 = stack[x_320]; - h_1 = x_323; - const int x_324 = top; - top = (x_324 - 1); - const int x_327 = stack[x_324]; - l_1 = x_327; - param_4 = l_1; - param_5 = h_1; - const int x_330 = performPartition_i1_i1_(param_4, param_5); - p = x_330; - if (((p - 1) > l_1)) { - const int x_338 = (top + 1); - top = x_338; - stack[x_338] = l_1; - const int x_342 = (top + 1); - top = x_342; - stack[x_342] = (p - 1); - } - if (((p + 1) < h_1)) { - const int x_353 = (top + 1); - top = x_353; - stack[x_353] = (p + 1); - const int x_358 = (top + 1); - top = x_358; - stack[x_358] = h_1; - } - } - return; -} - -void main_1() { - int i_2 = 0; - float2 uv = float2(0.0f, 0.0f); - float3 color = float3(0.0f, 0.0f, 0.0f); - x_GLF_FragCoord = ((x_GLF_pos + float4(1.0f, 1.0f, 0.0f, 0.0f)) * float4(128.0f, 128.0f, 1.0f, 1.0f)); - i_2 = 0; - { - [loop] for(; (i_2 < 10); i_2 = (i_2 + 1)) { - obj.numbers[i_2] = (10 - i_2); - const int x_108 = i_2; - const int x_111 = obj.numbers[i_2]; - const int x_114 = obj.numbers[i_2]; - obj.numbers[x_108] = (x_111 * x_114); - } - } - quicksort_(); - const float4 x_120 = x_GLF_FragCoord; - const float2 x_123 = asfloat(x_34[0].xy); - uv = (float2(x_120.x, x_120.y) / x_123); - color = float3(1.0f, 2.0f, 3.0f); - const int x_126 = obj.numbers[0]; - const float x_129 = color.x; - color.x = (x_129 + float(x_126)); - const float x_133 = uv.x; - if ((x_133 > 0.25f)) { - const int x_138 = obj.numbers[1]; - const float x_141 = color.x; - color.x = (x_141 + float(x_138)); - } - const float x_145 = uv.x; - if ((x_145 > 0.5f)) { - const float x_150 = asfloat(x_37[0].y); - const int x_155 = obj.numbers[max((2 * int(x_150)), 2)]; - const float x_158 = asfloat(x_37[0].y); - const int x_163 = obj.numbers[max((2 * int(x_158)), 2)]; - const float x_167 = color.y; - color.y = (x_167 + max(float(x_155), float(x_163))); - } - const float x_171 = uv.x; - if ((x_171 > 0.75f)) { - const int x_176 = obj.numbers[3]; - const float x_179 = color.z; - color.z = (x_179 + float(x_176)); - } - const int x_183 = obj.numbers[4]; - const float x_186 = color.y; - color.y = (x_186 + float(x_183)); - const float x_190 = uv.y; - if ((x_190 > 0.25f)) { - const int x_195 = obj.numbers[5]; - const float x_198 = color.x; - color.x = (x_198 + float(x_195)); - } - const float x_202 = uv.y; - if ((x_202 > 0.5f)) { - const int x_207 = obj.numbers[6]; - const float x_210 = color.y; - color.y = (x_210 + float(x_207)); - } - const float x_214 = uv.y; - if ((x_214 > 0.75f)) { - const int x_219 = obj.numbers[7]; - const float x_222 = color.z; - color.z = (x_222 + float(x_219)); - } - const int x_226 = obj.numbers[8]; - const float x_229 = color.z; - color.z = (x_229 + float(x_226)); - const float x_233 = uv.x; - const float x_235 = uv.y; - if ((abs((x_233 - x_235)) < 0.25f)) { - const int x_242 = obj.numbers[9]; - const float x_245 = color.x; - color.x = (x_245 + float(x_242)); - } - const float3 x_249 = normalize(color); - frag_color = float4(x_249.x, x_249.y, x_249.z, 1.0f); - gl_Position = x_GLF_pos; - return; -} - -struct main_out { - float4 frag_color_1; - float4 gl_Position; -}; -struct tint_symbol_1 { - float4 x_GLF_pos_param : TEXCOORD0; -}; -struct tint_symbol_2 { - float4 frag_color_1 : TEXCOORD0; - float4 gl_Position : SV_Position; -}; - -main_out main_inner(float4 x_GLF_pos_param) { - x_GLF_pos = x_GLF_pos_param; - main_1(); - const main_out tint_symbol_5 = {frag_color, gl_Position}; - return tint_symbol_5; -} - -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.x_GLF_pos_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; - wrapper_result.frag_color_1 = inner_result.frag_color_1; - wrapper_result.gl_Position = inner_result.gl_Position; - return wrapper_result; -} -C:\src\tint\test\Shader@0x00000203506D3380(133,7-22): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x00000203506D3380(132,12-45): error X3531: can't unroll loops marked with loop attribute - diff --git a/test/vk-gl-cts/graphicsfuzz/undefined-assign-in-infinite-loop/0.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/undefined-assign-in-infinite-loop/0.spvasm.expected.hlsl index b7efb3de8a..e2ee6458b6 100755 --- a/test/vk-gl-cts/graphicsfuzz/undefined-assign-in-infinite-loop/0.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/undefined-assign-in-infinite-loop/0.spvasm.expected.hlsl @@ -45,5 +45,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x00000256420D6A10(14,19-22): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\u11r8.0:40: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/undefined-assign-in-infinite-loop/0.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/undefined-assign-in-infinite-loop/0.wgsl.expected.hlsl index 318f425d85..89d932e51f 100755 --- a/test/vk-gl-cts/graphicsfuzz/undefined-assign-in-infinite-loop/0.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/undefined-assign-in-infinite-loop/0.wgsl.expected.hlsl @@ -45,5 +45,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x000001BA0B4E7BF0(14,19-22): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\u1v50.0:40: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/unreachable-loops/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/unreachable-loops/0-opt.spvasm.expected.hlsl index 6947f93cab..0bd5e2f973 100755 --- a/test/vk-gl-cts/graphicsfuzz/unreachable-loops/0-opt.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/unreachable-loops/0-opt.spvasm.expected.hlsl @@ -50,7 +50,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x00000252CFFF6880(12,12-23): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] -C:\src\tint\test\Shader@0x00000252CFFF6880(12,12-23): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x00000252CFFF6880(21,19-22): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\u1f84.0:45: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/unreachable-loops/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/unreachable-loops/0-opt.wgsl.expected.hlsl index 6c196a4ead..dea1e99e4f 100755 --- a/test/vk-gl-cts/graphicsfuzz/unreachable-loops/0-opt.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/unreachable-loops/0-opt.wgsl.expected.hlsl @@ -50,7 +50,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x00000229EC6CE4C0(12,12-23): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] -C:\src\tint\test\Shader@0x00000229EC6CE4C0(12,12-23): warning X3557: loop doesn't seem to do anything, consider removing [loop] -C:\src\tint\test\Shader@0x00000229EC6CE4C0(21,19-22): error X3696: infinite loop detected - loop never exits +error: validation errors +C:\src\temp\uk3k.0:45: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/unreachable-return-in-loop/0.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/unreachable-return-in-loop/0.spvasm.expected.hlsl index 7aaf54b7b7..88749bc78c 100755 --- a/test/vk-gl-cts/graphicsfuzz/unreachable-return-in-loop/0.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/unreachable-return-in-loop/0.spvasm.expected.hlsl @@ -54,3 +54,5 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } +Internal compiler error: access violation. Attempted to read from address 0x0000000000000048 + diff --git a/test/vk-gl-cts/graphicsfuzz/unreachable-return-in-loop/0.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/unreachable-return-in-loop/0.wgsl.expected.hlsl index 7aaf54b7b7..88749bc78c 100755 --- a/test/vk-gl-cts/graphicsfuzz/unreachable-return-in-loop/0.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/unreachable-return-in-loop/0.wgsl.expected.hlsl @@ -54,3 +54,5 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } +Internal compiler error: access violation. Attempted to read from address 0x0000000000000048 + diff --git a/test/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.hlsl index 4cdacd993f..8d28303c0c 100755 --- a/test/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.hlsl @@ -1,7 +1,20 @@ SKIP: FAILED -void set_float3(inout float3 vec, int idx, float val) { - vec = (idx.xxx == int3(0, 1, 2)) ? val.xxx : vec; +void set_scalar_float4x3(inout float4x3 mat, int col, int row, float val) { + switch (col) { + case 0: + mat[0] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[0]; + break; + case 1: + mat[1] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[1]; + break; + case 2: + mat[2] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[2]; + break; + case 3: + mat[3] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[3]; + break; + } } cbuffer cbuffer_x_9 : register(b0, space0) { @@ -52,7 +65,7 @@ void main_1() { { [loop] for(; (1 < z); c = (c + 1)) { d = 0; - set_float3(tempm43[(((c >= 0) & (c < 4)) ? c : 0)], (((d >= 0) & (d < 3)) ? d : 0), 1.0f); + set_scalar_float4x3(tempm43, (((d >= 0) & (d < 3)) ? d : 0), (((c >= 0) & (c < 4)) ? c : 0), 1.0f); } } const int x_117 = (((idx >= 0) & (idx < 9)) ? idx : 0); @@ -85,5 +98,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x0000027C57A9E460(51,18-44): error X3531: can't unroll loops marked with loop attribute +error: validation errors +C:\src\temp\umdw.0:93: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.hlsl index da48cd9ac8..4498f291a6 100755 --- a/test/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.hlsl @@ -1,7 +1,20 @@ SKIP: FAILED -void set_float3(inout float3 vec, int idx, float val) { - vec = (idx.xxx == int3(0, 1, 2)) ? val.xxx : vec; +void set_scalar_float4x3(inout float4x3 mat, int col, int row, float val) { + switch (col) { + case 0: + mat[0] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[0]; + break; + case 1: + mat[1] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[1]; + break; + case 2: + mat[2] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[2]; + break; + case 3: + mat[3] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[3]; + break; + } } cbuffer cbuffer_x_9 : register(b0, space0) { @@ -52,15 +65,15 @@ void main_1() { { [loop] for(; (1 < z); c = (c + 1)) { d = 0; - bool tint_tmp = (c >= 0); + bool tint_tmp = (d >= 0); if (tint_tmp) { - tint_tmp = (c < 4); + tint_tmp = (d < 3); } - bool tint_tmp_1 = (d >= 0); + bool tint_tmp_1 = (c >= 0); if (tint_tmp_1) { - tint_tmp_1 = (d < 3); + tint_tmp_1 = (c < 4); } - set_float3(tempm43[((tint_tmp) ? c : 0)], ((tint_tmp_1) ? d : 0), 1.0f); + set_scalar_float4x3(tempm43, ((tint_tmp) ? d : 0), ((tint_tmp_1) ? c : 0), 1.0f); } } bool tint_tmp_2 = (idx >= 0); @@ -97,5 +110,9 @@ tint_symbol main() { wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x0000011E3650E4B0(51,18-44): error X3531: can't unroll loops marked with loop attribute +error: validation errors +C:\src\temp\u1tig.0:105: error: Loop must have break. +Validation failed. + + diff --git a/test/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.spvasm.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.spvasm.expected.hlsl index 28369527f6..029e057178 100644 --- a/test/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.spvasm.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.spvasm.expected.hlsl @@ -268,8 +268,19 @@ void main_1() { const int x_145 = GLF_live4index; const int x_146 = GLF_live4index; const float x_269 = GLF_live4obj.even_numbers[1]; - GLF_live4obj.even_numbers[(((x_144 >= 0) & (x_145 < 10)) ? x_146 : 0)] = x_269; - GLF_live4obj.even_numbers[(((GLF_live4i >= 0) & (GLF_live4i < 10)) ? GLF_live4i : 0)] = 1.0f; + { + float tint_symbol_1[10] = GLF_live4obj.even_numbers; + tint_symbol_1[(((x_144 >= 0) & (x_145 < 10)) ? x_146 : 0)] = x_269; + GLF_live4obj.even_numbers = tint_symbol_1; + } + const int x_147 = GLF_live4i; + const int x_148 = GLF_live4i; + const int x_149 = GLF_live4i; + { + float tint_symbol_3[10] = GLF_live4obj.even_numbers; + tint_symbol_3[(((x_147 >= 0) & (x_148 < 10)) ? x_149 : 0)] = 1.0f; + GLF_live4obj.even_numbers = tint_symbol_3; + } } } param_24 = treeIndex_1; @@ -337,27 +348,27 @@ void main_1() { struct main_out { float4 x_GLF_color_1; }; -struct tint_symbol_1 { +struct tint_symbol_5 { float4 gl_FragCoord_param : SV_Position; }; -struct tint_symbol_2 { +struct tint_symbol_6 { float4 x_GLF_color_1 : SV_Target0; }; main_out main_inner(float4 gl_FragCoord_param) { gl_FragCoord = gl_FragCoord_param; main_1(); - const main_out tint_symbol_4 = {x_GLF_color}; - return tint_symbol_4; + const main_out tint_symbol_8 = {x_GLF_color}; + return tint_symbol_8; } -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; +tint_symbol_6 main(tint_symbol_5 tint_symbol_4) { + const main_out inner_result = main_inner(tint_symbol_4.gl_FragCoord_param); + tint_symbol_6 wrapper_result = (tint_symbol_6)0; wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x0000028F1D72B060(35,10-21): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] -C:\src\tint\test\Shader@0x0000028F1D72B060(270,7-91): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x0000028F1D72B060(259,12-53): error X3531: can't unroll loops marked with loop attribute +C:\src\tint\test\Shader@0x000001F7677BB400(35,10-21): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] +C:\src\tint\test\Shader@0x000001F7677BB400(145,3): warning X4000: use of potentially uninitialized variable (makeFrame_f1_) +internal error: compilation aborted unexpectedly diff --git a/test/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.wgsl.expected.hlsl b/test/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.wgsl.expected.hlsl index dfa33a6fb5..4c1b604e4e 100644 --- a/test/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.wgsl.expected.hlsl +++ b/test/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.wgsl.expected.hlsl @@ -272,16 +272,27 @@ void main_1() { const int x_145 = GLF_live4index; const int x_146 = GLF_live4index; const float x_269 = GLF_live4obj.even_numbers[1]; - bool tint_tmp_1 = (x_144 >= 0); - if (tint_tmp_1) { - tint_tmp_1 = (x_145 < 10); + { + float tint_symbol_1[10] = GLF_live4obj.even_numbers; + bool tint_tmp_1 = (x_144 >= 0); + if (tint_tmp_1) { + tint_tmp_1 = (x_145 < 10); + } + tint_symbol_1[((tint_tmp_1) ? x_146 : 0)] = x_269; + GLF_live4obj.even_numbers = tint_symbol_1; } - GLF_live4obj.even_numbers[((tint_tmp_1) ? x_146 : 0)] = x_269; - bool tint_tmp_2 = (GLF_live4i >= 0); - if (tint_tmp_2) { - tint_tmp_2 = (GLF_live4i < 10); + const int x_147 = GLF_live4i; + const int x_148 = GLF_live4i; + const int x_149 = GLF_live4i; + { + float tint_symbol_3[10] = GLF_live4obj.even_numbers; + bool tint_tmp_2 = (x_147 >= 0); + if (tint_tmp_2) { + tint_tmp_2 = (x_148 < 10); + } + tint_symbol_3[((tint_tmp_2) ? x_149 : 0)] = 1.0f; + GLF_live4obj.even_numbers = tint_symbol_3; } - GLF_live4obj.even_numbers[((tint_tmp_2) ? GLF_live4i : 0)] = 1.0f; } } param_24 = treeIndex_1; @@ -349,27 +360,27 @@ void main_1() { struct main_out { float4 x_GLF_color_1; }; -struct tint_symbol_1 { +struct tint_symbol_5 { float4 gl_FragCoord_param : SV_Position; }; -struct tint_symbol_2 { +struct tint_symbol_6 { float4 x_GLF_color_1 : SV_Target0; }; main_out main_inner(float4 gl_FragCoord_param) { gl_FragCoord = gl_FragCoord_param; main_1(); - const main_out tint_symbol_4 = {x_GLF_color}; - return tint_symbol_4; + const main_out tint_symbol_8 = {x_GLF_color}; + return tint_symbol_8; } -tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param); - tint_symbol_2 wrapper_result = (tint_symbol_2)0; +tint_symbol_6 main(tint_symbol_5 tint_symbol_4) { + const main_out inner_result = main_inner(tint_symbol_4.gl_FragCoord_param); + tint_symbol_6 wrapper_result = (tint_symbol_6)0; wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; return wrapper_result; } -C:\src\tint\test\Shader@0x000001C987F87080(35,10-21): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] -C:\src\tint\test\Shader@0x000001C987F87080(282,7-64): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll -C:\src\tint\test\Shader@0x000001C987F87080(263,12-53): error X3531: can't unroll loops marked with loop attribute +C:\src\tint\test\Shader@0x000001C9889DF080(35,10-21): warning X3557: loop only executes for 0 iteration(s), consider removing [loop] +C:\src\tint\test\Shader@0x000001C9889DF080(149,3): warning X4000: use of potentially uninitialized variable (makeFrame_f1_) +internal error: compilation aborted unexpectedly