diff --git a/src/reader/spirv/function.cc b/src/reader/spirv/function.cc index 2886d25c37..c3c2818854 100644 --- a/src/reader/spirv/function.cc +++ b/src/reader/spirv/function.cc @@ -961,7 +961,7 @@ bool FunctionEmitter::EmitEntryPointAsWrapper() { auto* forced_store_type = store_type; ast::DecorationList param_decos; if (!parser_impl_.ConvertDecorationsForVariable(var_id, &forced_store_type, - ¶m_decos)) { + ¶m_decos, true)) { // This occurs, and is not an error, for the PointSize builtin. if (!success()) { // But exit early if an error was logged. @@ -986,15 +986,23 @@ bool FunctionEmitter::EmitEntryPointAsWrapper() { // variable. ast::Expression* param_value = create(source, param_sym); + ast::Expression* store_dest = + create(source, var_sym); if (HasBuiltinSampleMask(param_decos)) { // In Vulkan SPIR-V, the sample mask is an array. In WGSL it's a scalar. // Use the first element only. - param_value = create( - source, param_value, parser_impl_.MakeNullValue(ty_.I32())); - if (store_type->As()->type->IsSignedScalarOrVector()) { - // sample_mask is unsigned in WGSL. Bitcast it. - param_value = create( - source, ty_.I32()->Build(builder_), param_value); + store_dest = create( + source, store_dest, parser_impl_.MakeNullValue(ty_.I32())); + if (const auto* arr_ty = store_type->UnwrapAlias()->As()) { + if (arr_ty->type->IsSignedScalarOrVector()) { + // sample_mask is unsigned in WGSL. Bitcast it. + param_value = create( + source, ty_.I32()->Build(builder_), param_value); + } + } else { + // Vulkan SPIR-V requires this. Validation should have failed already. + return Fail() + << "expected SampleMask to be an array of integer scalars"; } } else if (forced_store_type != store_type) { // The parameter will have the WGSL type, but we need to add @@ -1003,9 +1011,8 @@ bool FunctionEmitter::EmitEntryPointAsWrapper() { source, store_type->Build(builder_), param_value); } - stmts.push_back(create( - source, create(source, var_sym), - param_value)); + stmts.push_back( + create(source, store_dest, param_value)); } // Call the inner function. It has no parameters. @@ -1053,7 +1060,7 @@ bool FunctionEmitter::EmitEntryPointAsWrapper() { store_type = GetVariableStoreType(*var); param_type = store_type; if (!parser_impl_.ConvertDecorationsForVariable(var_id, ¶m_type, - &out_decos)) { + &out_decos, true)) { // This occurs, and is not an error, for the PointSize builtin. if (!success()) { // But exit early if an error was logged. @@ -1084,10 +1091,16 @@ bool FunctionEmitter::EmitEntryPointAsWrapper() { // Get the first element only. return_member_value = create( source, return_member_value, parser_impl_.MakeNullValue(ty_.I32())); - if (store_type->As()->type->IsSignedScalarOrVector()) { - // sample_mask is unsigned in WGSL. Bitcast it. - return_member_value = create( - source, param_type->Build(builder_), return_member_value); + if (const auto* arr_ty = store_type->UnwrapAlias()->As()) { + if (arr_ty->type->IsSignedScalarOrVector()) { + // sample_mask is unsigned in WGSL. Bitcast it. + return_member_value = create( + source, param_type->Build(builder_), return_member_value); + } + } else { + // Vulkan SPIR-V requires this. Validation should have failed already. + return Fail() + << "expected SampleMask to be an array of integer scalars"; } } else { // No other builtin outputs need signedness conversion. @@ -1096,16 +1109,22 @@ bool FunctionEmitter::EmitEntryPointAsWrapper() { return_exprs.push_back(return_member_value); } - // Create and register the result type. - auto* str = create(Source{}, return_struct_sym, return_members, - ast::DecorationList{}); - parser_impl_.AddTypeDecl(return_struct_sym, str); - return_type = builder_.ty.Of(str); + if (return_members.empty()) { + // This can occur if only the PointSize member is accessed, because we + // never emit it. + return_type = ty_.Void()->Build(builder_); + } else { + // Create and register the result type. + auto* str = create(Source{}, return_struct_sym, + return_members, ast::DecorationList{}); + parser_impl_.AddTypeDecl(return_struct_sym, str); + return_type = builder_.ty.Of(str); - // Add the return-value statement. - stmts.push_back(create( - source, create( - source, return_type, std::move(return_exprs)))); + // Add the return-value statement. + stmts.push_back(create( + source, create( + source, return_type, std::move(return_exprs)))); + } } auto* body = create(source, stmts); @@ -3320,6 +3339,8 @@ bool FunctionEmitter::EmitStatement(const spvtools::opt::Instruction& inst) { return false; } + TypedExpression lhs; + // Handle exceptional cases switch (GetSkipReason(ptr_id)) { case SkipReason::kPointSizeBuiltinPointer: @@ -3332,13 +3353,33 @@ bool FunctionEmitter::EmitStatement(const spvtools::opt::Instruction& inst) { << inst.PrettyPrint(); case SkipReason::kSampleMaskOutBuiltinPointer: - ptr_id = sample_mask_out_id; - if (!rhs.type->Is()) { - // WGSL requires sample_mask_out to be signed. - rhs = TypedExpression{ty_.U32(), - create( - Source{}, builder_.ty.u32(), - ast::ExpressionList{rhs.expr})}; + lhs = MakeExpression(sample_mask_out_id); + if (lhs.type->Is()) { + // LHS of an assignment must be a reference type. + // Convert the LHS to a reference by dereferencing it. + lhs = Dereference(lhs); + } + if (parser_impl_.UseHLSLStylePipelineIO()) { + // In the HLSL-style pipeline IO case, the private variable is an + // array whose element type is already of the same type as the value + // being stored into it. Form the reference into the first element. + lhs.expr = create( + Source{}, lhs.expr, parser_impl_.MakeNullValue(ty_.I32())); + if (auto* ref = lhs.type->As()) { + lhs.type = ref->type; + } + if (auto* arr = lhs.type->As()) { + lhs.type = arr->type; + } + TINT_ASSERT(lhs.type); + } else { + if (!rhs.type->Is()) { + // WGSL requires sample_mask_out to be unsigned. + rhs = TypedExpression{ty_.U32(), + create( + Source{}, builder_.ty.u32(), + ast::ExpressionList{rhs.expr})}; + } } break; default: @@ -3346,7 +3387,9 @@ bool FunctionEmitter::EmitStatement(const spvtools::opt::Instruction& inst) { } // Handle an ordinary store as an assignment. - auto lhs = MakeExpression(ptr_id); + if (!lhs) { + lhs = MakeExpression(ptr_id); + } if (!lhs) { return false; } @@ -3367,6 +3410,7 @@ bool FunctionEmitter::EmitStatement(const spvtools::opt::Instruction& inst) { // So represent a load by a new const definition. const auto ptr_id = inst.GetSingleWordInOperand(0); const auto skip_reason = GetSkipReason(ptr_id); + switch (skip_reason) { case SkipReason::kPointSizeBuiltinPointer: GetDefInfo(inst.result_id())->skip = @@ -3375,7 +3419,6 @@ bool FunctionEmitter::EmitStatement(const spvtools::opt::Instruction& inst) { case SkipReason::kSampleIdBuiltinPointer: case SkipReason::kVertexIndexBuiltinPointer: case SkipReason::kInstanceIndexBuiltinPointer: { - // The SPIR-V variable is i32, but WGSL requires u32. auto name = NameForSpecialInputBuiltin(skip_reason); if (name.empty()) { return Fail() << "internal error: unhandled special input builtin " @@ -3384,30 +3427,30 @@ bool FunctionEmitter::EmitStatement(const spvtools::opt::Instruction& inst) { } ast::Expression* id_expr = create( Source{}, builder_.Symbols().Register(name)); - auto expr = TypedExpression{ - ty_.I32(), - create( - Source{}, builder_.ty.i32(), ast::ExpressionList{id_expr})}; + + auto* loaded_type = parser_impl_.ConvertType(inst.type_id()); + auto expr = TypedExpression{loaded_type, id_expr}; return EmitConstDefinition(inst, expr); } case SkipReason::kSampleMaskInBuiltinPointer: { auto name = namer_.Name(sample_mask_in_id); ast::Expression* id_expr = create( Source{}, builder_.Symbols().Register(name)); - auto* load_result_type = parser_impl_.ConvertType(inst.type_id()); - ast::Expression* ast_expr = nullptr; - if (load_result_type->Is()) { - ast_expr = create( - Source{}, builder_.ty.i32(), ast::ExpressionList{id_expr}); - } else if (load_result_type->Is()) { - ast_expr = id_expr; - } else { + // SampleMask is an array in Vulkan SPIR-V. Always access the first + // element. + id_expr = create( + Source{}, id_expr, parser_impl_.MakeNullValue(ty_.I32())); + + auto* loaded_type = parser_impl_.ConvertType(inst.type_id()); + + if (!loaded_type->IsIntegerScalar()) { return Fail() << "loading the whole SampleMask input array is not " "supported: " << inst.PrettyPrint(); } - return EmitConstDefinition( - inst, TypedExpression{load_result_type, ast_expr}); + + auto expr = TypedExpression{loaded_type, id_expr}; + return EmitConstDefinition(inst, expr); } default: break; diff --git a/src/reader/spirv/function_call_test.cc b/src/reader/spirv/function_call_test.cc index 143694f94b..33e77cd30f 100644 --- a/src/reader/spirv/function_call_test.cc +++ b/src/reader/spirv/function_call_test.cc @@ -58,7 +58,6 @@ TEST_F(SpvParserTest, EmitStatement_VoidCallNoParams) { Return{} } Function $2 -> __void - StageDecoration{vertex} () { Call[not set]{ @@ -68,6 +67,16 @@ TEST_F(SpvParserTest, EmitStatement_VoidCallNoParams) { } Return{} } + Function $3 -> __void + StageDecoration{vertex} + () + { + Call[not set]{ + Identifier[not set]{$2} + ( + ) + } + } } )"; EXPECT_EQ(expect, got); @@ -224,7 +233,7 @@ TEST_F(SpvParserTest, EmitStatement_CallWithParams) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error(); EXPECT_TRUE(p->error().empty()); const auto program_ast_str = p->program().to_str(); - EXPECT_THAT(program_ast_str, HasSubstr(R"(Module{ + const std::string expected = R"(Module{ Function x_50 -> __u32 ( VariableConst{ @@ -251,8 +260,7 @@ TEST_F(SpvParserTest, EmitStatement_CallWithParams) { } } } - Function x_100 -> __void - StageDecoration{vertex} + Function x_100_1 -> __void () { VariableDeclStatement{ @@ -274,7 +282,19 @@ TEST_F(SpvParserTest, EmitStatement_CallWithParams) { } Return{} } -})")) << program_ast_str; + Function x_100 -> __void + StageDecoration{vertex} + () + { + Call[not set]{ + Identifier[not set]{x_100_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(program_ast_str, expected); } } // namespace diff --git a/src/reader/spirv/function_memory_test.cc b/src/reader/spirv/function_memory_test.cc index c032b75ac6..1b30749653 100644 --- a/src/reader/spirv/function_memory_test.cc +++ b/src/reader/spirv/function_memory_test.cc @@ -883,11 +883,20 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_DereferenceBase) { } Return{} } + Function main_1 -> __void + () + { + Return{} + } Function main -> __void StageDecoration{vertex} () { - Return{} + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } } } )"; diff --git a/src/reader/spirv/parser_impl.cc b/src/reader/spirv/parser_impl.cc index 95e50ad5b5..46ad25ac90 100644 --- a/src/reader/spirv/parser_impl.cc +++ b/src/reader/spirv/parser_impl.cc @@ -250,6 +250,7 @@ ParserImpl::ParserImpl(const std::vector& spv_binary) namer_(fail_stream_), enum_converter_(fail_stream_), tools_context_(kInputEnv) { + hlsl_style_pipeline_io_ = true; // Create a message consumer to propagate error messages from SPIRV-Tools // out as our own failures. message_consumer_ = [this](spv_message_level_t level, const char* /*source*/, @@ -1408,12 +1409,9 @@ ast::Variable* ParserImpl::MakeVariable(uint32_t id, sc = ast::StorageClass::kNone; } - // In almost all cases, copy the decorations from SPIR-V to the variable. - // But avoid doing so when converting pipeline IO to private variables. - if (sc != ast::StorageClass::kPrivate) { - if (!ConvertDecorationsForVariable(id, &storage_type, &decorations)) { - return nullptr; - } + if (!ConvertDecorationsForVariable(id, &storage_type, &decorations, + sc != ast::StorageClass::kPrivate)) { + return nullptr; } std::string name = namer_.Name(id); @@ -1427,10 +1425,10 @@ ast::Variable* ParserImpl::MakeVariable(uint32_t id, constructor, decorations); } -bool ParserImpl::ConvertDecorationsForVariable( - uint32_t id, - const Type** type, - ast::DecorationList* decorations) { +bool ParserImpl::ConvertDecorationsForVariable(uint32_t id, + const Type** store_type, + ast::DecorationList* decorations, + bool transfer_pipeline_io) { for (auto& deco : GetDecorationsFor(id)) { if (deco.empty()) { return Fail() << "malformed decoration on ID " << id << ": it is empty"; @@ -1456,10 +1454,12 @@ bool ParserImpl::ConvertDecorationsForVariable( // The SPIR-V variable may signed (because GLSL requires signed for // some of these), but WGSL requires unsigned. Handle specially // so we always perform the conversion at load and store. - if (auto* forced_type = UnsignedTypeFor(*type)) { + special_builtins_[id] = spv_builtin; + if (auto* forced_type = UnsignedTypeFor(*store_type)) { // Requires conversion and special handling in code generation. - special_builtins_[id] = spv_builtin; - *type = forced_type; + if (transfer_pipeline_io) { + *store_type = forced_type; + } } break; case SpvBuiltInSampleMask: { @@ -1473,7 +1473,9 @@ bool ParserImpl::ConvertDecorationsForVariable( "SampleMask must be an array of 1 element."; } special_builtins_[id] = spv_builtin; - *type = ty_.U32(); + if (transfer_pipeline_io) { + *store_type = ty_.U32(); + } break; } default: @@ -1484,16 +1486,20 @@ bool ParserImpl::ConvertDecorationsForVariable( // A diagnostic has already been emitted. return false; } - decorations->emplace_back( - create(Source{}, ast_builtin)); + if (transfer_pipeline_io) { + decorations->emplace_back( + create(Source{}, ast_builtin)); + } } if (deco[0] == SpvDecorationLocation) { if (deco.size() != 2) { return Fail() << "malformed Location decoration on ID " << id << ": requires one literal operand"; } - decorations->emplace_back( - create(Source{}, deco[1])); + if (transfer_pipeline_io) { + decorations->emplace_back( + create(Source{}, deco[1])); + } } if (deco[0] == SpvDecorationDescriptorSet) { if (deco.size() == 1) { diff --git a/src/reader/spirv/parser_impl.h b/src/reader/spirv/parser_impl.h index d303bc026c..60e96cfee7 100644 --- a/src/reader/spirv/parser_impl.h +++ b/src/reader/spirv/parser_impl.h @@ -226,13 +226,16 @@ class ParserImpl : Reader { /// a diagnostic), or when the variable should not be emitted, e.g. for a /// PointSize builtin. /// @param id the ID of the SPIR-V variable - /// @param type the WGSL store type for the variable, which should be + /// @param store_type the WGSL store type for the variable, which should be /// prepopulatd /// @param ast_decos the decoration list to populate + /// @param transfer_pipeline_io true if pipeline IO decorations (builtins, + /// or locations) will update the store type and the decorations list /// @returns false when the variable should not be emitted as a variable bool ConvertDecorationsForVariable(uint32_t id, - const Type** type, - ast::DecorationList* ast_decos); + const Type** store_type, + ast::DecorationList* ast_decos, + bool transfer_pipeline_io); /// Converts a SPIR-V struct member decoration. If the decoration is /// recognized but deliberately dropped, then returns nullptr without a diff --git a/src/reader/spirv/parser_impl_barrier_test.cc b/src/reader/spirv/parser_impl_barrier_test.cc index 08d1b3455c..0f82e00584 100644 --- a/src/reader/spirv/parser_impl_barrier_test.cc +++ b/src/reader/spirv/parser_impl_barrier_test.cc @@ -48,22 +48,28 @@ Program ParseAndBuild(std::string spirv) { TEST_F(SpvParserTest, WorkgroupBarrier) { auto program = ParseAndBuild(R"( + OpName %helper "helper" %void = OpTypeVoid %1 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_2 = OpConstant %uint 2 %uint_264 = OpConstant %uint 264 - %main = OpFunction %void None %1 + %helper = OpFunction %void None %1 %4 = OpLabel OpControlBarrier %uint_2 %uint_2 %uint_264 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %5 = OpLabel + OpReturn + OpFunctionEnd )"); ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str(); - auto* main = program.AST().Functions().Find(program.Symbols().Get("main")); - ASSERT_NE(main, nullptr); - ASSERT_GT(main->body()->size(), 0u); - auto* call = main->body()->get(0)->As(); + auto* helper = + program.AST().Functions().Find(program.Symbols().Get("helper")); + ASSERT_NE(helper, nullptr); + ASSERT_GT(helper->body()->size(), 0u); + auto* call = helper->body()->get(0)->As(); ASSERT_NE(call, nullptr); EXPECT_EQ(call->expr()->params().size(), 0u); auto* sem_call = program.Sem().Get(call->expr()); @@ -75,23 +81,29 @@ TEST_F(SpvParserTest, WorkgroupBarrier) { TEST_F(SpvParserTest, StorageBarrier) { auto program = ParseAndBuild(R"( + OpName %helper "helper" %void = OpTypeVoid %1 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_2 = OpConstant %uint 2 %uint_1 = OpConstant %uint 1 %uint_72 = OpConstant %uint 72 - %main = OpFunction %void None %1 + %helper = OpFunction %void None %1 %4 = OpLabel OpControlBarrier %uint_2 %uint_1 %uint_72 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %5 = OpLabel + OpReturn + OpFunctionEnd )"); ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str(); - auto* main = program.AST().Functions().Find(program.Symbols().Get("main")); - ASSERT_NE(main, nullptr); - ASSERT_GT(main->body()->size(), 0u); - auto* call = main->body()->get(0)->As(); + auto* helper = + program.AST().Functions().Find(program.Symbols().Get("helper")); + ASSERT_NE(helper, nullptr); + ASSERT_GT(helper->body()->size(), 0u); + auto* call = helper->body()->get(0)->As(); ASSERT_NE(call, nullptr); EXPECT_EQ(call->expr()->params().size(), 0u); auto* sem_call = program.Sem().Get(call->expr()); diff --git a/src/reader/spirv/parser_impl_convert_type_test.cc b/src/reader/spirv/parser_impl_convert_type_test.cc index 6268a01728..a6b7d5b93c 100644 --- a/src/reader/spirv/parser_impl_convert_type_test.cc +++ b/src/reader/spirv/parser_impl_convert_type_test.cc @@ -672,7 +672,7 @@ TEST_F(SpvParserTest, ConvertType_PointerInput) { auto* ptr_ty = type->As(); EXPECT_NE(ptr_ty, nullptr); EXPECT_TRUE(ptr_ty->type->Is()); - EXPECT_EQ(ptr_ty->storage_class, ast::StorageClass::kInput); + EXPECT_EQ(ptr_ty->storage_class, ast::StorageClass::kPrivate); EXPECT_TRUE(p->error().empty()); } @@ -688,7 +688,7 @@ TEST_F(SpvParserTest, ConvertType_PointerOutput) { auto* ptr_ty = type->As(); EXPECT_NE(ptr_ty, nullptr); EXPECT_TRUE(ptr_ty->type->Is()); - EXPECT_EQ(ptr_ty->storage_class, ast::StorageClass::kOutput); + EXPECT_EQ(ptr_ty->storage_class, ast::StorageClass::kPrivate); EXPECT_TRUE(p->error().empty()); } @@ -819,12 +819,12 @@ TEST_F(SpvParserTest, ConvertType_PointerToPointer) { auto* ptr_ty = type->As(); EXPECT_NE(ptr_ty, nullptr); - EXPECT_EQ(ptr_ty->storage_class, ast::StorageClass::kInput); + EXPECT_EQ(ptr_ty->storage_class, ast::StorageClass::kPrivate); EXPECT_TRUE(ptr_ty->type->Is()); auto* ptr_ptr_ty = ptr_ty->type->As(); EXPECT_NE(ptr_ptr_ty, nullptr); - EXPECT_EQ(ptr_ptr_ty->storage_class, ast::StorageClass::kOutput); + EXPECT_EQ(ptr_ptr_ty->storage_class, ast::StorageClass::kPrivate); EXPECT_TRUE(ptr_ptr_ty->type->Is()); EXPECT_TRUE(p->error().empty()); diff --git a/src/reader/spirv/parser_impl_function_decl_test.cc b/src/reader/spirv/parser_impl_function_decl_test.cc index afe5437338..e573c8d5b4 100644 --- a/src/reader/spirv/parser_impl_function_decl_test.cc +++ b/src/reader/spirv/parser_impl_function_decl_test.cc @@ -283,14 +283,7 @@ TEST_F(SpvParserTest, EmitFunctions_CalleePrecedesCaller) { } } Return{} - } - Function x_100 -> __void - StageDecoration{vertex} - () - { - Return{} - } -})")) << program_ast; + })")) << program_ast; } TEST_F(SpvParserTest, EmitFunctions_NonVoidResultType) { diff --git a/src/reader/spirv/parser_impl_module_var_test.cc b/src/reader/spirv/parser_impl_module_var_test.cc index e3ff63ce64..e14d7f4f17 100644 --- a/src/reader/spirv/parser_impl_module_var_test.cc +++ b/src/reader/spirv/parser_impl_module_var_test.cc @@ -271,11 +271,8 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinVertexIndex) { const auto module_str = p->program().to_str(); EXPECT_THAT(module_str, HasSubstr(R"( Variable{ - Decorations{ - BuiltinDecoration{vertex_index} - } x_52 - in + private undefined __u32 })")); @@ -305,39 +302,6 @@ std::string PerVertexPreamble() { )"; } -TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_MapsToModuleScopeVec4Var) { - // In Vulkan SPIR-V, Position is the first member of gl_PerVertex - const std::string assembly = PerVertexPreamble() + R"( - %main = OpFunction %void None %voidfn - %entry = OpLabel - OpReturn - OpFunctionEnd -)"; - auto p = parser(test::Assemble(assembly)); - - EXPECT_TRUE(p->BuildAndParseInternalModule()) << assembly; - EXPECT_TRUE(p->error().empty()) << p->error(); - const auto& position_info = p->GetBuiltInPositionInfo(); - EXPECT_EQ(position_info.struct_type_id, 10u); - EXPECT_EQ(position_info.position_member_index, 0u); - EXPECT_EQ(position_info.position_member_type_id, 12u); - EXPECT_EQ(position_info.pointer_type_id, 11u); - EXPECT_EQ(position_info.storage_class, SpvStorageClassOutput); - EXPECT_EQ(position_info.per_vertex_var_id, 1u); - const auto module_str = p->program().to_str(); - EXPECT_THAT(module_str, HasSubstr(R"( - Variable{ - Decorations{ - BuiltinDecoration{position} - } - gl_Position - out - undefined - __vec_4__f32 - })")) - << module_str; -} - TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_StoreWholeStruct_NotSupported) { // Glslang does not generate this code pattern. @@ -552,21 +516,39 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_Write1_IsErased) { EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); EXPECT_EQ(module_str, R"(Module{ + Struct main_out { + StructMember{[[ BuiltinDecoration{position} + ]] gl_Position: __vec_4__f32} + } Variable{ - Decorations{ - BuiltinDecoration{position} - } gl_Position - out + private undefined __vec_4__f32 } - Function main -> __void - StageDecoration{vertex} + Function main_1 -> __void () { Return{} } + Function main -> __type_name_main_out + StageDecoration{vertex} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + Identifier[not set]{gl_Position} + } + } + } + } } )") << module_str; } @@ -610,6 +592,10 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_ReadReplaced) { EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); EXPECT_EQ(module_str, R"(Module{ + Struct main_out { + StructMember{[[ BuiltinDecoration{position} + ]] gl_Position: __vec_4__f32} + } Variable{ x_900 private @@ -617,16 +603,12 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_ReadReplaced) { __f32 } Variable{ - Decorations{ - BuiltinDecoration{position} - } gl_Position - out + private undefined __vec_4__f32 } - Function main -> __void - StageDecoration{vertex} + Function main_1 -> __void () { Assignment{ @@ -635,6 +617,24 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_ReadReplaced) { } Return{} } + Function main -> __type_name_main_out + StageDecoration{vertex} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + Identifier[not set]{gl_Position} + } + } + } + } } )") << module_str; } @@ -680,21 +680,39 @@ TEST_F(SpvModuleScopeVarParserTest, EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); EXPECT_EQ(module_str, R"(Module{ + Struct main_out { + StructMember{[[ BuiltinDecoration{position} + ]] gl_Position: __vec_4__f32} + } Variable{ - Decorations{ - BuiltinDecoration{position} - } gl_Position - out + private undefined __vec_4__f32 } - Function main -> __void - StageDecoration{vertex} + Function main_1 -> __void () { Return{} } + Function main -> __type_name_main_out + StageDecoration{vertex} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + Identifier[not set]{gl_Position} + } + } + } + } } )") << module_str; } @@ -735,11 +753,20 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_Loose_Write1_IsErased) { EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); EXPECT_EQ(module_str, R"(Module{ + Function main_1 -> __void + () + { + Return{} + } Function main -> __void StageDecoration{vertex} () { - Return{} + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } } } )") << module_str; @@ -788,8 +815,7 @@ TEST_F(SpvModuleScopeVarParserTest, undefined __f32 } - Function main -> __void - StageDecoration{vertex} + Function main_1 -> __void () { Assignment{ @@ -798,6 +824,16 @@ TEST_F(SpvModuleScopeVarParserTest, } Return{} } + Function main -> __void + StageDecoration{vertex} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } } )") << module_str; } @@ -842,11 +878,20 @@ TEST_F(SpvModuleScopeVarParserTest, EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); EXPECT_EQ(module_str, R"(Module{ + Function main_1 -> __void + () + { + Return{} + } Function main -> __void StageDecoration{vertex} () { - Return{} + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } } } )") << module_str; @@ -870,11 +915,20 @@ TEST_F(SpvModuleScopeVarParserTest, EXPECT_TRUE(p->error().empty()) << p->error(); const auto module_str = p->program().to_str(); EXPECT_EQ(module_str, R"(Module{ + Function main_1 -> __void + () + { + Return{} + } Function main -> __void StageDecoration{vertex} () { - Return{} + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } } } )") << module_str; @@ -1655,30 +1709,6 @@ TEST_F(SpvModuleScopeVarParserTest, StructUndefInitializer) { p->DeliberatelyInvalidSpirv(); } -TEST_F(SpvModuleScopeVarParserTest, LocationDecoration_Valid) { - auto p = parser(test::Assemble(Preamble() + FragMain() + R"( - OpName %myvar "myvar" - OpDecorate %myvar Location 3 -)" + CommonTypes() + R"( - %ptr = OpTypePointer Input %uint - %myvar = OpVariable %ptr Input - )" + MainBody())); - ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error(); - EXPECT_TRUE(p->error().empty()); - const auto module_str = p->program().to_str(); - EXPECT_THAT(module_str, HasSubstr(R"( - Variable{ - Decorations{ - LocationDecoration{3} - } - myvar - in - undefined - __u32 - })")) - << module_str; -} - TEST_F(SpvModuleScopeVarParserTest, LocationDecoration_MissingOperandWontAssemble) { const auto assembly = Preamble() + FragMain() + R"( @@ -2345,20 +2375,17 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = + R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{sample_index} - } x_1 - in + private undefined - __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + __i32 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -2366,14 +2393,41 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_Direct) { undefined __i32 { - TypeConstructor[not set]{ - __i32 - Identifier[not set]{x_1} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_CopyObject) { @@ -2389,19 +2443,17 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); + // Correct declaration EXPECT_THAT(module_str, HasSubstr(R"( Variable{ - Decorations{ - BuiltinDecoration{sample_index} - } x_1 - in + private undefined - __u32 - })")); + __i32 + })")) < __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + })")) + << module_str; } TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_AccessChain) { @@ -2433,19 +2506,17 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); + // Correct declaration EXPECT_THAT(module_str, HasSubstr(R"( Variable{ - Decorations{ - BuiltinDecoration{sample_index} - } x_1 - in + private undefined - __u32 - })")); + __i32 + })")) < __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } })")) << module_str; } @@ -2502,20 +2593,16 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{sample_index} - } x_1 - in + private undefined __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -2526,8 +2613,36 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_Direct) { Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Identifier[not set]{x_1_param} + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_CopyObject) { @@ -2543,34 +2658,16 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{sample_index} - } x_1 - in + private undefined __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( - VariableDeclStatement{ - VariableConst{ - x_11 - none - undefined - __ptr_in__u32 - { - UnaryOp[not set]{ - address-of - Identifier[not set]{x_1} - } - } - } - } + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -2578,14 +2675,39 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_CopyObject) { undefined __u32 { - UnaryOp[not set]{ - indirection - Identifier[not set]{x_11} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Identifier[not set]{x_1_param} + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_AccessChain) { @@ -2601,20 +2723,16 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{sample_index} - } x_1 - in + private undefined __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -2625,8 +2743,36 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_AccessChain) { Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Identifier[not set]{x_1_param} + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_FunctParam) { @@ -2655,13 +2801,22 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_FunctParam) { // Returns the start of a shader for testing SampleMask // parameterized by store type. -std::string SampleMaskPreamble(std::string store_type) { - return R"( +std::string SampleMaskPreamble(std::string store_type, uint32_t stride = 0u) { + return std::string(R"( OpCapability Shader OpMemoryModel Logical Simple OpEntryPoint Fragment %main "main" %1 OpExecutionMode %main OriginUpperLeft OpDecorate %1 BuiltIn SampleMask +)") + + (stride > 0u ? R"( + OpDecorate %uarr1 ArrayStride 4 + OpDecorate %uarr2 ArrayStride 4 + OpDecorate %iarr1 ArrayStride 4 + OpDecorate %iarr2 ArrayStride 4 +)" + : "") + + R"( %void = OpTypeVoid %voidfn = OpTypeFunction %void %float = OpTypeFloat 32 @@ -2720,19 +2875,17 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); + // Correct declaration EXPECT_THAT(module_str, HasSubstr(R"( Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - in + private undefined - __u32 - })")); + __array__u32_1 + })")) < __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_mask} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + Identifier[not set]{x_1_param} })")) << module_str; } @@ -2764,19 +2944,17 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); + // Correct declaration EXPECT_THAT(module_str, HasSubstr(R"( Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - in + private undefined - __u32 - })")); + __array__u32_1 + })")) < __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_mask} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + Identifier[not set]{x_1_param} })")) << module_str; } @@ -2808,19 +3013,17 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); + // Correct declaration EXPECT_THAT(module_str, HasSubstr(R"( Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - in + private undefined - __u32 - })")); + __array__u32_1 + })")) < __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_mask} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + Identifier[not set]{x_1_param} })")) << module_str; } @@ -2851,20 +3081,16 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - in + private undefined - __u32 - })")); - - // Correct bodies - EXPECT_THAT(module_str, HasSubstr(R"( + __array__i32_1 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_3 @@ -2872,14 +3098,47 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_Direct) { undefined __i32 { - TypeConstructor[not set]{ - __i32 + ArrayAccessor[not set]{ Identifier[not set]{x_1} + ScalarConstructor[not set]{0} } } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_mask} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_CopyObject) { @@ -2898,20 +3157,16 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - in + private undefined - __u32 - })")); - - // Correct bodies - EXPECT_THAT(module_str, HasSubstr(R"( + __array__i32_1 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_4 @@ -2919,14 +3174,47 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_CopyObject) { undefined __i32 { - TypeConstructor[not set]{ - __i32 + ArrayAccessor[not set]{ Identifier[not set]{x_1} + ScalarConstructor[not set]{0} } } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_mask} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_AccessChain) { @@ -2945,20 +3233,16 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - in + private undefined - __u32 - })")); - - // Correct bodies - EXPECT_THAT(module_str, HasSubstr(R"( + __array__i32_1 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_4 @@ -2966,14 +3250,47 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_AccessChain) { undefined __i32 { - TypeConstructor[not set]{ - __i32 + ArrayAccessor[not set]{ Identifier[not set]{x_1} + ScalarConstructor[not set]{0} } } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_mask} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_ArraySize2_Error) { @@ -3010,25 +3327,53 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ + Struct main_out { + StructMember{[[ BuiltinDecoration{sample_mask} + ]] x_1: __u32} + } Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - out + private undefined - __u32 - })")); - - // Correct bodies - EXPECT_THAT(module_str, HasSubstr(R"( + __array__u32_1 + } + Function main_1 -> __void + () + { Assignment{ - Identifier[not set]{x_1} + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } ScalarConstructor[not set]{0u} - })")) - << module_str; + } + Return{} + } + Function main -> __type_name_main_out + StageDecoration{fragment} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + } + } + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_CopyObject) { @@ -3047,25 +3392,53 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ + Struct main_out { + StructMember{[[ BuiltinDecoration{sample_mask} + ]] x_1: __u32} + } Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - out + private undefined - __u32 - })")); - - // Correct bodies - EXPECT_THAT(module_str, HasSubstr(R"( + __array__u32_1 + } + Function main_1 -> __void + () + { Assignment{ - Identifier[not set]{x_1} + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } ScalarConstructor[not set]{0u} - })")) - << module_str; + } + Return{} + } + Function main -> __type_name_main_out + StageDecoration{fragment} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + } + } + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_AccessChain) { @@ -3084,25 +3457,53 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ + Struct main_out { + StructMember{[[ BuiltinDecoration{sample_mask} + ]] x_1: __u32} + } Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - out + private undefined - __u32 - })")); - - // Correct bodies - EXPECT_THAT(module_str, HasSubstr(R"( + __array__u32_1 + } + Function main_1 -> __void + () + { Assignment{ - Identifier[not set]{x_1} + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } ScalarConstructor[not set]{0u} - })")) - << module_str; + } + Return{} + } + Function main -> __type_name_main_out + StageDecoration{fragment} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + } + } + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_I32_Direct) { @@ -3120,31 +3521,55 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_I32_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ + Struct main_out { + StructMember{[[ BuiltinDecoration{sample_mask} + ]] x_1: __u32} + } Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - out + private undefined - __u32 - })")); - - // Correct bodies - EXPECT_THAT(module_str, HasSubstr(R"( + __array__i32_1 + } + Function main_1 -> __void + () { Assignment{ - Identifier[not set]{x_1} - TypeConstructor[not set]{ - __u32 - ScalarConstructor[not set]{12} + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} } + ScalarConstructor[not set]{12} } Return{} - })")) - << module_str; + } + Function main -> __type_name_main_out + StageDecoration{fragment} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + Bitcast[not set]<__u32>{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + } + } + } + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_I32_CopyObject) { @@ -3163,31 +3588,55 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_I32_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ + Struct main_out { + StructMember{[[ BuiltinDecoration{sample_mask} + ]] x_1: __u32} + } Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - out + private undefined - __u32 - })")); - - // Correct bodies - EXPECT_THAT(module_str, HasSubstr(R"( + __array__i32_1 + } + Function main_1 -> __void + () { Assignment{ - Identifier[not set]{x_1} - TypeConstructor[not set]{ - __u32 - ScalarConstructor[not set]{12} + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} } + ScalarConstructor[not set]{12} } Return{} - })")) - << module_str; + } + Function main -> __type_name_main_out + StageDecoration{fragment} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + Bitcast[not set]<__u32>{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + } + } + } + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_I32_AccessChain) { @@ -3206,31 +3655,196 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_I32_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); + const std::string expected = R"(Module{ + Struct main_out { + StructMember{[[ BuiltinDecoration{sample_mask} + ]] x_1: __u32} + } + Variable{ + x_1 + private + undefined + __array__i32_1 + } + Function main_1 -> __void + () + { + Assignment{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + ScalarConstructor[not set]{12} + } + Return{} + } + Function main -> __type_name_main_out + StageDecoration{fragment} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + Bitcast[not set]<__u32>{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + } + } + } + } + } +} +)"; + EXPECT_EQ(module_str, expected); +} + +TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_WithStride) { + const std::string assembly = SampleMaskPreamble("%uarr1", 4u) + R"( + %1 = OpVariable %in_ty Input + + %main = OpFunction %void None %voidfn + %entry = OpLabel + %2 = OpAccessChain %uptr_in_ty %1 %uint_0 + %3 = OpLoad %uint %2 + OpReturn + OpFunctionEnd + )"; + auto p = parser(test::Assemble(assembly)); + ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; + EXPECT_TRUE(p->error().empty()); + const auto module_str = p->program().to_str(); + + EXPECT_THAT(module_str, HasSubstr(R"( + Arr -> __array__u32_1_stride_4 +)")) << module_str; + // Correct declaration EXPECT_THAT(module_str, HasSubstr(R"( Variable{ - Decorations{ - BuiltinDecoration{sample_mask} - } x_1 - out + private undefined - __u32 - })")); - - // Correct bodies - EXPECT_THAT(module_str, HasSubstr(R"( - { - Assignment{ - Identifier[not set]{x_1} - TypeConstructor[not set]{ - __u32 - ScalarConstructor[not set]{12} - } - } - Return{} + __type_name_Arr })")) << module_str; + + // Correct creation of value + EXPECT_THAT(module_str, HasSubstr(R"( + VariableDeclStatement{ + VariableConst{ + x_3 + none + undefined + __u32 + { + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + } + } + })")); + + // Correct parameter on entry point + EXPECT_THAT(module_str, HasSubstr(R"( + Function main -> __void + StageDecoration{fragment} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{sample_mask} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + Identifier[not set]{x_1_param} + })")) + << module_str; +} + +TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_WithStride) { + const std::string assembly = SampleMaskPreamble("%uarr1", 4u) + R"( + %1 = OpVariable %out_ty Output + + %main = OpFunction %void None %voidfn + %entry = OpLabel + %2 = OpAccessChain %uptr_out_ty %1 %uint_0 + OpStore %2 %uint_0 + OpReturn + OpFunctionEnd + )"; + auto p = parser(test::Assemble(assembly)); + ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; + EXPECT_TRUE(p->error().empty()); + const auto module_str = p->program().to_str(); + const std::string expected = R"(Module{ + Arr -> __array__u32_1_stride_4 + Arr_1 -> __array__u32_2_stride_4 + Arr_2 -> __array__i32_1_stride_4 + Arr_3 -> __array__i32_2_stride_4 + Struct main_out { + StructMember{[[ BuiltinDecoration{sample_mask} + ]] x_1: __u32} + } + Variable{ + x_1 + private + undefined + __type_name_Arr + } + Function main_1 -> __void + () + { + Assignment{ + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + ScalarConstructor[not set]{0u} + } + Return{} + } + Function main -> __type_name_main_out + StageDecoration{fragment} + () + { + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + Return{ + { + TypeConstructor[not set]{ + __type_name_main_out + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } + } + } + } + } +} +)"; + EXPECT_EQ(module_str, expected); } // Returns the start of a shader for testing VertexIndex, @@ -3264,20 +3878,16 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{vertex_index} - } x_1 - in + private undefined - __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + __i32 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3285,14 +3895,41 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_Direct) { undefined __i32 { - TypeConstructor[not set]{ - __i32 - Identifier[not set]{x_1} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{vertex_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_CopyObject) { @@ -3308,20 +3945,16 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{vertex_index} - } x_1 - in + private undefined - __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + __i32 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3329,14 +3962,41 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_CopyObject) { undefined __i32 { - TypeConstructor[not set]{ - __i32 - Identifier[not set]{x_1} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{vertex_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_AccessChain) { @@ -3352,20 +4012,16 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{vertex_index} - } x_1 - in + private undefined - __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + __i32 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3373,17 +4029,46 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_AccessChain) { undefined __i32 { - TypeConstructor[not set]{ - __i32 - Identifier[not set]{x_1} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{vertex_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_FunctParam) { + // TODO(dneto): Passing by pointer-to-input is not allowed. + // Remove this test. const std::string assembly = VertexIndexPreamble("%int") + R"( %helper_ty = OpTypeFunction %int %ptr_ty %helper = OpFunction %int None %helper_ty @@ -3421,20 +4106,16 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{vertex_index} - } x_1 - in + private undefined __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3445,8 +4126,36 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_Direct) { Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{vertex_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Identifier[not set]{x_1_param} + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_CopyObject) { @@ -3462,34 +4171,16 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{vertex_index} - } x_1 - in + private undefined __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( - VariableDeclStatement{ - VariableConst{ - x_11 - none - undefined - __ptr_in__u32 - { - UnaryOp[not set]{ - address-of - Identifier[not set]{x_1} - } - } - } - } + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3497,14 +4188,39 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_CopyObject) { undefined __u32 { - UnaryOp[not set]{ - indirection - Identifier[not set]{x_11} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{vertex_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Identifier[not set]{x_1_param} + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_AccessChain) { @@ -3520,20 +4236,16 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{vertex_index} - } x_1 - in + private undefined __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3544,8 +4256,36 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_AccessChain) { Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{vertex_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Identifier[not set]{x_1_param} + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_FunctParam) { @@ -3604,20 +4344,16 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{instance_index} - } x_1 - in + private undefined - __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + __i32 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3625,14 +4361,41 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_Direct) { undefined __i32 { - TypeConstructor[not set]{ - __i32 - Identifier[not set]{x_1} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{instance_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_CopyObject) { @@ -3648,20 +4411,16 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{instance_index} - } x_1 - in + private undefined - __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + __i32 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3669,14 +4428,41 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_CopyObject) { undefined __i32 { - TypeConstructor[not set]{ - __i32 - Identifier[not set]{x_1} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{instance_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_AccessChain) { @@ -3692,20 +4478,16 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{instance_index} - } x_1 - in + private undefined - __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + __i32 + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3713,14 +4495,41 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_AccessChain) { undefined __i32 { - TypeConstructor[not set]{ - __i32 - Identifier[not set]{x_1} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{instance_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Bitcast[not set]<__i32>{ + Identifier[not set]{x_1_param} + } + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected) << module_str; } TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_FunctParam) { @@ -3759,20 +4568,16 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_Direct) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{instance_index} - } x_1 - in + private undefined __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3783,8 +4588,36 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_Direct) { Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{instance_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Identifier[not set]{x_1_param} + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_CopyObject) { @@ -3800,34 +4633,16 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_CopyObject) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{instance_index} - } x_1 - in + private undefined __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( - VariableDeclStatement{ - VariableConst{ - x_11 - none - undefined - __ptr_in__u32 - { - UnaryOp[not set]{ - address-of - Identifier[not set]{x_1} - } - } - } - } + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3835,14 +4650,39 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_CopyObject) { undefined __u32 { - UnaryOp[not set]{ - indirection - Identifier[not set]{x_11} - } + Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{instance_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Identifier[not set]{x_1_param} + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_AccessChain) { @@ -3858,20 +4698,16 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_AccessChain) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto module_str = p->program().to_str(); - // Correct declaration - EXPECT_THAT(module_str, HasSubstr(R"( + const std::string expected = R"(Module{ Variable{ - Decorations{ - BuiltinDecoration{instance_index} - } x_1 - in + private undefined __u32 - })")); - - // Correct body - EXPECT_THAT(module_str, HasSubstr(R"( + } + Function main_1 -> __void + () + { VariableDeclStatement{ VariableConst{ x_2 @@ -3882,8 +4718,36 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_AccessChain) { Identifier[not set]{x_1} } } - })")) - << module_str; + } + Return{} + } + Function main -> __void + StageDecoration{vertex} + ( + VariableConst{ + Decorations{ + BuiltinDecoration{instance_index} + } + x_1_param + none + undefined + __u32 + } + ) + { + Assignment{ + Identifier[not set]{x_1} + Identifier[not set]{x_1_param} + } + Call[not set]{ + Identifier[not set]{main_1} + ( + ) + } + } +} +)"; + EXPECT_EQ(module_str, expected); } TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_FunctParam) { @@ -4098,8 +4962,10 @@ TEST_F(SpvModuleScopeVarParserTest, const auto assembly = Preamble() + FragMain() + R"( OpDecorate %1 BuiltIn SampleMask )" + CommonTypes() + R"( - %ptr_ty = OpTypePointer Output %uint - %1 = OpVariable %ptr_ty Output %uint_1 + %arr_ty = OpTypeArray %uint %uint_1 + %ptr_ty = OpTypePointer Output %arr_ty + %arr_init = OpConstantComposite %arr_ty %uint_2 + %1 = OpVariable %ptr_ty Output %arr_init )" + MainBody(); auto p = parser(test::Assemble(assembly)); @@ -4115,9 +4981,12 @@ TEST_F(SpvModuleScopeVarParserTest, x_1 private undefined - __u32 + __array__u32_1 { - ScalarConstructor[not set]{1u} + TypeConstructor[not set]{ + __array__u32_1 + ScalarConstructor[not set]{2u} + } } } )"; @@ -4131,8 +5000,10 @@ TEST_F(SpvModuleScopeVarParserTest, const auto assembly = Preamble() + FragMain() + R"( OpDecorate %1 BuiltIn SampleMask )" + CommonTypes() + R"( - %ptr_ty = OpTypePointer Output %int - %1 = OpVariable %ptr_ty Output %int_14 + %arr_ty = OpTypeArray %int %uint_1 + %ptr_ty = OpTypePointer Output %arr_ty + %arr_init = OpConstantComposite %arr_ty %int_14 + %1 = OpVariable %ptr_ty Output %arr_init )" + MainBody(); auto p = parser(test::Assemble(assembly)); @@ -4148,9 +5019,12 @@ TEST_F(SpvModuleScopeVarParserTest, x_1 private undefined - __i32 + __array__i32_1 { - ScalarConstructor[not set]{14} + TypeConstructor[not set]{ + __array__i32_1 + ScalarConstructor[not set]{14} + } } } )"; @@ -4333,12 +5207,11 @@ TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_IOLocations) { TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_BuiltinVar_Input_SameSignedness) { - // local_invocation_index is u32 in WGSL. Use uint in SPIR-V. + // instance_index is u32 in WGSL. Use uint in SPIR-V. // No bitcasts are used for parameter formation or return value. const auto assembly = CommonCapabilities() + R"( - OpEntryPoint GLCompute %main "main" %1 - OpExecutionMode %main LocalSize 1 1 1 - OpDecorate %1 BuiltIn LocalInvocationIndex + OpEntryPoint Vertex %main "main" %1 + OpDecorate %1 BuiltIn InstanceIndex )" + CommonTypes() + R"( %ptr_in_uint = OpTypePointer Input %uint @@ -4346,6 +5219,8 @@ TEST_F(SpvModuleScopeVarParserTest, %main = OpFunction %void None %voidfn %entry = OpLabel + %2 = OpLoad %uint %1 ; load same signedness + ;;;; %3 = OpLoad %int %1 ; loading different signedness is invalid. OpReturn OpFunctionEnd )"; @@ -4368,14 +5243,25 @@ TEST_F(SpvModuleScopeVarParserTest, Function main_1 -> __void () { + VariableDeclStatement{ + VariableConst{ + x_2 + none + undefined + __u32 + { + Identifier[not set]{x_1} + } + } + } Return{} } Function main -> __void - StageDecoration{compute} + StageDecoration{vertex} ( VariableConst{ Decorations{ - BuiltinDecoration{local_invocation_index} + BuiltinDecoration{instance_index} } x_1_param none @@ -4401,11 +5287,10 @@ TEST_F(SpvModuleScopeVarParserTest, TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_BuiltinVar_Input_OppositeSignedness) { - // local_invocation_index is u32 in WGSL. Use int in SPIR-V. + // instance_index is u32 in WGSL. Use int in SPIR-V. const auto assembly = CommonCapabilities() + R"( - OpEntryPoint GLCompute %main "main" %1 - OpExecutionMode %main LocalSize 1 1 1 - OpDecorate %1 BuiltIn LocalInvocationIndex + OpEntryPoint Vertex %main "main" %1 + OpDecorate %1 BuiltIn InstanceIndex )" + CommonTypes() + R"( %ptr_in_int = OpTypePointer Input %int @@ -4413,6 +5298,8 @@ TEST_F(SpvModuleScopeVarParserTest, %main = OpFunction %void None %voidfn %entry = OpLabel + %2 = OpLoad %int %1 ; load same signedness + ;;; %3 = OpLoad %uint %1 ; loading different signedness is invalid OpReturn OpFunctionEnd )"; @@ -4435,14 +5322,25 @@ TEST_F(SpvModuleScopeVarParserTest, Function main_1 -> __void () { + VariableDeclStatement{ + VariableConst{ + x_2 + none + undefined + __i32 + { + Identifier[not set]{x_1} + } + } + } Return{} } Function main -> __void - StageDecoration{compute} + StageDecoration{vertex} ( VariableConst{ Decorations{ - BuiltinDecoration{local_invocation_index} + BuiltinDecoration{instance_index} } x_1_param none @@ -4524,11 +5422,11 @@ TEST_F(SpvModuleScopeVarParserTest, ) { Assignment{ - Identifier[not set]{x_1} ArrayAccessor[not set]{ - Identifier[not set]{x_1_param} + Identifier[not set]{x_1} ScalarConstructor[not set]{0} } + Identifier[not set]{x_1_param} } Call[not set]{ Identifier[not set]{main_1} @@ -4596,12 +5494,12 @@ TEST_F(SpvModuleScopeVarParserTest, ) { Assignment{ - Identifier[not set]{x_1} + ArrayAccessor[not set]{ + Identifier[not set]{x_1} + ScalarConstructor[not set]{0} + } Bitcast[not set]<__i32>{ - ArrayAccessor[not set]{ - Identifier[not set]{x_1_param} - ScalarConstructor[not set]{0} - } + Identifier[not set]{x_1_param} } } Call[not set]{ @@ -4841,8 +5739,7 @@ TEST_F(SpvModuleScopeVarParserTest, EXPECT_EQ(got, expected) << got; } -TEST_F(SpvModuleScopeVarParserTest, - BuiltinPosition_BuiltIn_Position_MapsToVec4) { +TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_BuiltIn_Position) { // In Vulkan SPIR-V, Position is the first member of gl_PerVertex const std::string assembly = PerVertexPreamble() + R"( %main = OpFunction %void None %voidfn @@ -4999,11 +5896,10 @@ TEST_F(SpvModuleScopeVarParserTest, EXPECT_EQ(got, expected) << got; } -// TODO(dneto): pipeline IO: read PointSize -// TODO(dneto): pipeline IO: write PointSize - // TODO(dneto): pipeline IO: flatten structures, and distribute locations +// TODO(dneto): Translate Builtin LocalInvocationIndex crbug.com/tint/900 + } // namespace } // namespace spirv } // namespace reader diff --git a/test/access/let/matrix.spvasm.expected.hlsl b/test/access/let/matrix.spvasm.expected.hlsl index 669ba11dbb..7f13ac2aae 100644 --- a/test/access/let/matrix.spvasm.expected.hlsl +++ b/test/access/let/matrix.spvasm.expected.hlsl @@ -1,5 +1,10 @@ -[numthreads(1, 1, 1)] -void main() { +void main_1() { const float x_24 = float3x3(float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f), float3(7.0f, 8.0f, 9.0f))[1u].y; return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/access/let/matrix.spvasm.expected.msl b/test/access/let/matrix.spvasm.expected.msl index 2f5de98dbc..2123a38a6c 100644 --- a/test/access/let/matrix.spvasm.expected.msl +++ b/test/access/let/matrix.spvasm.expected.msl @@ -1,8 +1,13 @@ #include using namespace metal; -kernel void tint_symbol() { +void main_1() { float const x_24 = float3x3(float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f), float3(7.0f, 8.0f, 9.0f))[1u].y; return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/access/let/matrix.spvasm.expected.spvasm b/test/access/let/matrix.spvasm.expected.spvasm index fac85ae666..7556cb3a49 100644 --- a/test/access/let/matrix.spvasm.expected.spvasm +++ b/test/access/let/matrix.spvasm.expected.spvasm @@ -1,12 +1,13 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 28 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 + OpName %main_1 "main_1" OpName %main "main" %void = OpTypeVoid %1 = OpTypeFunction %void @@ -28,9 +29,14 @@ %20 = OpConstantComposite %mat3v3float %11 %15 %19 %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %23 = OpCompositeExtract %v3float %20 1 %24 = OpCompositeExtract %float %23 1 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %26 = OpLabel + %27 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/access/let/matrix.spvasm.expected.wgsl b/test/access/let/matrix.spvasm.expected.wgsl index 1dc7497031..156324f5b7 100644 --- a/test/access/let/matrix.spvasm.expected.wgsl +++ b/test/access/let/matrix.spvasm.expected.wgsl @@ -1,5 +1,9 @@ -[[stage(compute)]] -fn main() { +fn main_1() { let x_24 : f32 = mat3x3(vec3(1.0, 2.0, 3.0), vec3(4.0, 5.0, 6.0), vec3(7.0, 8.0, 9.0))[1u].y; return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/access/let/vector.spvasm.expected.hlsl b/test/access/let/vector.spvasm.expected.hlsl index d6ea890c6a..cc37e54310 100644 --- a/test/access/let/vector.spvasm.expected.hlsl +++ b/test/access/let/vector.spvasm.expected.hlsl @@ -1,7 +1,12 @@ -[numthreads(1, 1, 1)] -void main() { +void main_1() { const float x_11 = float3(1.0f, 2.0f, 3.0f).y; const float2 x_13 = float2(float3(1.0f, 2.0f, 3.0f).x, float3(1.0f, 2.0f, 3.0f).z); const float3 x_14 = float3(float3(1.0f, 2.0f, 3.0f).x, float3(1.0f, 2.0f, 3.0f).z, float3(1.0f, 2.0f, 3.0f).y); return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/access/let/vector.spvasm.expected.msl b/test/access/let/vector.spvasm.expected.msl index 60e701cd82..d644226025 100644 --- a/test/access/let/vector.spvasm.expected.msl +++ b/test/access/let/vector.spvasm.expected.msl @@ -1,10 +1,15 @@ #include using namespace metal; -kernel void tint_symbol() { +void main_1() { float const x_11 = float3(1.0f, 2.0f, 3.0f).y; float2 const x_13 = float2(float3(1.0f, 2.0f, 3.0f).x, float3(1.0f, 2.0f, 3.0f).z); float3 const x_14 = float3(float3(1.0f, 2.0f, 3.0f).x, float3(1.0f, 2.0f, 3.0f).z, float3(1.0f, 2.0f, 3.0f).y); return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/access/let/vector.spvasm.expected.spvasm b/test/access/let/vector.spvasm.expected.spvasm index 67e9f432b8..5b2e1625c3 100644 --- a/test/access/let/vector.spvasm.expected.spvasm +++ b/test/access/let/vector.spvasm.expected.spvasm @@ -1,12 +1,13 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 20 +; Bound: 23 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 + OpName %main_1 "main_1" OpName %main "main" %void = OpTypeVoid %1 = OpTypeFunction %void @@ -17,7 +18,7 @@ %float_3 = OpConstant %float 3 %10 = OpConstantComposite %v3float %float_1 %float_2 %float_3 %v2float = OpTypeVector %float 2 - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %11 = OpCompositeExtract %float %10 1 %13 = OpCompositeExtract %float %10 0 @@ -29,3 +30,8 @@ %19 = OpCompositeConstruct %v3float %16 %17 %18 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %21 = OpLabel + %22 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/access/let/vector.spvasm.expected.wgsl b/test/access/let/vector.spvasm.expected.wgsl index c739e6c2e6..3c3957fafc 100644 --- a/test/access/let/vector.spvasm.expected.wgsl +++ b/test/access/let/vector.spvasm.expected.wgsl @@ -1,7 +1,11 @@ -[[stage(compute)]] -fn main() { +fn main_1() { let x_11 : f32 = vec3(1.0, 2.0, 3.0).y; let x_13 : vec2 = vec2(vec3(1.0, 2.0, 3.0).x, vec3(1.0, 2.0, 3.0).z); let x_14 : vec3 = vec3(vec3(1.0, 2.0, 3.0).x, vec3(1.0, 2.0, 3.0).z, vec3(1.0, 2.0, 3.0).y); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/access/var/matrix.spvasm.expected.hlsl b/test/access/var/matrix.spvasm.expected.hlsl index cd29235dc7..6f7cb680f3 100644 --- a/test/access/var/matrix.spvasm.expected.hlsl +++ b/test/access/var/matrix.spvasm.expected.hlsl @@ -1,7 +1,12 @@ -[numthreads(1, 1, 1)] -void main() { +void main_1() { float3x3 m = float3x3(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); const float3 x_15 = m[1]; const float x_16 = x_15.y; return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/access/var/matrix.spvasm.expected.msl b/test/access/var/matrix.spvasm.expected.msl index 12a0b73e64..e22abd0eeb 100644 --- a/test/access/var/matrix.spvasm.expected.msl +++ b/test/access/var/matrix.spvasm.expected.msl @@ -1,10 +1,15 @@ #include using namespace metal; -kernel void tint_symbol() { +void main_1() { float3x3 m = float3x3(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); float3 const x_15 = m[1]; float const x_16 = x_15.y; return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/access/var/matrix.spvasm.expected.spvasm b/test/access/var/matrix.spvasm.expected.spvasm index 9cf8d9058b..299c71c3a0 100644 --- a/test/access/var/matrix.spvasm.expected.spvasm +++ b/test/access/var/matrix.spvasm.expected.spvasm @@ -1,14 +1,15 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 20 +; Bound: 23 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 - OpName %main "main" + OpName %main_1 "main_1" OpName %m "m" + OpName %main "main" %void = OpTypeVoid %1 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -22,7 +23,7 @@ %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v3float = OpTypePointer Function %v3float - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %m = OpVariable %_ptr_Function_mat3v3float Function %13 OpStore %m %10 @@ -31,3 +32,8 @@ %19 = OpCompositeExtract %float %18 1 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %21 = OpLabel + %22 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/access/var/matrix.spvasm.expected.wgsl b/test/access/var/matrix.spvasm.expected.wgsl index 58222f5914..851efcce1a 100644 --- a/test/access/var/matrix.spvasm.expected.wgsl +++ b/test/access/var/matrix.spvasm.expected.wgsl @@ -1,7 +1,11 @@ -[[stage(compute)]] -fn main() { +fn main_1() { var m : mat3x3 = mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)); let x_15 : vec3 = m[1]; let x_16 : f32 = x_15.y; return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/access/var/vector.spvasm.expected.hlsl b/test/access/var/vector.spvasm.expected.hlsl index 1517faa1c5..eac892152b 100644 --- a/test/access/var/vector.spvasm.expected.hlsl +++ b/test/access/var/vector.spvasm.expected.hlsl @@ -1,5 +1,4 @@ -[numthreads(1, 1, 1)] -void main() { +void main_1() { float3 v = float3(0.0f, 0.0f, 0.0f); const float x_14 = v.y; const float3 x_16 = v; @@ -8,3 +7,9 @@ void main() { const float3 x_19 = float3(x_18.x, x_18.z, x_18.y); return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/access/var/vector.spvasm.expected.msl b/test/access/var/vector.spvasm.expected.msl index fb9d00891c..a0bb9e4d5d 100644 --- a/test/access/var/vector.spvasm.expected.msl +++ b/test/access/var/vector.spvasm.expected.msl @@ -1,7 +1,7 @@ #include using namespace metal; -kernel void tint_symbol() { +void main_1() { float3 v = float3(0.0f, 0.0f, 0.0f); float const x_14 = v.y; float3 const x_16 = v; @@ -11,3 +11,8 @@ kernel void tint_symbol() { return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/access/var/vector.spvasm.expected.spvasm b/test/access/var/vector.spvasm.expected.spvasm index 02f8dbcc98..de0f9d0173 100644 --- a/test/access/var/vector.spvasm.expected.spvasm +++ b/test/access/var/vector.spvasm.expected.spvasm @@ -1,14 +1,15 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 30 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 - OpName %main "main" + OpName %main_1 "main_1" OpName %v "v" + OpName %main "main" %void = OpTypeVoid %1 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -21,7 +22,7 @@ %uint_1 = OpConstant %uint 1 %_ptr_Function_float = OpTypePointer Function %float %v2float = OpTypeVector %float 2 - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %v = OpVariable %_ptr_Function_v3float Function %11 OpStore %v %8 @@ -38,3 +39,8 @@ %26 = OpCompositeConstruct %v3float %23 %24 %25 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %28 = OpLabel + %29 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/access/var/vector.spvasm.expected.wgsl b/test/access/var/vector.spvasm.expected.wgsl index 0688604665..ced274e1dc 100644 --- a/test/access/var/vector.spvasm.expected.wgsl +++ b/test/access/var/vector.spvasm.expected.wgsl @@ -1,5 +1,4 @@ -[[stage(compute)]] -fn main() { +fn main_1() { var v : vec3 = vec3(0.0, 0.0, 0.0); let x_14 : f32 = v.y; let x_16 : vec3 = v; @@ -8,3 +7,8 @@ fn main() { let x_19 : vec3 = vec3(x_18.x, x_18.z, x_18.y); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/array/assign_to_function_var.wgsl.expected.msl b/test/array/assign_to_function_var.wgsl.expected.msl index 0ae6e421f7..7dec2d0ba4 100644 --- a/test/array/assign_to_function_var.wgsl.expected.msl +++ b/test/array/assign_to_function_var.wgsl.expected.msl @@ -1 +1,53 @@ -SKIP: crbug.com/tint/649 +#include + +using namespace metal; +struct tint_padded_array_element { + /* 0x0000 */ int el; + /* 0x0004 */ int8_t tint_pad_0[12]; +}; +struct tint_array_wrapper { + /* 0x0000 */ tint_padded_array_element arr[4]; +}; +struct S { + /* 0x0000 */ tint_array_wrapper arr; +}; +struct tint_array_wrapper_3 { + int arr[2]; +}; +struct tint_array_wrapper_2 { + tint_array_wrapper_3 arr[3]; +}; +struct tint_array_wrapper_1 { + tint_array_wrapper_2 arr[4]; +}; + +tint_array_wrapper ret_arr() { + tint_array_wrapper const tint_symbol = {.arr={}}; + return tint_symbol; +} + +S ret_struct_arr() { + S const tint_symbol_1 = {}; + return tint_symbol_1; +} + +void foo(constant S& src_uniform, device S& src_storage, tint_array_wrapper src_param, thread tint_array_wrapper* const tint_symbol_3, threadgroup tint_array_wrapper* const tint_symbol_4) { + tint_array_wrapper src_function = {}; + tint_array_wrapper dst = {}; + tint_array_wrapper const tint_symbol_2 = {.arr={{.el=1}, {.el=2}, {.el=3}, {.el=3}}}; + dst = tint_symbol_2; + dst = src_param; + dst = ret_arr(); + tint_array_wrapper const src_let = {.arr={}}; + dst = src_let; + dst = src_function; + dst = *(tint_symbol_3); + dst = *(tint_symbol_4); + dst = ret_struct_arr().arr; + dst = src_uniform.arr; + dst = src_storage.arr; + tint_array_wrapper_1 dst_nested = {}; + tint_array_wrapper_1 src_nested = {}; + dst_nested = src_nested; +} + diff --git a/test/array/assign_to_private_var.wgsl.expected.msl b/test/array/assign_to_private_var.wgsl.expected.msl index 0ae6e421f7..322db3b109 100644 --- a/test/array/assign_to_private_var.wgsl.expected.msl +++ b/test/array/assign_to_private_var.wgsl.expected.msl @@ -1 +1,51 @@ -SKIP: crbug.com/tint/649 +#include + +using namespace metal; +struct tint_padded_array_element { + /* 0x0000 */ int el; + /* 0x0004 */ int8_t tint_pad_0[12]; +}; +struct tint_array_wrapper { + /* 0x0000 */ tint_padded_array_element arr[4]; +}; +struct S { + /* 0x0000 */ tint_array_wrapper arr; +}; +struct tint_array_wrapper_3 { + int arr[2]; +}; +struct tint_array_wrapper_2 { + tint_array_wrapper_3 arr[3]; +}; +struct tint_array_wrapper_1 { + tint_array_wrapper_2 arr[4]; +}; + +tint_array_wrapper ret_arr() { + tint_array_wrapper const tint_symbol = {.arr={}}; + return tint_symbol; +} + +S ret_struct_arr() { + S const tint_symbol_1 = {}; + return tint_symbol_1; +} + +void foo(constant S& src_uniform, device S& src_storage, tint_array_wrapper src_param, thread tint_array_wrapper* const tint_symbol_3, thread tint_array_wrapper* const tint_symbol_4, threadgroup tint_array_wrapper* const tint_symbol_5, thread tint_array_wrapper_1* const tint_symbol_6) { + tint_array_wrapper src_function = {}; + tint_array_wrapper const tint_symbol_2 = {.arr={{.el=1}, {.el=2}, {.el=3}, {.el=3}}}; + *(tint_symbol_3) = tint_symbol_2; + *(tint_symbol_3) = src_param; + *(tint_symbol_3) = ret_arr(); + tint_array_wrapper const src_let = {.arr={}}; + *(tint_symbol_3) = src_let; + *(tint_symbol_3) = src_function; + *(tint_symbol_3) = *(tint_symbol_4); + *(tint_symbol_3) = *(tint_symbol_5); + *(tint_symbol_3) = ret_struct_arr().arr; + *(tint_symbol_3) = src_uniform.arr; + *(tint_symbol_3) = src_storage.arr; + tint_array_wrapper_1 src_nested = {}; + *(tint_symbol_6) = src_nested; +} + diff --git a/test/array/assign_to_storage_var.wgsl.expected.msl b/test/array/assign_to_storage_var.wgsl.expected.msl index 0ae6e421f7..f0a241a6fc 100644 --- a/test/array/assign_to_storage_var.wgsl.expected.msl +++ b/test/array/assign_to_storage_var.wgsl.expected.msl @@ -1 +1,54 @@ -SKIP: crbug.com/tint/649 +#include + +using namespace metal; +struct tint_padded_array_element { + /* 0x0000 */ int el; + /* 0x0004 */ int8_t tint_pad_0[12]; +}; +struct tint_array_wrapper { + /* 0x0000 */ tint_padded_array_element arr[4]; +}; +struct S { + /* 0x0000 */ tint_array_wrapper arr; +}; +struct tint_array_wrapper_3 { + /* 0x0000 */ int arr[2]; +}; +struct tint_array_wrapper_2 { + /* 0x0000 */ tint_array_wrapper_3 arr[3]; +}; +struct tint_array_wrapper_1 { + /* 0x0000 */ tint_array_wrapper_2 arr[4]; +}; +struct S_nested { + /* 0x0000 */ tint_array_wrapper_1 arr; +}; + +tint_array_wrapper ret_arr() { + tint_array_wrapper const tint_symbol = {.arr={}}; + return tint_symbol; +} + +S ret_struct_arr() { + S const tint_symbol_1 = {}; + return tint_symbol_1; +} + +void foo(constant S& src_uniform, device S& dst, device S& src_storage, device S_nested& dst_nested, tint_array_wrapper src_param, thread tint_array_wrapper* const tint_symbol_3, threadgroup tint_array_wrapper* const tint_symbol_4) { + tint_array_wrapper src_function = {}; + tint_array_wrapper const tint_symbol_2 = {.arr={{.el=1}, {.el=2}, {.el=3}, {.el=3}}}; + dst.arr = tint_symbol_2; + dst.arr = src_param; + dst.arr = ret_arr(); + tint_array_wrapper const src_let = {.arr={}}; + dst.arr = src_let; + dst.arr = src_function; + dst.arr = *(tint_symbol_3); + dst.arr = *(tint_symbol_4); + dst.arr = ret_struct_arr().arr; + dst.arr = src_uniform.arr; + dst.arr = src_storage.arr; + tint_array_wrapper_1 src_nested = {}; + dst_nested.arr = src_nested; +} + diff --git a/test/array/assign_to_workgroup_var.wgsl.expected.msl b/test/array/assign_to_workgroup_var.wgsl.expected.msl index 0ae6e421f7..242b669dbf 100644 --- a/test/array/assign_to_workgroup_var.wgsl.expected.msl +++ b/test/array/assign_to_workgroup_var.wgsl.expected.msl @@ -1 +1,51 @@ -SKIP: crbug.com/tint/649 +#include + +using namespace metal; +struct tint_padded_array_element { + /* 0x0000 */ int el; + /* 0x0004 */ int8_t tint_pad_0[12]; +}; +struct tint_array_wrapper { + /* 0x0000 */ tint_padded_array_element arr[4]; +}; +struct S { + /* 0x0000 */ tint_array_wrapper arr; +}; +struct tint_array_wrapper_3 { + int arr[2]; +}; +struct tint_array_wrapper_2 { + tint_array_wrapper_3 arr[3]; +}; +struct tint_array_wrapper_1 { + tint_array_wrapper_2 arr[4]; +}; + +tint_array_wrapper ret_arr() { + tint_array_wrapper const tint_symbol = {.arr={}}; + return tint_symbol; +} + +S ret_struct_arr() { + S const tint_symbol_1 = {}; + return tint_symbol_1; +} + +void foo(constant S& src_uniform, device S& src_storage, tint_array_wrapper src_param, threadgroup tint_array_wrapper* const tint_symbol_3, thread tint_array_wrapper* const tint_symbol_4, threadgroup tint_array_wrapper* const tint_symbol_5, threadgroup tint_array_wrapper_1* const tint_symbol_6) { + tint_array_wrapper src_function = {}; + tint_array_wrapper const tint_symbol_2 = {.arr={{.el=1}, {.el=2}, {.el=3}, {.el=3}}}; + *(tint_symbol_3) = tint_symbol_2; + *(tint_symbol_3) = src_param; + *(tint_symbol_3) = ret_arr(); + tint_array_wrapper const src_let = {.arr={}}; + *(tint_symbol_3) = src_let; + *(tint_symbol_3) = src_function; + *(tint_symbol_3) = *(tint_symbol_4); + *(tint_symbol_3) = *(tint_symbol_5); + *(tint_symbol_3) = ret_struct_arr().arr; + *(tint_symbol_3) = src_uniform.arr; + *(tint_symbol_3) = src_storage.arr; + tint_array_wrapper_1 src_nested = {}; + *(tint_symbol_6) = src_nested; +} + diff --git a/test/bug/tint/413.spvasm.expected.hlsl b/test/bug/tint/413.spvasm.expected.hlsl index d933074cf9..d285a8d527 100644 --- a/test/bug/tint/413.spvasm.expected.hlsl +++ b/test/bug/tint/413.spvasm.expected.hlsl @@ -1,8 +1,7 @@ Texture2D Src : register(t0, space0); RWTexture2D Dst : register(u1, space0); -[numthreads(1, 1, 1)] -void main() { +void main_1() { uint4 srcValue = uint4(0u, 0u, 0u, 0u); const uint4 x_18 = Src.Load(int3(0, 0, 0)); srcValue = x_18; @@ -12,3 +11,9 @@ void main() { Dst[int2(0, 0)] = x_27; return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/bug/tint/413.spvasm.expected.spvasm b/test/bug/tint/413.spvasm.expected.spvasm index cbaa55dd7a..82c549f5bd 100644 --- a/test/bug/tint/413.spvasm.expected.spvasm +++ b/test/bug/tint/413.spvasm.expected.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 35 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 @@ -9,8 +9,9 @@ OpExecutionMode %main LocalSize 1 1 1 OpName %Src "Src" OpName %Dst "Dst" - OpName %main "main" + OpName %main_1 "main_1" OpName %srcValue "srcValue" + OpName %main "main" OpDecorate %Src NonWritable OpDecorate %Src DescriptorSet 0 OpDecorate %Src Binding 0 @@ -35,7 +36,7 @@ %uint_0 = OpConstant %uint 0 %_ptr_Function_uint = OpTypePointer Function %uint %int_1 = OpConstant %int 1 - %main = OpFunction %void None %7 + %main_1 = OpFunction %void None %7 %10 = OpLabel %srcValue = OpVariable %_ptr_Function_v4uint Function %14 %16 = OpLoad %3 %Src @@ -52,3 +53,8 @@ OpImageWrite %31 %20 %29 OpReturn OpFunctionEnd + %main = OpFunction %void None %7 + %33 = OpLabel + %34 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/bug/tint/413.spvasm.expected.wgsl b/test/bug/tint/413.spvasm.expected.wgsl index 071a0cc544..5a581e82d2 100644 --- a/test/bug/tint/413.spvasm.expected.wgsl +++ b/test/bug/tint/413.spvasm.expected.wgsl @@ -2,8 +2,7 @@ [[group(0), binding(1)]] var Dst : texture_storage_2d; -[[stage(compute)]] -fn main() { +fn main_1() { var srcValue : vec4; let x_18 : vec4 = textureLoad(Src, vec2(0, 0)); srcValue = x_18; @@ -14,3 +13,8 @@ fn main() { textureStore(Dst, vec2(0, 0), x_27); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/bug/tint/749.spvasm.expected.hlsl b/test/bug/tint/749.spvasm.expected.hlsl index 3697b88b83..c241a45fa9 100644 --- a/test/bug/tint/749.spvasm.expected.hlsl +++ b/test/bug/tint/749.spvasm.expected.hlsl @@ -1,10 +1,1563 @@ -SKIP: FAILED +struct tint_array_wrapper { + int arr[10]; +}; +struct QuicksortObject { + tint_array_wrapper numbers; +}; +struct buf0 { + /* 0x0000 */ float2 resolution; +}; -../src/writer/hlsl/generator_impl.cc:1547 internal compiler error: unhandled storage class in -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +static QuicksortObject obj; +static float4 gl_FragCoord; +ConstantBuffer x_188 : register(b0, space0); +static float4 x_GLF_color; +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.arr[x_30_save]; + obj.numbers.arr[x_30_save] = 0; + obj.numbers.arr[x_30_save] = x_936; + const int x_31 = obj.numbers.arr[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.arr[x_30_save]; + obj.numbers.arr[x_30_save] = 0; + obj.numbers.arr[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.arr[x_30_save]; + obj.numbers.arr[x_30_save] = 0; + obj.numbers.arr[x_30_save] = x_942; + const int x_34_save = x_33; + const int x_35 = obj.numbers.arr[x_34_save]; + const QuicksortObject x_943 = obj; + const tint_array_wrapper tint_symbol_4 = {{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.arr[x_36_save] = x_35; + const QuicksortObject x_944 = obj; + const tint_array_wrapper tint_symbol_6 = {{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.arr[x_34_save]; + obj.numbers.arr[x_34_save] = 0; + obj.numbers.arr[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.arr[x_36_save]; + obj.numbers.arr[x_36_save] = 0; + obj.numbers.arr[x_36_save] = x_949; + const QuicksortObject x_950 = obj; + const tint_array_wrapper tint_symbol_8 = {{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.arr[x_34_save]; + obj.numbers.arr[x_34_save] = 0; + obj.numbers.arr[x_34_save] = x_951; + obj.numbers.arr[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.arr[x_42_save]; + obj.numbers.arr[x_42_save] = 0; + obj.numbers.arr[x_42_save] = x_954; + const int x_43 = obj.numbers.arr[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 tint_array_wrapper tint_symbol_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; + 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 tint_array_wrapper tint_symbol_12 = {{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.arr[x_42_save]; + obj.numbers.arr[x_42_save] = 0; + obj.numbers.arr[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.arr[x_61_save]; + const QuicksortObject x_972 = obj; + const tint_array_wrapper tint_symbol_14 = {{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; + const int x_72 = j_1; + param_1 = x_72; + 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 tint_array_wrapper tint_symbol_16 = {{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.arr[x_61_save]; + obj.numbers.arr[x_61_save] = 0; + obj.numbers.arr[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.arr[x_61_save]; + obj.numbers.arr[x_61_save] = 0; + obj.numbers.arr[x_61_save] = x_992; + } + } + const int x_76 = i_1; + const int x_993 = obj.numbers.arr[x_42_save]; + obj.numbers.arr[x_42_save] = 0; + obj.numbers.arr[x_42_save] = x_993; + const float2 x_549 = float2(x_534.x, x_534.y); + const QuicksortObject x_994 = obj; + const tint_array_wrapper tint_symbol_18 = {{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; + tint_array_wrapper stack = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 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 tint_array_wrapper x_1008 = stack; + const tint_array_wrapper tint_symbol_20 = {{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 tint_array_wrapper tint_symbol_21 = {{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 tint_array_wrapper x_1017 = stack; + const tint_array_wrapper tint_symbol_23 = {{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.arr[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.arr[x_96_save]; + stack.arr[x_96_save] = 0; + stack.arr[x_96_save] = x_1021; + const int x_98 = (x_97 + 1); + const int x_1022 = stack.arr[x_96_save]; + stack.arr[x_96_save] = 0; + stack.arr[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.arr[x_100_save] = x_99; + 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 tint_array_wrapper x_1029 = stack; + const tint_array_wrapper tint_symbol_24 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; + stack = tint_symbol_24; + stack = x_1029; + const int x_106 = top; + const tint_array_wrapper x_1030 = stack; + const tint_array_wrapper tint_symbol_25 = {{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 tint_array_wrapper tint_symbol_26 = {{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.arr[x_96_save]; + stack.arr[x_96_save] = 0; + stack.arr[x_96_save] = x_1037; + const int x_111 = stack.arr[x_110_save]; + const tint_array_wrapper x_1038 = stack; + const tint_array_wrapper tint_symbol_28 = {{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 tint_array_wrapper x_1040 = stack; + const tint_array_wrapper tint_symbol_29 = {{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.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[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.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[x_100_save] = x_1046; + const int x_115 = stack.arr[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; + const int x_118 = l_1; + param_4 = x_118; + const int x_1050 = stack.arr[x_110_save]; + stack.arr[x_110_save] = 0; + stack.arr[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.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[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.arr[x_110_save]; + stack.arr[x_110_save] = 0; + stack.arr[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.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[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.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[x_100_save] = x_1061; + const tint_array_wrapper x_1062 = stack; + const tint_array_wrapper tint_symbol_30 = {{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.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[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.arr[x_110_save]; + stack.arr[x_110_save] = 0; + stack.arr[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.arr[x_131_save] = x_130; + const int x_132 = top; + const int x_1067 = stack.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[x_100_save] = x_1067; + const float2 x_588 = float2(x_575.y, x_575.x); + const int x_1068 = stack.arr[x_131_save]; + stack.arr[x_131_save] = 0; + stack.arr[x_131_save] = x_1068; + const int x_133 = asint((1u + asuint(x_132))); + const int x_1069 = stack.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[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 tint_array_wrapper x_1071 = stack; + const tint_array_wrapper tint_symbol_31 = {{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.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[x_114_save] = x_1072; + const int x_136_save = x_133; + const int x_1073 = stack.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[x_114_save] = x_1073; + stack.arr[x_136_save] = (x_134 - asint(1u)); + const int x_1074 = stack.arr[x_96_save]; + stack.arr[x_96_save] = 0; + stack.arr[x_96_save] = x_1074; + const float2 x_591 = float2(x_569.z, x_569.y); + const int x_1075 = stack.arr[x_136_save]; + stack.arr[x_136_save] = 0; + stack.arr[x_136_save] = x_1075; + } + const int x_1076 = stack.arr[x_96_save]; + stack.arr[x_96_save] = 0; + stack.arr[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 tint_array_wrapper tint_symbol_32 = {{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.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[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.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[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.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[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.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[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.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[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.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[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.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[x_100_save] = x_1091; + const int x_147_save = x_144; + const int x_1092 = stack.arr[x_110_save]; + stack.arr[x_110_save] = 0; + stack.arr[x_110_save] = x_1092; + const float2 x_601 = float2(x_563.x, x_563.y); + stack.arr[x_147_save] = asint((1u + asuint(x_145))); + const tint_array_wrapper x_1093 = stack; + const tint_array_wrapper tint_symbol_34 = {{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.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[x_114_save] = x_1094; + const float2 x_602 = float2(x_565.y, x_599.y); + const tint_array_wrapper x_1095 = stack; + const tint_array_wrapper tint_symbol_35 = {{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.arr[x_147_save]; + stack.arr[x_147_save] = 0; + stack.arr[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.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[x_100_save] = x_1098; + const int x_1099 = stack.arr[x_96_save]; + stack.arr[x_96_save] = 0; + stack.arr[x_96_save] = x_1099; + stack.arr[x_149] = x_150; + const int x_1100 = stack.arr[x_114_save]; + stack.arr[x_114_save] = 0; + stack.arr[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.arr[x_100_save]; + stack.arr[x_100_save] = 0; + stack.arr[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 tint_array_wrapper tint_symbol_36 = {{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 tint_array_wrapper tint_symbol_38 = {{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 tint_array_wrapper tint_symbol_40 = {{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 tint_array_wrapper tint_symbol_42 = {{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 tint_array_wrapper tint_symbol_44 = {{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 tint_array_wrapper tint_symbol_46 = {{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 tint_array_wrapper tint_symbol_48 = {{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 = x_188.resolution; + const QuicksortObject x_763 = obj; + const tint_array_wrapper tint_symbol_50 = {{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 tint_array_wrapper tint_symbol_52 = {{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 tint_array_wrapper tint_symbol_54 = {{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.arr[0u]; + obj.numbers.arr[0u] = 0; + obj.numbers.arr[0u] = x_770; + const int x_201 = obj.numbers.arr[0u]; + const QuicksortObject x_771 = obj; + const tint_array_wrapper tint_symbol_56 = {{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.arr[0u]; + obj.numbers.arr[0u] = 0; + obj.numbers.arr[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 tint_array_wrapper tint_symbol_58 = {{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 tint_array_wrapper tint_symbol_60 = {{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.arr[0u]; + obj.numbers.arr[0u] = 0; + obj.numbers.arr[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.arr[1]; + const QuicksortObject x_783 = obj; + const tint_array_wrapper tint_symbol_62 = {{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 tint_array_wrapper tint_symbol_64 = {{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.arr[0u]; + obj.numbers.arr[0u] = 0; + obj.numbers.arr[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.arr[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.arr[2u]; + obj.numbers.arr[2u] = 0; + obj.numbers.arr[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.arr[2u]; + obj.numbers.arr[2u] = 0; + obj.numbers.arr[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.arr[3]; + const float x_816 = color.x; + color.x = 0.0f; + color.x = x_816; + const QuicksortObject x_817 = obj; + const tint_array_wrapper tint_symbol_66 = {{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.arr[0u]; + obj.numbers.arr[0u] = 0; + obj.numbers.arr[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.arr[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.arr[4]; + obj.numbers.arr[4] = 0; + obj.numbers.arr[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.arr[0u]; + obj.numbers.arr[0u] = 0; + obj.numbers.arr[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.arr[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 tint_array_wrapper tint_symbol_68 = {{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.arr[4]; + obj.numbers.arr[4] = 0; + obj.numbers.arr[4] = x_852; + const float x_274 = uv.y; + const int x_853 = obj.numbers.arr[0u]; + obj.numbers.arr[0u] = 0; + obj.numbers.arr[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.arr[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.arr[4]; + obj.numbers.arr[4] = 0; + obj.numbers.arr[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.arr[6u]; + obj.numbers.arr[6u] = 0; + obj.numbers.arr[6u] = x_862; + const int x_863 = obj.numbers.arr[6u]; + obj.numbers.arr[6u] = 0; + obj.numbers.arr[6u] = x_863; + const float2 x_490 = float2(x_480.z, x_480.z); + const QuicksortObject x_864 = obj; + const tint_array_wrapper tint_symbol_70 = {{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 tint_array_wrapper tint_symbol_72 = {{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.arr[4]; + obj.numbers.arr[4] = 0; + obj.numbers.arr[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.arr[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.arr[0u]; + obj.numbers.arr[0u] = 0; + obj.numbers.arr[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.arr[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.arr[8]; + obj.numbers.arr[8] = 0; + obj.numbers.arr[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.arr[4]; + obj.numbers.arr[4] = 0; + obj.numbers.arr[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.arr[4]; + obj.numbers.arr[4] = 0; + obj.numbers.arr[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 tint_array_wrapper tint_symbol_74 = {{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.arr[8]; + obj.numbers.arr[8] = 0; + obj.numbers.arr[8] = x_912; + const int x_317 = obj.numbers.arr[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 tint_array_wrapper tint_symbol_76 = {{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 tint_array_wrapper tint_symbol_78 = {{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 tint_array_wrapper tint_symbol_80 = {{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; +}; +struct tint_symbol_1 { + float4 gl_FragCoord_param : SV_Position; +}; +struct tint_symbol_2 { + float4 x_GLF_color : SV_Target0; +}; + +tint_symbol_2 main(tint_symbol_1 tint_symbol) { + const float4 gl_FragCoord_param = tint_symbol.gl_FragCoord_param; + gl_FragCoord = gl_FragCoord_param; + main_1(); + const main_out tint_symbol_3 = {x_GLF_color}; + const tint_symbol_2 tint_symbol_82 = {tint_symbol_3.x_GLF_color}; + return tint_symbol_82; +} diff --git a/test/bug/tint/749.spvasm.expected.spvasm b/test/bug/tint/749.spvasm.expected.spvasm index 60219a5e95..1ad431271e 100644 --- a/test/bug/tint/749.spvasm.expected.spvasm +++ b/test/bug/tint/749.spvasm.expected.spvasm @@ -1,12 +1,12 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 1817 +; Bound: 1833 ; Schema: 0 OpCapability Shader - %1691 = OpExtInstImport "GLSL.std.450" + %1694 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %gl_FragCoord %x_GLF_color + OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2 OpExecutionMode %main OriginUpperLeft OpName %QuicksortObject "QuicksortObject" OpMemberName %QuicksortObject 0 "numbers" @@ -16,6 +16,8 @@ OpMemberName %buf0 0 "resolution" OpName %x_188 "x_188" OpName %x_GLF_color "x_GLF_color" + OpName %tint_symbol "tint_symbol" + OpName %tint_symbol_2 "tint_symbol_2" OpName %swap_i1_i1_ "swap_i1_i1_" OpName %i "i" OpName %j "j" @@ -40,19 +42,25 @@ OpName %top "top" OpName %stack "stack" OpName %param_5 "param_5" - OpName %main "main" + OpName %main_1 "main_1" OpName %color "color" OpName %i_2 "i_2" OpName %uv "uv" + OpName %main_out "main_out" + OpMemberName %main_out 0 "x_GLF_color" + OpName %tint_symbol_3 "tint_symbol_3" + OpName %tint_symbol_1 "tint_symbol_1" + OpName %main "main" OpMemberDecorate %QuicksortObject 0 Offset 0 OpDecorate %_arr_int_uint_10 ArrayStride 4 - OpDecorate %gl_FragCoord BuiltIn FragCoord OpDecorate %buf0 Block OpMemberDecorate %buf0 0 Offset 0 OpDecorate %x_188 NonWritable OpDecorate %x_188 DescriptorSet 0 OpDecorate %x_188 Binding 0 - OpDecorate %x_GLF_color Location 0 + OpDecorate %tint_symbol BuiltIn FragCoord + OpDecorate %tint_symbol_2 Location 0 + OpMemberDecorate %main_out 0 Offset 0 %int = OpTypeInt 32 1 %uint = OpTypeInt 32 0 %uint_10 = OpConstant %uint 10 @@ -63,48 +71,51 @@ %obj = OpVariable %_ptr_Private_QuicksortObject Private %8 %float = OpTypeFloat 32 %v4float = OpTypeVector %float 4 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%gl_FragCoord = OpVariable %_ptr_Input_v4float Input +%_ptr_Private_v4float = OpTypePointer Private %v4float + %13 = OpConstantNull %v4float +%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %13 %v2float = OpTypeVector %float 2 %buf0 = OpTypeStruct %v2float %_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0 %x_188 = OpVariable %_ptr_Uniform_buf0 Uniform +%x_GLF_color = OpVariable %_ptr_Private_v4float Private %13 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%tint_symbol = OpVariable %_ptr_Input_v4float Input %_ptr_Output_v4float = OpTypePointer Output %v4float - %19 = OpConstantNull %v4float -%x_GLF_color = OpVariable %_ptr_Output_v4float Output %19 +%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %13 %void = OpTypeVoid %_ptr_Function_int = OpTypePointer Function %int - %20 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int - %28 = OpConstantNull %int + %23 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int + %31 = OpConstantNull %int %int_0 = OpConstant %int 0 %v3float = OpTypeVector %float 3 %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 - %35 = OpConstantComposite %v3float %float_1 %float_2 %float_3 + %38 = OpConstantComposite %v3float %float_1 %float_2 %float_3 %uint_0 = OpConstant %uint 0 %_ptr_Private_int = OpTypePointer Private %int - %99 = OpConstantComposite %_arr_int_uint_10 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 - %100 = OpConstantComposite %QuicksortObject %99 - %151 = OpTypeFunction %int %_ptr_Function_int %_ptr_Function_int + %102 = OpConstantComposite %_arr_int_uint_10 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 + %103 = OpConstantComposite %QuicksortObject %102 + %154 = OpTypeFunction %int %_ptr_Function_int %_ptr_Function_int %_ptr_Function_v2float = OpTypePointer Function %v2float - %165 = OpConstantNull %v2float + %168 = OpConstantNull %v2float %_ptr_Function_v3float = OpTypePointer Function %v3float - %168 = OpConstantNull %v3float + %171 = OpConstantNull %v3float %uint_1 = OpConstant %uint 1 %int_10 = OpConstant %int 10 %_ptr_Function_float = OpTypePointer Function %float %bool = OpTypeBool %int_1 = OpConstant %int 1 - %416 = OpTypeFunction %void + %419 = OpTypeFunction %void %_ptr_Function__arr_int_uint_10 = OpTypePointer Function %_arr_int_uint_10 - %426 = OpConstantNull %_arr_int_uint_10 + %429 = OpConstantNull %_arr_int_uint_10 %int_9 = OpConstant %int 9 %int_n1 = OpConstant %int -1 %float_0 = OpConstant %float 0 - %873 = OpConstantComposite %v2float %float_0 %float_0 + %876 = OpConstantComposite %v2float %float_0 %float_0 %true = OpConstantTrue %bool - %885 = OpConstantComposite %v3float %float_0 %float_0 %float_0 + %888 = OpConstantComposite %v3float %float_0 %float_0 %float_0 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float %float_0_25 = OpConstant %float 0.25 %float_0_5 = OpConstant %float 0.5 @@ -117,2497 +128,2516 @@ %int_7 = OpConstant %int 7 %int_8 = OpConstant %int 8 %uint_9 = OpConstant %uint 9 -%swap_i1_i1_ = OpFunction %void None %20 + %main_out = OpTypeStruct %v4float + %1820 = OpTypeFunction %void %main_out +%swap_i1_i1_ = OpFunction %void None %23 %i = OpFunctionParameter %_ptr_Function_int %j = OpFunctionParameter %_ptr_Function_int - %26 = OpLabel - %temp = OpVariable %_ptr_Function_int Function %28 - %29 = OpLoad %int %temp + %29 = OpLabel + %temp = OpVariable %_ptr_Function_int Function %31 + %32 = OpLoad %int %temp OpStore %temp %int_0 - OpStore %temp %29 - %36 = OpCompositeExtract %float %35 2 - %37 = OpCompositeExtract %float %35 1 - %38 = OpCompositeExtract %float %35 2 - %39 = OpCompositeConstruct %v3float %36 %37 %38 - %41 = OpLoad %int %i + OpStore %temp %32 + %39 = OpCompositeExtract %float %38 2 + %40 = OpCompositeExtract %float %38 1 + %41 = OpCompositeExtract %float %38 2 + %42 = OpCompositeConstruct %v3float %39 %40 %41 + %44 = OpLoad %int %i OpStore %i %int_0 - OpStore %i %41 - %45 = OpLoad %int %i - %47 = OpLoad %int %j + OpStore %i %44 + %48 = OpLoad %int %i + %50 = OpLoad %int %j OpStore %j %int_0 - OpStore %j %47 - %50 = OpCompositeExtract %float %39 1 - %51 = OpCompositeExtract %float %39 0 - %52 = OpCompositeExtract %float %39 1 - %53 = OpCompositeConstruct %v3float %50 %51 %52 - %54 = OpLoad %int %temp + OpStore %j %50 + %53 = OpCompositeExtract %float %42 1 + %54 = OpCompositeExtract %float %42 0 + %55 = OpCompositeExtract %float %42 1 + %56 = OpCompositeConstruct %v3float %53 %54 %55 + %57 = OpLoad %int %temp OpStore %temp %int_0 - OpStore %temp %54 - %57 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - %58 = OpLoad %int %57 - %59 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - OpStore %59 %int_0 - %60 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - OpStore %60 %58 - %61 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - %62 = OpLoad %int %61 - %63 = OpLoad %int %temp + OpStore %temp %57 + %60 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + %61 = OpLoad %int %60 + %62 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + OpStore %62 %int_0 + %63 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + OpStore %63 %61 + %64 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + %65 = OpLoad %int %64 + %66 = OpLoad %int %temp OpStore %temp %int_0 - OpStore %temp %63 - OpStore %temp %62 - %65 = OpLoad %int %j + OpStore %temp %66 + OpStore %temp %65 + %68 = OpLoad %int %j OpStore %j %int_0 - OpStore %j %65 - %68 = OpCompositeExtract %float %39 2 - %69 = OpCompositeExtract %float %35 0 - %70 = OpCompositeExtract %float %39 1 - %71 = OpCompositeConstruct %v3float %68 %69 %70 - %73 = OpLoad %int %i + OpStore %j %68 + %71 = OpCompositeExtract %float %42 2 + %72 = OpCompositeExtract %float %38 0 + %73 = OpCompositeExtract %float %42 1 + %74 = OpCompositeConstruct %v3float %71 %72 %73 + %76 = OpLoad %int %i OpStore %i %int_0 - OpStore %i %73 - %77 = OpLoad %int %i - %78 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - %79 = OpLoad %int %78 - %80 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - OpStore %80 %int_0 - %81 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - OpStore %81 %79 - %83 = OpLoad %int %j - %85 = OpLoad %int %i + OpStore %i %76 + %80 = OpLoad %int %i + %81 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + %82 = OpLoad %int %81 + %83 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + OpStore %83 %int_0 + %84 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + OpStore %84 %82 + %86 = OpLoad %int %j + %88 = OpLoad %int %i OpStore %i %int_0 - OpStore %i %85 - %88 = OpCompositeExtract %float %71 0 - %89 = OpCompositeExtract %float %71 2 - %90 = OpCompositeExtract %float %71 2 - %91 = OpCompositeConstruct %v3float %88 %89 %90 - %92 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - %93 = OpLoad %int %92 - %94 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - OpStore %94 %int_0 - %95 = OpAccessChain %_ptr_Private_int %obj %uint_0 %45 - OpStore %95 %93 - %96 = OpAccessChain %_ptr_Private_int %obj %uint_0 %83 - %97 = OpLoad %int %96 - %98 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %98 - %101 = OpCompositeExtract %float %91 0 - %102 = OpCompositeExtract %float %91 0 - %103 = OpCompositeConstruct %v2float %101 %102 - %104 = OpCompositeExtract %float %53 0 - %105 = OpCompositeExtract %float %53 2 - %106 = OpCompositeExtract %float %53 0 - %107 = OpCompositeConstruct %v3float %104 %105 %106 - %108 = OpAccessChain %_ptr_Private_int %obj %uint_0 %77 - OpStore %108 %97 - %109 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %109 - %110 = OpCompositeExtract %float %91 1 - %111 = OpCompositeExtract %float %91 2 - %112 = OpCompositeExtract %float %91 0 - %113 = OpCompositeConstruct %v3float %110 %111 %112 - %115 = OpLoad %int %i + OpStore %i %88 + %91 = OpCompositeExtract %float %74 0 + %92 = OpCompositeExtract %float %74 2 + %93 = OpCompositeExtract %float %74 2 + %94 = OpCompositeConstruct %v3float %91 %92 %93 + %95 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + %96 = OpLoad %int %95 + %97 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + OpStore %97 %int_0 + %98 = OpAccessChain %_ptr_Private_int %obj %uint_0 %48 + OpStore %98 %96 + %99 = OpAccessChain %_ptr_Private_int %obj %uint_0 %86 + %100 = OpLoad %int %99 + %101 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %101 + %104 = OpCompositeExtract %float %94 0 + %105 = OpCompositeExtract %float %94 0 + %106 = OpCompositeConstruct %v2float %104 %105 + %107 = OpCompositeExtract %float %56 0 + %108 = OpCompositeExtract %float %56 2 + %109 = OpCompositeExtract %float %56 0 + %110 = OpCompositeConstruct %v3float %107 %108 %109 + %111 = OpAccessChain %_ptr_Private_int %obj %uint_0 %80 + OpStore %111 %100 + %112 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %112 + %113 = OpCompositeExtract %float %94 1 + %114 = OpCompositeExtract %float %94 2 + %115 = OpCompositeExtract %float %94 0 + %116 = OpCompositeConstruct %v3float %113 %114 %115 + %118 = OpLoad %int %i OpStore %i %int_0 - OpStore %i %115 - %119 = OpLoad %int %j - %120 = OpLoad %int %temp + OpStore %i %118 + %122 = OpLoad %int %j + %123 = OpLoad %int %temp OpStore %temp %int_0 - OpStore %temp %120 - %121 = OpCompositeExtract %float %113 2 - %122 = OpCompositeExtract %float %113 1 - %123 = OpCompositeConstruct %v2float %121 %122 - %124 = OpAccessChain %_ptr_Private_int %obj %uint_0 %83 - %125 = OpLoad %int %124 - %126 = OpAccessChain %_ptr_Private_int %obj %uint_0 %83 - OpStore %126 %int_0 - %127 = OpAccessChain %_ptr_Private_int %obj %uint_0 %83 - OpStore %127 %125 - %128 = OpLoad %int %temp - %130 = OpLoad %int %j + OpStore %temp %123 + %124 = OpCompositeExtract %float %116 2 + %125 = OpCompositeExtract %float %116 1 + %126 = OpCompositeConstruct %v2float %124 %125 + %127 = OpAccessChain %_ptr_Private_int %obj %uint_0 %86 + %128 = OpLoad %int %127 + %129 = OpAccessChain %_ptr_Private_int %obj %uint_0 %86 + OpStore %129 %int_0 + %130 = OpAccessChain %_ptr_Private_int %obj %uint_0 %86 + OpStore %130 %128 + %131 = OpLoad %int %temp + %133 = OpLoad %int %j OpStore %j %int_0 - OpStore %j %130 - %133 = OpCompositeExtract %float %103 0 - %134 = OpCompositeExtract %float %91 1 - %135 = OpCompositeExtract %float %91 0 - %136 = OpCompositeConstruct %v3float %133 %134 %135 - %137 = OpAccessChain %_ptr_Private_int %obj %uint_0 %77 - %138 = OpLoad %int %137 - %139 = OpAccessChain %_ptr_Private_int %obj %uint_0 %77 - OpStore %139 %int_0 - %140 = OpAccessChain %_ptr_Private_int %obj %uint_0 %77 - OpStore %140 %138 - %141 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %141 - %142 = OpCompositeExtract %float %107 0 - %143 = OpCompositeExtract %float %107 1 - %144 = OpCompositeExtract %float %107 0 - %145 = OpCompositeConstruct %v3float %142 %143 %144 - %146 = OpAccessChain %_ptr_Private_int %obj %uint_0 %83 - %147 = OpLoad %int %146 - %148 = OpAccessChain %_ptr_Private_int %obj %uint_0 %83 - OpStore %148 %int_0 - %149 = OpAccessChain %_ptr_Private_int %obj %uint_0 %83 - OpStore %149 %147 - %150 = OpAccessChain %_ptr_Private_int %obj %uint_0 %119 - OpStore %150 %128 + OpStore %j %133 + %136 = OpCompositeExtract %float %106 0 + %137 = OpCompositeExtract %float %94 1 + %138 = OpCompositeExtract %float %94 0 + %139 = OpCompositeConstruct %v3float %136 %137 %138 + %140 = OpAccessChain %_ptr_Private_int %obj %uint_0 %80 + %141 = OpLoad %int %140 + %142 = OpAccessChain %_ptr_Private_int %obj %uint_0 %80 + OpStore %142 %int_0 + %143 = OpAccessChain %_ptr_Private_int %obj %uint_0 %80 + OpStore %143 %141 + %144 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %144 + %145 = OpCompositeExtract %float %110 0 + %146 = OpCompositeExtract %float %110 1 + %147 = OpCompositeExtract %float %110 0 + %148 = OpCompositeConstruct %v3float %145 %146 %147 + %149 = OpAccessChain %_ptr_Private_int %obj %uint_0 %86 + %150 = OpLoad %int %149 + %151 = OpAccessChain %_ptr_Private_int %obj %uint_0 %86 + OpStore %151 %int_0 + %152 = OpAccessChain %_ptr_Private_int %obj %uint_0 %86 + OpStore %152 %150 + %153 = OpAccessChain %_ptr_Private_int %obj %uint_0 %122 + OpStore %153 %131 OpReturn OpFunctionEnd -%performPartition_i1_i1_ = OpFunction %int None %151 +%performPartition_i1_i1_ = OpFunction %int None %154 %l = OpFunctionParameter %_ptr_Function_int %h = OpFunctionParameter %_ptr_Function_int - %155 = OpLabel - %param_3 = OpVariable %_ptr_Function_int Function %28 - %i_1 = OpVariable %_ptr_Function_int Function %28 - %j_1 = OpVariable %_ptr_Function_int Function %28 - %param_2 = OpVariable %_ptr_Function_int Function %28 - %param_1 = OpVariable %_ptr_Function_int Function %28 - %param = OpVariable %_ptr_Function_int Function %28 - %pivot = OpVariable %_ptr_Function_int Function %28 - %x_537 = OpVariable %_ptr_Function_v2float Function %165 - %x_538 = OpVariable %_ptr_Function_v3float Function %168 - %170 = OpLoad %int %h + %158 = OpLabel + %param_3 = OpVariable %_ptr_Function_int Function %31 + %i_1 = OpVariable %_ptr_Function_int Function %31 + %j_1 = OpVariable %_ptr_Function_int Function %31 + %param_2 = OpVariable %_ptr_Function_int Function %31 + %param_1 = OpVariable %_ptr_Function_int Function %31 + %param = OpVariable %_ptr_Function_int Function %31 + %pivot = OpVariable %_ptr_Function_int Function %31 + %x_537 = OpVariable %_ptr_Function_v2float Function %168 + %x_538 = OpVariable %_ptr_Function_v3float Function %171 + %173 = OpLoad %int %h OpStore %h %int_0 - OpStore %h %170 - %174 = OpLoad %int %h - %176 = OpLoad %int %l + OpStore %h %173 + %177 = OpLoad %int %h + %179 = OpLoad %int %l OpStore %l %int_0 - OpStore %l %176 - %179 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - %180 = OpLoad %int %179 - %181 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - OpStore %181 %int_0 - %182 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - OpStore %182 %180 - %183 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - %184 = OpLoad %int %183 - %185 = OpLoad %int %param_3 + OpStore %l %179 + %182 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + %183 = OpLoad %int %182 + %184 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + OpStore %184 %int_0 + %185 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + OpStore %185 %183 + %186 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + %187 = OpLoad %int %186 + %188 = OpLoad %int %param_3 OpStore %param_3 %int_0 - OpStore %param_3 %185 - %186 = OpCompositeExtract %float %35 2 - %187 = OpCompositeExtract %float %35 0 - %188 = OpCompositeExtract %float %35 2 - %189 = OpCompositeConstruct %v3float %186 %187 %188 - %190 = OpLoad %int %param_1 + OpStore %param_3 %188 + %189 = OpCompositeExtract %float %38 2 + %190 = OpCompositeExtract %float %38 0 + %191 = OpCompositeExtract %float %38 2 + %192 = OpCompositeConstruct %v3float %189 %190 %191 + %193 = OpLoad %int %param_1 OpStore %param_1 %int_0 - OpStore %param_1 %190 - OpStore %pivot %184 - %192 = OpLoad %int %l - %194 = OpLoad %int %h + OpStore %param_1 %193 + OpStore %pivot %187 + %195 = OpLoad %int %l + %197 = OpLoad %int %h OpStore %h %int_0 - OpStore %h %194 - %197 = OpLoad %int %j_1 + OpStore %h %197 + %200 = OpLoad %int %j_1 OpStore %j_1 %int_0 - OpStore %j_1 %197 - %198 = OpCompositeExtract %float %189 1 - %199 = OpCompositeExtract %float %189 2 - %200 = OpCompositeExtract %float %189 1 - %201 = OpCompositeConstruct %v3float %198 %199 %200 - %203 = OpLoad %int %l + OpStore %j_1 %200 + %201 = OpCompositeExtract %float %192 1 + %202 = OpCompositeExtract %float %192 2 + %203 = OpCompositeExtract %float %192 1 + %204 = OpCompositeConstruct %v3float %201 %202 %203 + %206 = OpLoad %int %l OpStore %l %int_0 - OpStore %l %203 - %206 = OpBitcast %int %uint_1 - %208 = OpISub %int %192 %206 - OpStore %i_1 %208 - %210 = OpLoad %int %l - %211 = OpCompositeExtract %float %189 0 - %212 = OpCompositeExtract %float %189 2 - %213 = OpCompositeExtract %float %201 0 - %214 = OpCompositeConstruct %v3float %211 %212 %213 + OpStore %l %206 + %209 = OpBitcast %int %uint_1 + %211 = OpISub %int %195 %209 + OpStore %i_1 %211 + %213 = OpLoad %int %l + %214 = OpCompositeExtract %float %192 0 + %215 = OpCompositeExtract %float %192 2 + %216 = OpCompositeExtract %float %204 0 + %217 = OpCompositeConstruct %v3float %214 %215 %216 OpStore %j_1 %int_10 - %216 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %216 - OpBranch %217 - %217 = OpLabel - OpLoopMerge %218 %219 None + %219 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %219 OpBranch %220 %220 = OpLabel - %221 = OpLoad %int %pivot - OpStore %pivot %int_0 - OpStore %pivot %221 - %222 = OpLoad %int %param_1 - OpStore %param_1 %int_0 - OpStore %param_1 %222 - %223 = OpLoad %int %j_1 + OpLoopMerge %221 %222 None + OpBranch %223 + %223 = OpLabel %224 = OpLoad %int %pivot OpStore %pivot %int_0 OpStore %pivot %224 - %225 = OpCompositeExtract %float %35 1 - %226 = OpCompositeExtract %float %35 2 - %227 = OpCompositeConstruct %v2float %225 %226 - OpStore %x_537 %227 - %228 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %228 - %230 = OpLoad %int %h - %232 = OpLoad %int %h + %225 = OpLoad %int %param_1 + OpStore %param_1 %int_0 + OpStore %param_1 %225 + %226 = OpLoad %int %j_1 + %227 = OpLoad %int %pivot + OpStore %pivot %int_0 + OpStore %pivot %227 + %228 = OpCompositeExtract %float %38 1 + %229 = OpCompositeExtract %float %38 2 + %230 = OpCompositeConstruct %v2float %228 %229 + OpStore %x_537 %230 + %231 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %231 + %233 = OpLoad %int %h + %235 = OpLoad %int %h OpStore %h %int_0 - OpStore %h %232 - %235 = OpLoad %int %param + OpStore %h %235 + %238 = OpLoad %int %param OpStore %param %int_0 - OpStore %param %235 - %236 = OpLoad %int %j_1 + OpStore %param %238 + %239 = OpLoad %int %j_1 OpStore %j_1 %int_0 - OpStore %j_1 %236 - %237 = OpCompositeExtract %float %189 0 - %239 = OpAccessChain %_ptr_Function_float %x_537 %uint_1 - %240 = OpLoad %float %239 - %241 = OpCompositeExtract %float %189 2 - %242 = OpCompositeConstruct %v3float %237 %240 %241 - OpStore %x_538 %242 - %243 = OpLoad %int %param + OpStore %j_1 %239 + %240 = OpCompositeExtract %float %192 0 + %242 = OpAccessChain %_ptr_Function_float %x_537 %uint_1 + %243 = OpLoad %float %242 + %244 = OpCompositeExtract %float %192 2 + %245 = OpCompositeConstruct %v3float %240 %243 %244 + OpStore %x_538 %245 + %246 = OpLoad %int %param OpStore %param %int_0 - OpStore %param %243 - %244 = OpBitcast %int %uint_1 - %245 = OpISub %int %230 %244 - %246 = OpSLessThanEqual %bool %223 %245 - OpSelectionMerge %248 None - OpBranchConditional %246 %249 %250 - %249 = OpLabel - OpBranch %248 - %250 = OpLabel - OpBranch %218 - %248 = OpLabel - %251 = OpLoad %int %j_1 - %252 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - %253 = OpLoad %int %252 - %254 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - OpStore %254 %int_0 - %255 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - OpStore %255 %253 - %257 = OpLoad %int %h + OpStore %param %246 + %247 = OpBitcast %int %uint_1 + %248 = OpISub %int %233 %247 + %249 = OpSLessThanEqual %bool %226 %248 + OpSelectionMerge %251 None + OpBranchConditional %249 %252 %253 + %252 = OpLabel + OpBranch %251 + %253 = OpLabel + OpBranch %221 + %251 = OpLabel + %254 = OpLoad %int %j_1 + %255 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + %256 = OpLoad %int %255 + %257 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + OpStore %257 %int_0 + %258 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + OpStore %258 %256 + %260 = OpLoad %int %h OpStore %h %int_0 - OpStore %h %257 - %260 = OpAccessChain %_ptr_Function_float %x_537 %uint_0 - %261 = OpLoad %float %260 - %262 = OpCompositeExtract %float %201 2 + OpStore %h %260 %263 = OpAccessChain %_ptr_Function_float %x_537 %uint_0 %264 = OpLoad %float %263 - %265 = OpCompositeConstruct %v3float %261 %262 %264 - %266 = OpLoad %int %param_1 + %265 = OpCompositeExtract %float %204 2 + %266 = OpAccessChain %_ptr_Function_float %x_537 %uint_0 + %267 = OpLoad %float %266 + %268 = OpCompositeConstruct %v3float %264 %265 %267 + %269 = OpLoad %int %param_1 OpStore %param_1 %int_0 - OpStore %param_1 %266 - %267 = OpAccessChain %_ptr_Private_int %obj %uint_0 %251 - %268 = OpLoad %int %267 - %269 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %269 - %270 = OpLoad %int %pivot - %271 = OpCompositeExtract %float %35 1 - %272 = OpCompositeExtract %float %189 2 - %273 = OpCompositeConstruct %v2float %271 %272 - %274 = OpLoad %int %i_1 + OpStore %param_1 %269 + %270 = OpAccessChain %_ptr_Private_int %obj %uint_0 %254 + %271 = OpLoad %int %270 + %272 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %272 + %273 = OpLoad %int %pivot + %274 = OpCompositeExtract %float %38 1 + %275 = OpCompositeExtract %float %192 2 + %276 = OpCompositeConstruct %v2float %274 %275 + %277 = OpLoad %int %i_1 OpStore %i_1 %int_0 - OpStore %i_1 %274 - %276 = OpLoad %int %l + OpStore %i_1 %277 + %279 = OpLoad %int %l OpStore %l %int_0 - OpStore %l %276 - %279 = OpCompositeExtract %float %189 1 - %280 = OpCompositeExtract %float %189 0 - %281 = OpCompositeExtract %float %189 1 - %282 = OpCompositeConstruct %v3float %279 %280 %281 - %283 = OpLoad %int %pivot + OpStore %l %279 + %282 = OpCompositeExtract %float %192 1 + %283 = OpCompositeExtract %float %192 0 + %284 = OpCompositeExtract %float %192 1 + %285 = OpCompositeConstruct %v3float %282 %283 %284 + %286 = OpLoad %int %pivot OpStore %pivot %int_0 - OpStore %pivot %283 - %284 = OpSLessThanEqual %bool %268 %270 - OpSelectionMerge %285 None - OpBranchConditional %284 %286 %285 - %286 = OpLabel - %287 = OpCompositeExtract %float %282 2 - %288 = OpCompositeExtract %float %282 0 - %289 = OpCompositeExtract %float %282 0 - %290 = OpCompositeConstruct %v3float %287 %288 %289 - %291 = OpLoad %int %param_3 + OpStore %pivot %286 + %287 = OpSLessThanEqual %bool %271 %273 + OpSelectionMerge %288 None + OpBranchConditional %287 %289 %288 + %289 = OpLabel + %290 = OpCompositeExtract %float %285 2 + %291 = OpCompositeExtract %float %285 0 + %292 = OpCompositeExtract %float %285 0 + %293 = OpCompositeConstruct %v3float %290 %291 %292 + %294 = OpLoad %int %param_3 OpStore %param_3 %int_0 - OpStore %param_3 %291 - %292 = OpLoad %int %i_1 - %293 = OpLoad %int %pivot + OpStore %param_3 %294 + %295 = OpLoad %int %i_1 + %296 = OpLoad %int %pivot OpStore %pivot %int_0 - OpStore %pivot %293 - %294 = OpCompositeExtract %float %265 0 - %295 = OpCompositeExtract %float %282 1 - %296 = OpCompositeConstruct %v2float %294 %295 - %297 = OpLoad %int %i_1 + OpStore %pivot %296 + %297 = OpCompositeExtract %float %268 0 + %298 = OpCompositeExtract %float %285 1 + %299 = OpCompositeConstruct %v2float %297 %298 + %300 = OpLoad %int %i_1 OpStore %i_1 %int_0 - OpStore %i_1 %297 - %298 = OpLoad %int %param - OpStore %param %int_0 - OpStore %param %298 - %299 = OpBitcast %int %uint_1 - %300 = OpIAdd %int %292 %299 OpStore %i_1 %300 - %302 = OpLoad %int %l + %301 = OpLoad %int %param + OpStore %param %int_0 + OpStore %param %301 + %302 = OpBitcast %int %uint_1 + %303 = OpIAdd %int %295 %302 + OpStore %i_1 %303 + %305 = OpLoad %int %l OpStore %l %int_0 - OpStore %l %302 - %305 = OpCompositeExtract %float %35 2 - %306 = OpCompositeExtract %float %35 1 - %307 = OpCompositeExtract %float %273 0 - %308 = OpCompositeConstruct %v3float %305 %306 %307 - %309 = OpLoad %int %i_1 - %310 = OpAccessChain %_ptr_Function_float %x_537 %uint_1 - %311 = OpLoad %float %310 - %312 = OpAccessChain %_ptr_Function_float %x_538 %uint_0 - %313 = OpLoad %float %312 - %314 = OpCompositeConstruct %v2float %311 %313 - %315 = OpLoad %int %param + OpStore %l %305 + %308 = OpCompositeExtract %float %38 2 + %309 = OpCompositeExtract %float %38 1 + %310 = OpCompositeExtract %float %276 0 + %311 = OpCompositeConstruct %v3float %308 %309 %310 + %312 = OpLoad %int %i_1 + %313 = OpAccessChain %_ptr_Function_float %x_537 %uint_1 + %314 = OpLoad %float %313 + %315 = OpAccessChain %_ptr_Function_float %x_538 %uint_0 + %316 = OpLoad %float %315 + %317 = OpCompositeConstruct %v2float %314 %316 + %318 = OpLoad %int %param OpStore %param %int_0 - OpStore %param %315 - OpStore %param %309 - %316 = OpLoad %int %param + OpStore %param %318 + OpStore %param %312 + %319 = OpLoad %int %param OpStore %param %int_0 - OpStore %param %316 - %317 = OpCompositeExtract %float %314 0 - %318 = OpCompositeExtract %float %314 0 - %319 = OpCompositeConstruct %v2float %317 %318 - %320 = OpLoad %int %i_1 + OpStore %param %319 + %320 = OpCompositeExtract %float %317 0 + %321 = OpCompositeExtract %float %317 0 + %322 = OpCompositeConstruct %v2float %320 %321 + %323 = OpLoad %int %i_1 OpStore %i_1 %int_0 - OpStore %i_1 %320 - %321 = OpLoad %int %j_1 - OpStore %param_1 %321 - %322 = OpLoad %int %param_3 + OpStore %i_1 %323 + %324 = OpLoad %int %j_1 + OpStore %param_1 %324 + %325 = OpLoad %int %param_3 OpStore %param_3 %int_0 - OpStore %param_3 %322 - %323 = OpFunctionCall %void %swap_i1_i1_ %param %param_1 - %326 = OpLoad %int %param_1 + OpStore %param_3 %325 + %326 = OpFunctionCall %void %swap_i1_i1_ %param %param_1 + %329 = OpLoad %int %param_1 OpStore %param_1 %int_0 - OpStore %param_1 %326 - OpBranch %285 - %285 = OpLabel - %327 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %327 - OpBranch %219 - %219 = OpLabel - %329 = OpLoad %int %h + OpStore %param_1 %329 + OpBranch %288 + %288 = OpLabel + %330 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %330 + OpBranch %222 + %222 = OpLabel + %332 = OpLoad %int %h OpStore %h %int_0 - OpStore %h %329 - %332 = OpLoad %int %j_1 - %334 = OpLoad %int %h + OpStore %h %332 + %335 = OpLoad %int %j_1 + %337 = OpLoad %int %h OpStore %h %int_0 - OpStore %h %334 - %337 = OpCompositeExtract %float %265 0 - %338 = OpCompositeExtract %float %282 2 - %339 = OpCompositeExtract %float %282 2 - %340 = OpCompositeConstruct %v3float %337 %338 %339 - %341 = OpAccessChain %_ptr_Private_int %obj %uint_0 %251 - %342 = OpLoad %int %341 - %343 = OpAccessChain %_ptr_Private_int %obj %uint_0 %251 - OpStore %343 %int_0 - %344 = OpAccessChain %_ptr_Private_int %obj %uint_0 %251 - OpStore %344 %342 - %345 = OpLoad %int %param + OpStore %h %337 + %340 = OpCompositeExtract %float %268 0 + %341 = OpCompositeExtract %float %285 2 + %342 = OpCompositeExtract %float %285 2 + %343 = OpCompositeConstruct %v3float %340 %341 %342 + %344 = OpAccessChain %_ptr_Private_int %obj %uint_0 %254 + %345 = OpLoad %int %344 + %346 = OpAccessChain %_ptr_Private_int %obj %uint_0 %254 + OpStore %346 %int_0 + %347 = OpAccessChain %_ptr_Private_int %obj %uint_0 %254 + OpStore %347 %345 + %348 = OpLoad %int %param OpStore %param %int_0 - OpStore %param %345 - %347 = OpIAdd %int %int_1 %332 - OpStore %j_1 %347 - %348 = OpLoad %int %param_1 + OpStore %param %348 + %350 = OpIAdd %int %int_1 %335 + OpStore %j_1 %350 + %351 = OpLoad %int %param_1 OpStore %param_1 %int_0 - OpStore %param_1 %348 - %349 = OpCompositeExtract %float %282 1 - %350 = OpCompositeExtract %float %282 2 - %351 = OpCompositeExtract %float %282 0 - %352 = OpCompositeConstruct %v3float %349 %350 %351 - %353 = OpAccessChain %_ptr_Private_int %obj %uint_0 %251 - %354 = OpLoad %int %353 - %355 = OpAccessChain %_ptr_Private_int %obj %uint_0 %251 - OpStore %355 %int_0 - %356 = OpAccessChain %_ptr_Private_int %obj %uint_0 %251 - OpStore %356 %354 - OpBranch %217 - %218 = OpLabel - %357 = OpLoad %int %i_1 - %358 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - %359 = OpLoad %int %358 - %360 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - OpStore %360 %int_0 - %361 = OpAccessChain %_ptr_Private_int %obj %uint_0 %174 - OpStore %361 %359 - %362 = OpCompositeExtract %float %189 0 - %363 = OpCompositeExtract %float %189 1 - %364 = OpCompositeConstruct %v2float %362 %363 - %365 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %365 - %367 = OpLoad %int %h + OpStore %param_1 %351 + %352 = OpCompositeExtract %float %285 1 + %353 = OpCompositeExtract %float %285 2 + %354 = OpCompositeExtract %float %285 0 + %355 = OpCompositeConstruct %v3float %352 %353 %354 + %356 = OpAccessChain %_ptr_Private_int %obj %uint_0 %254 + %357 = OpLoad %int %356 + %358 = OpAccessChain %_ptr_Private_int %obj %uint_0 %254 + OpStore %358 %int_0 + %359 = OpAccessChain %_ptr_Private_int %obj %uint_0 %254 + OpStore %359 %357 + OpBranch %220 + %221 = OpLabel + %360 = OpLoad %int %i_1 + %361 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + %362 = OpLoad %int %361 + %363 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + OpStore %363 %int_0 + %364 = OpAccessChain %_ptr_Private_int %obj %uint_0 %177 + OpStore %364 %362 + %365 = OpCompositeExtract %float %192 0 + %366 = OpCompositeExtract %float %192 1 + %367 = OpCompositeConstruct %v2float %365 %366 + %368 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %368 + %370 = OpLoad %int %h OpStore %h %int_0 - OpStore %h %367 - %370 = OpIAdd %int %int_1 %357 - OpStore %i_1 %370 - %371 = OpLoad %int %param_1 + OpStore %h %370 + %373 = OpIAdd %int %int_1 %360 + OpStore %i_1 %373 + %374 = OpLoad %int %param_1 OpStore %param_1 %int_0 - OpStore %param_1 %371 - %372 = OpLoad %int %i_1 - %373 = OpLoad %int %j_1 + OpStore %param_1 %374 + %375 = OpLoad %int %i_1 + %376 = OpLoad %int %j_1 OpStore %j_1 %int_0 - OpStore %j_1 %373 - %374 = OpCompositeExtract %float %189 0 - %375 = OpCompositeExtract %float %189 0 - %376 = OpCompositeConstruct %v2float %374 %375 - %377 = OpLoad %int %param_1 + OpStore %j_1 %376 + %377 = OpCompositeExtract %float %192 0 + %378 = OpCompositeExtract %float %192 0 + %379 = OpCompositeConstruct %v2float %377 %378 + %380 = OpLoad %int %param_1 OpStore %param_1 %int_0 - OpStore %param_1 %377 - OpStore %param_2 %372 - %378 = OpCompositeExtract %float %189 1 - %379 = OpCompositeExtract %float %214 0 - %380 = OpCompositeConstruct %v2float %378 %379 - %381 = OpLoad %int %pivot + OpStore %param_1 %380 + OpStore %param_2 %375 + %381 = OpCompositeExtract %float %192 1 + %382 = OpCompositeExtract %float %217 0 + %383 = OpCompositeConstruct %v2float %381 %382 + %384 = OpLoad %int %pivot OpStore %pivot %int_0 - OpStore %pivot %381 - %383 = OpLoad %int %h - %384 = OpCompositeExtract %float %376 0 - %385 = OpCompositeExtract %float %364 1 - %386 = OpCompositeConstruct %v2float %384 %385 - %388 = OpLoad %int %h + OpStore %pivot %384 + %386 = OpLoad %int %h + %387 = OpCompositeExtract %float %379 0 + %388 = OpCompositeExtract %float %367 1 + %389 = OpCompositeConstruct %v2float %387 %388 + %391 = OpLoad %int %h OpStore %h %int_0 - OpStore %h %388 - OpStore %param_3 %383 - %391 = OpLoad %int %i_1 + OpStore %h %391 + OpStore %param_3 %386 + %394 = OpLoad %int %i_1 OpStore %i_1 %int_0 - OpStore %i_1 %391 - %392 = OpCompositeExtract %float %364 1 - %393 = OpCompositeExtract %float %386 0 - %394 = OpCompositeConstruct %v2float %392 %393 - %396 = OpLoad %int %h + OpStore %i_1 %394 + %395 = OpCompositeExtract %float %367 1 + %396 = OpCompositeExtract %float %389 0 + %397 = OpCompositeConstruct %v2float %395 %396 + %399 = OpLoad %int %h OpStore %h %int_0 - OpStore %h %396 - %399 = OpFunctionCall %void %swap_i1_i1_ %param_2 %param_3 - %403 = OpLoad %int %l + OpStore %h %399 + %402 = OpFunctionCall %void %swap_i1_i1_ %param_2 %param_3 + %406 = OpLoad %int %l OpStore %l %int_0 - OpStore %l %403 - %406 = OpCompositeExtract %float %214 2 - %407 = OpCompositeExtract %float %35 1 - %408 = OpCompositeConstruct %v2float %406 %407 - %409 = OpLoad %int %param_1 + OpStore %l %406 + %409 = OpCompositeExtract %float %217 2 + %410 = OpCompositeExtract %float %38 1 + %411 = OpCompositeConstruct %v2float %409 %410 + %412 = OpLoad %int %param_1 OpStore %param_1 %int_0 - OpStore %param_1 %409 - %410 = OpLoad %int %i_1 - %411 = OpLoad %int %param + OpStore %param_1 %412 + %413 = OpLoad %int %i_1 + %414 = OpLoad %int %param OpStore %param %int_0 - OpStore %param %411 - %412 = OpCompositeExtract %float %189 1 - %413 = OpCompositeExtract %float %189 0 - %414 = OpCompositeConstruct %v2float %412 %413 - %415 = OpLoad %int %j_1 + OpStore %param %414 + %415 = OpCompositeExtract %float %192 1 + %416 = OpCompositeExtract %float %192 0 + %417 = OpCompositeConstruct %v2float %415 %416 + %418 = OpLoad %int %j_1 OpStore %j_1 %int_0 - OpStore %j_1 %415 - OpReturnValue %410 + OpStore %j_1 %418 + OpReturnValue %413 OpFunctionEnd - %quicksort_ = OpFunction %void None %416 - %418 = OpLabel - %param_4 = OpVariable %_ptr_Function_int Function %28 - %h_1 = OpVariable %_ptr_Function_int Function %28 - %p = OpVariable %_ptr_Function_int Function %28 - %l_1 = OpVariable %_ptr_Function_int Function %28 - %top = OpVariable %_ptr_Function_int Function %28 - %stack = OpVariable %_ptr_Function__arr_int_uint_10 Function %426 - %param_5 = OpVariable %_ptr_Function_int Function %28 + %quicksort_ = OpFunction %void None %419 + %421 = OpLabel + %param_4 = OpVariable %_ptr_Function_int Function %31 + %h_1 = OpVariable %_ptr_Function_int Function %31 + %p = OpVariable %_ptr_Function_int Function %31 + %l_1 = OpVariable %_ptr_Function_int Function %31 + %top = OpVariable %_ptr_Function_int Function %31 + %stack = OpVariable %_ptr_Function__arr_int_uint_10 Function %429 + %param_5 = OpVariable %_ptr_Function_int Function %31 OpStore %l_1 %int_0 - %428 = OpLoad %int %param_5 + %431 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %428 + OpStore %param_5 %431 OpStore %h_1 %int_9 - %430 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %430 - %431 = OpCompositeExtract %float %35 1 - %432 = OpCompositeExtract %float %35 1 - %433 = OpCompositeConstruct %v2float %431 %432 - %434 = OpLoad %int %param_5 + %433 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %433 + %434 = OpCompositeExtract %float %38 1 + %435 = OpCompositeExtract %float %38 1 + %436 = OpCompositeConstruct %v2float %434 %435 + %437 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %434 + OpStore %param_5 %437 OpStore %top %int_n1 - %436 = OpLoad %int %p + %439 = OpLoad %int %p OpStore %p %int_0 - OpStore %p %436 - %437 = OpLoad %int %top - %438 = OpCompositeExtract %float %35 0 - %439 = OpCompositeExtract %float %35 0 - %440 = OpCompositeConstruct %v2float %438 %439 - %441 = OpLoad %int %p + OpStore %p %439 + %440 = OpLoad %int %top + %441 = OpCompositeExtract %float %38 0 + %442 = OpCompositeExtract %float %38 0 + %443 = OpCompositeConstruct %v2float %441 %442 + %444 = OpLoad %int %p OpStore %p %int_0 - OpStore %p %441 - %442 = OpBitcast %int %uint_1 - %443 = OpIAdd %int %437 %442 - %444 = OpLoad %int %top + OpStore %p %444 + %445 = OpBitcast %int %uint_1 + %446 = OpIAdd %int %440 %445 + %447 = OpLoad %int %top OpStore %top %int_0 - OpStore %top %444 - %445 = OpCompositeExtract %float %433 1 - %446 = OpCompositeExtract %float %440 1 - %447 = OpCompositeConstruct %v2float %445 %446 - %448 = OpLoad %int %param_4 + OpStore %top %447 + %448 = OpCompositeExtract %float %436 1 + %449 = OpCompositeExtract %float %443 1 + %450 = OpCompositeConstruct %v2float %448 %449 + %451 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %448 - OpStore %top %443 - %449 = OpLoad %int %h_1 + OpStore %param_4 %451 + OpStore %top %446 + %452 = OpLoad %int %h_1 OpStore %h_1 %int_0 - OpStore %h_1 %449 - %450 = OpCompositeExtract %float %440 1 - %451 = OpCompositeExtract %float %440 0 - %452 = OpCompositeExtract %float %440 0 - %453 = OpCompositeConstruct %v3float %450 %451 %452 - %454 = OpLoad %int %param_4 + OpStore %h_1 %452 + %453 = OpCompositeExtract %float %443 1 + %454 = OpCompositeExtract %float %443 0 + %455 = OpCompositeExtract %float %443 0 + %456 = OpCompositeConstruct %v3float %453 %454 %455 + %457 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %454 - %455 = OpLoad %int %l_1 - %456 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %456 - %457 = OpCompositeExtract %float %453 1 - %458 = OpCompositeExtract %float %453 0 - %459 = OpCompositeExtract %float %440 0 - %460 = OpCompositeConstruct %v3float %457 %458 %459 - %461 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %461 - %462 = OpCompositeExtract %float %433 1 - %463 = OpCompositeExtract %float %433 1 - %464 = OpCompositeExtract %float %433 1 - %465 = OpCompositeConstruct %v3float %462 %463 %464 - %466 = OpLoad %int %l_1 + OpStore %param_4 %457 + %458 = OpLoad %int %l_1 + %459 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %459 + %460 = OpCompositeExtract %float %456 1 + %461 = OpCompositeExtract %float %456 0 + %462 = OpCompositeExtract %float %443 0 + %463 = OpCompositeConstruct %v3float %460 %461 %462 + %464 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %464 + %465 = OpCompositeExtract %float %436 1 + %466 = OpCompositeExtract %float %436 1 + %467 = OpCompositeExtract %float %436 1 + %468 = OpCompositeConstruct %v3float %465 %466 %467 + %469 = OpLoad %int %l_1 OpStore %l_1 %int_0 OpStore %l_1 %int_0 - %467 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %467 %455 - %468 = OpLoad %int %param_5 + %470 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %470 %458 + %471 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %468 - %469 = OpLoad %int %top - %470 = OpLoad %int %param_4 + OpStore %param_5 %471 + %472 = OpLoad %int %top + %473 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %470 - %471 = OpCompositeExtract %float %35 2 - %472 = OpCompositeExtract %float %447 1 - %473 = OpCompositeExtract %float %35 1 - %474 = OpCompositeConstruct %v3float %471 %472 %473 - %475 = OpAccessChain %_ptr_Function_int %stack %443 - %476 = OpLoad %int %475 - %477 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %477 %int_0 - %478 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %478 %476 - %479 = OpIAdd %int %469 %int_1 - %480 = OpAccessChain %_ptr_Function_int %stack %443 - %481 = OpLoad %int %480 - %482 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %482 %int_0 - %483 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %483 %481 - %484 = OpCompositeExtract %float %453 0 - %485 = OpCompositeExtract %float %453 2 - %486 = OpCompositeExtract %float %433 1 - %487 = OpCompositeConstruct %v3float %484 %485 %486 - OpStore %top %479 - %488 = OpLoad %int %param_4 + OpStore %param_4 %473 + %474 = OpCompositeExtract %float %38 2 + %475 = OpCompositeExtract %float %450 1 + %476 = OpCompositeExtract %float %38 1 + %477 = OpCompositeConstruct %v3float %474 %475 %476 + %478 = OpAccessChain %_ptr_Function_int %stack %446 + %479 = OpLoad %int %478 + %480 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %480 %int_0 + %481 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %481 %479 + %482 = OpIAdd %int %472 %int_1 + %483 = OpAccessChain %_ptr_Function_int %stack %446 + %484 = OpLoad %int %483 + %485 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %485 %int_0 + %486 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %486 %484 + %487 = OpCompositeExtract %float %456 0 + %488 = OpCompositeExtract %float %456 2 + %489 = OpCompositeExtract %float %436 1 + %490 = OpCompositeConstruct %v3float %487 %488 %489 + OpStore %top %482 + %491 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %488 - %489 = OpLoad %int %h_1 - %490 = OpLoad %int %param_4 + OpStore %param_4 %491 + %492 = OpLoad %int %h_1 + %493 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %490 - %491 = OpCompositeExtract %float %447 0 - %492 = OpCompositeExtract %float %465 0 - %493 = OpCompositeExtract %float %447 1 - %494 = OpCompositeConstruct %v3float %491 %492 %493 - %495 = OpLoad %int %l_1 + OpStore %param_4 %493 + %494 = OpCompositeExtract %float %450 0 + %495 = OpCompositeExtract %float %468 0 + %496 = OpCompositeExtract %float %450 1 + %497 = OpCompositeConstruct %v3float %494 %495 %496 + %498 = OpLoad %int %l_1 OpStore %l_1 %int_0 - OpStore %l_1 %495 - %496 = OpLoad %int %param_5 + OpStore %l_1 %498 + %499 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %496 - %497 = OpCompositeExtract %float %494 2 - %498 = OpCompositeExtract %float %494 2 - %499 = OpCompositeConstruct %v2float %497 %498 - %500 = OpLoad %int %p + OpStore %param_5 %499 + %500 = OpCompositeExtract %float %497 2 + %501 = OpCompositeExtract %float %497 2 + %502 = OpCompositeConstruct %v2float %500 %501 + %503 = OpLoad %int %p OpStore %p %int_0 - OpStore %p %500 - %501 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %501 %489 - OpBranch %502 - %502 = OpLabel - OpLoopMerge %503 %504 None + OpStore %p %503 + %504 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %504 %492 OpBranch %505 %505 = OpLabel - %506 = OpCompositeExtract %float %487 0 - %507 = OpCompositeExtract %float %487 0 - %508 = OpCompositeExtract %float %487 0 - %509 = OpCompositeConstruct %v3float %506 %507 %508 - %510 = OpLoad %int %h_1 + OpLoopMerge %506 %507 None + OpBranch %508 + %508 = OpLabel + %509 = OpCompositeExtract %float %490 0 + %510 = OpCompositeExtract %float %490 0 + %511 = OpCompositeExtract %float %490 0 + %512 = OpCompositeConstruct %v3float %509 %510 %511 + %513 = OpLoad %int %h_1 OpStore %h_1 %int_0 - OpStore %h_1 %510 - %511 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %511 - %512 = OpLoad %int %top - %513 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %513 - %514 = OpCompositeExtract %float %447 0 - %515 = OpCompositeExtract %float %494 2 - %516 = OpCompositeConstruct %v2float %514 %515 - %517 = OpLoad %int %param_4 + OpStore %h_1 %513 + %514 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %514 + %515 = OpLoad %int %top + %516 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %516 + %517 = OpCompositeExtract %float %450 0 + %518 = OpCompositeExtract %float %497 2 + %519 = OpCompositeConstruct %v2float %517 %518 + %520 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %517 - %518 = OpBitcast %int %uint_0 - %519 = OpSGreaterThanEqual %bool %512 %518 - OpSelectionMerge %520 None - OpBranchConditional %519 %521 %522 - %521 = OpLabel - OpBranch %520 - %522 = OpLabel - OpBranch %503 - %520 = OpLabel - %523 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %523 - %524 = OpCompositeExtract %float %453 1 - %525 = OpCompositeExtract %float %453 0 - %526 = OpCompositeExtract %float %487 1 - %527 = OpCompositeConstruct %v3float %524 %525 %526 - %528 = OpLoad %int %param_4 + OpStore %param_4 %520 + %521 = OpBitcast %int %uint_0 + %522 = OpSGreaterThanEqual %bool %515 %521 + OpSelectionMerge %523 None + OpBranchConditional %522 %524 %525 + %524 = OpLabel + OpBranch %523 + %525 = OpLabel + OpBranch %506 + %523 = OpLabel + %526 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %526 + %527 = OpCompositeExtract %float %456 1 + %528 = OpCompositeExtract %float %456 0 + %529 = OpCompositeExtract %float %490 1 + %530 = OpCompositeConstruct %v3float %527 %528 %529 + %531 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %528 - %529 = OpLoad %int %top - %530 = OpCompositeExtract %float %499 0 - %531 = OpCompositeExtract %float %516 1 - %532 = OpCompositeExtract %float %499 0 - %533 = OpCompositeConstruct %v3float %530 %531 %532 - %534 = OpLoad %int %h_1 + OpStore %param_4 %531 + %532 = OpLoad %int %top + %533 = OpCompositeExtract %float %502 0 + %534 = OpCompositeExtract %float %519 1 + %535 = OpCompositeExtract %float %502 0 + %536 = OpCompositeConstruct %v3float %533 %534 %535 + %537 = OpLoad %int %h_1 OpStore %h_1 %int_0 - OpStore %h_1 %534 - %535 = OpCompositeExtract %float %433 0 - %536 = OpCompositeExtract %float %433 0 - %537 = OpCompositeConstruct %v2float %535 %536 - %538 = OpLoad %int %p - OpStore %p %int_0 - OpStore %p %538 - %539 = OpBitcast %int %uint_1 - %540 = OpISub %int %529 %539 - OpStore %top %540 + OpStore %h_1 %537 + %538 = OpCompositeExtract %float %436 0 + %539 = OpCompositeExtract %float %436 0 + %540 = OpCompositeConstruct %v2float %538 %539 %541 = OpLoad %int %p OpStore %p %int_0 OpStore %p %541 - %542 = OpAccessChain %_ptr_Function_int %stack %443 - %543 = OpLoad %int %542 - %544 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %544 %int_0 - %545 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %545 %543 - %546 = OpAccessChain %_ptr_Function_int %stack %529 - %547 = OpLoad %int %546 - %548 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %548 - %549 = OpCompositeExtract %float %453 1 - %550 = OpCompositeExtract %float %453 0 - %551 = OpCompositeExtract %float %494 1 - %552 = OpCompositeConstruct %v3float %549 %550 %551 - %553 = OpLoad %int %l_1 + %542 = OpBitcast %int %uint_1 + %543 = OpISub %int %532 %542 + OpStore %top %543 + %544 = OpLoad %int %p + OpStore %p %int_0 + OpStore %p %544 + %545 = OpAccessChain %_ptr_Function_int %stack %446 + %546 = OpLoad %int %545 + %547 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %547 %int_0 + %548 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %548 %546 + %549 = OpAccessChain %_ptr_Function_int %stack %532 + %550 = OpLoad %int %549 + %551 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %551 + %552 = OpCompositeExtract %float %456 1 + %553 = OpCompositeExtract %float %456 0 + %554 = OpCompositeExtract %float %497 1 + %555 = OpCompositeConstruct %v3float %552 %553 %554 + %556 = OpLoad %int %l_1 OpStore %l_1 %int_0 - OpStore %l_1 %553 - OpStore %h_1 %547 - %554 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %554 - %555 = OpCompositeExtract %float %474 1 - %556 = OpCompositeExtract %float %465 1 - %557 = OpCompositeConstruct %v2float %555 %556 - %558 = OpLoad %int %p + OpStore %l_1 %556 + OpStore %h_1 %550 + %557 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %557 + %558 = OpCompositeExtract %float %477 1 + %559 = OpCompositeExtract %float %468 1 + %560 = OpCompositeConstruct %v2float %558 %559 + %561 = OpLoad %int %p OpStore %p %int_0 - OpStore %p %558 - %559 = OpLoad %int %top - %560 = OpLoad %int %param_4 + OpStore %p %561 + %562 = OpLoad %int %top + %563 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %560 - %561 = OpAccessChain %_ptr_Function_int %stack %479 - %562 = OpLoad %int %561 - %563 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %563 %int_0 - %564 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %564 %562 - %565 = OpCompositeExtract %float %35 1 - %566 = OpCompositeExtract %float %35 2 - %567 = OpCompositeConstruct %v2float %565 %566 - %568 = OpISub %int %559 %int_1 - OpStore %top %568 - %569 = OpLoad %int %param_5 + OpStore %param_4 %563 + %564 = OpAccessChain %_ptr_Function_int %stack %482 + %565 = OpLoad %int %564 + %566 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %566 %int_0 + %567 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %567 %565 + %568 = OpCompositeExtract %float %38 1 + %569 = OpCompositeExtract %float %38 2 + %570 = OpCompositeConstruct %v2float %568 %569 + %571 = OpISub %int %562 %int_1 + OpStore %top %571 + %572 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %569 - %570 = OpCompositeExtract %float %537 1 - %571 = OpCompositeExtract %float %499 0 - %572 = OpCompositeExtract %float %537 1 - %573 = OpCompositeConstruct %v3float %570 %571 %572 - %574 = OpLoad %int %h_1 + OpStore %param_5 %572 + %573 = OpCompositeExtract %float %540 1 + %574 = OpCompositeExtract %float %502 0 + %575 = OpCompositeExtract %float %540 1 + %576 = OpCompositeConstruct %v3float %573 %574 %575 + %577 = OpLoad %int %h_1 OpStore %h_1 %int_0 - OpStore %h_1 %574 - %575 = OpCompositeExtract %float %494 1 - %576 = OpCompositeExtract %float %494 2 - %577 = OpCompositeConstruct %v2float %575 %576 - %578 = OpAccessChain %_ptr_Function_int %stack %479 - %579 = OpLoad %int %578 - %580 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %580 %int_0 - %581 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %581 %579 - %582 = OpAccessChain %_ptr_Function_int %stack %559 - %583 = OpLoad %int %582 - %584 = OpLoad %int %p + OpStore %h_1 %577 + %578 = OpCompositeExtract %float %497 1 + %579 = OpCompositeExtract %float %497 2 + %580 = OpCompositeConstruct %v2float %578 %579 + %581 = OpAccessChain %_ptr_Function_int %stack %482 + %582 = OpLoad %int %581 + %583 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %583 %int_0 + %584 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %584 %582 + %585 = OpAccessChain %_ptr_Function_int %stack %562 + %586 = OpLoad %int %585 + %587 = OpLoad %int %p OpStore %p %int_0 - OpStore %p %584 - %585 = OpCompositeExtract %float %567 1 - %586 = OpCompositeExtract %float %567 1 - %587 = OpCompositeExtract %float %499 0 - %588 = OpCompositeConstruct %v3float %585 %586 %587 - %589 = OpLoad %int %param_5 + OpStore %p %587 + %588 = OpCompositeExtract %float %570 1 + %589 = OpCompositeExtract %float %570 1 + %590 = OpCompositeExtract %float %502 0 + %591 = OpCompositeConstruct %v3float %588 %589 %590 + %592 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %589 - OpStore %l_1 %583 - %590 = OpLoad %int %top + OpStore %param_5 %592 + OpStore %l_1 %586 + %593 = OpLoad %int %top OpStore %top %int_0 - OpStore %top %590 - %591 = OpLoad %int %l_1 - OpStore %param_4 %591 - %592 = OpAccessChain %_ptr_Function_int %stack %529 - %593 = OpLoad %int %592 - %594 = OpAccessChain %_ptr_Function_int %stack %529 - OpStore %594 %int_0 - %595 = OpAccessChain %_ptr_Function_int %stack %529 - OpStore %595 %593 - %596 = OpCompositeExtract %float %533 1 - %597 = OpCompositeExtract %float %533 2 - %598 = OpCompositeConstruct %v2float %596 %597 - %599 = OpLoad %int %h_1 - %600 = OpCompositeExtract %float %447 0 - %601 = OpCompositeExtract %float %35 1 - %602 = OpCompositeConstruct %v2float %600 %601 - OpStore %param_5 %599 - %603 = OpAccessChain %_ptr_Function_int %stack %479 - %604 = OpLoad %int %603 - %605 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %605 %int_0 - %606 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %606 %604 - %607 = OpFunctionCall %int %performPartition_i1_i1_ %param_4 %param_5 - %610 = OpCompositeExtract %float %516 0 - %611 = OpCompositeExtract %float %527 0 - %612 = OpCompositeConstruct %v2float %610 %611 - %613 = OpLoad %int %param_5 + OpStore %top %593 + %594 = OpLoad %int %l_1 + OpStore %param_4 %594 + %595 = OpAccessChain %_ptr_Function_int %stack %532 + %596 = OpLoad %int %595 + %597 = OpAccessChain %_ptr_Function_int %stack %532 + OpStore %597 %int_0 + %598 = OpAccessChain %_ptr_Function_int %stack %532 + OpStore %598 %596 + %599 = OpCompositeExtract %float %536 1 + %600 = OpCompositeExtract %float %536 2 + %601 = OpCompositeConstruct %v2float %599 %600 + %602 = OpLoad %int %h_1 + %603 = OpCompositeExtract %float %450 0 + %604 = OpCompositeExtract %float %38 1 + %605 = OpCompositeConstruct %v2float %603 %604 + OpStore %param_5 %602 + %606 = OpAccessChain %_ptr_Function_int %stack %482 + %607 = OpLoad %int %606 + %608 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %608 %int_0 + %609 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %609 %607 + %610 = OpFunctionCall %int %performPartition_i1_i1_ %param_4 %param_5 + %613 = OpCompositeExtract %float %519 0 + %614 = OpCompositeExtract %float %530 0 + %615 = OpCompositeConstruct %v2float %613 %614 + %616 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %613 - OpStore %p %607 - %614 = OpLoad %int %param_4 + OpStore %param_5 %616 + OpStore %p %610 + %617 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %614 - %615 = OpLoad %int %p - %616 = OpLoad %int %h_1 + OpStore %param_4 %617 + %618 = OpLoad %int %p + %619 = OpLoad %int %h_1 OpStore %h_1 %int_0 - OpStore %h_1 %616 - %617 = OpCompositeExtract %float %527 1 - %618 = OpCompositeExtract %float %527 1 - %619 = OpCompositeConstruct %v2float %617 %618 - %620 = OpLoad %int %l_1 + OpStore %h_1 %619 + %620 = OpCompositeExtract %float %530 1 + %621 = OpCompositeExtract %float %530 1 + %622 = OpCompositeConstruct %v2float %620 %621 + %623 = OpLoad %int %l_1 OpStore %l_1 %int_0 - OpStore %l_1 %620 - %621 = OpLoad %int %h_1 + OpStore %l_1 %623 + %624 = OpLoad %int %h_1 OpStore %h_1 %int_0 - OpStore %h_1 %621 - %622 = OpLoad %int %l_1 - %623 = OpAccessChain %_ptr_Function_int %stack %529 - %624 = OpLoad %int %623 - %625 = OpAccessChain %_ptr_Function_int %stack %529 - OpStore %625 %int_0 - %626 = OpAccessChain %_ptr_Function_int %stack %529 - OpStore %626 %624 - %627 = OpLoad %int %h_1 + OpStore %h_1 %624 + %625 = OpLoad %int %l_1 + %626 = OpAccessChain %_ptr_Function_int %stack %532 + %627 = OpLoad %int %626 + %628 = OpAccessChain %_ptr_Function_int %stack %532 + OpStore %628 %int_0 + %629 = OpAccessChain %_ptr_Function_int %stack %532 + OpStore %629 %627 + %630 = OpLoad %int %h_1 OpStore %h_1 %int_0 - OpStore %h_1 %627 - %628 = OpCompositeExtract %float %516 1 - %629 = OpCompositeExtract %float %567 0 - %630 = OpCompositeConstruct %v2float %628 %629 - %631 = OpAccessChain %_ptr_Function_int %stack %479 - %632 = OpLoad %int %631 - %633 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %633 %int_0 - %634 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %634 %632 - %635 = OpBitcast %int %uint_1 - %636 = OpISub %int %615 %635 - %637 = OpSGreaterThan %bool %636 %622 - OpSelectionMerge %638 None - OpBranchConditional %637 %639 %638 - %639 = OpLabel - %640 = OpLoad %int %param_4 + OpStore %h_1 %630 + %631 = OpCompositeExtract %float %519 1 + %632 = OpCompositeExtract %float %570 0 + %633 = OpCompositeConstruct %v2float %631 %632 + %634 = OpAccessChain %_ptr_Function_int %stack %482 + %635 = OpLoad %int %634 + %636 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %636 %int_0 + %637 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %637 %635 + %638 = OpBitcast %int %uint_1 + %639 = OpISub %int %618 %638 + %640 = OpSGreaterThan %bool %639 %625 + OpSelectionMerge %641 None + OpBranchConditional %640 %642 %641 + %642 = OpLabel + %643 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %640 - %641 = OpLoad %int %top - %642 = OpCompositeExtract %float %552 1 - %643 = OpCompositeExtract %float %433 1 - %644 = OpCompositeConstruct %v2float %642 %643 - %645 = OpAccessChain %_ptr_Function_int %stack %479 - %646 = OpLoad %int %645 - %647 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %647 %int_0 - %648 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %648 %646 - %649 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %649 - %650 = OpCompositeExtract %float %533 2 - %651 = OpCompositeExtract %float %533 1 - %652 = OpCompositeConstruct %v2float %650 %651 - %653 = OpCompositeExtract %float %619 1 - %654 = OpCompositeExtract %float %598 0 - %655 = OpCompositeExtract %float %598 0 - %656 = OpCompositeConstruct %v3float %653 %654 %655 - %657 = OpLoad %int %l_1 - %658 = OpAccessChain %_ptr_Function_int %stack %559 - %659 = OpLoad %int %658 - %660 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %660 %int_0 - %661 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %661 %659 - %662 = OpCompositeExtract %float %494 0 - %663 = OpCompositeExtract %float %656 0 - %664 = OpCompositeConstruct %v2float %662 %663 - %665 = OpLoad %int %param_5 + OpStore %param_4 %643 + %644 = OpLoad %int %top + %645 = OpCompositeExtract %float %555 1 + %646 = OpCompositeExtract %float %436 1 + %647 = OpCompositeConstruct %v2float %645 %646 + %648 = OpAccessChain %_ptr_Function_int %stack %482 + %649 = OpLoad %int %648 + %650 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %650 %int_0 + %651 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %651 %649 + %652 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %652 + %653 = OpCompositeExtract %float %536 2 + %654 = OpCompositeExtract %float %536 1 + %655 = OpCompositeConstruct %v2float %653 %654 + %656 = OpCompositeExtract %float %622 1 + %657 = OpCompositeExtract %float %601 0 + %658 = OpCompositeExtract %float %601 0 + %659 = OpCompositeConstruct %v3float %656 %657 %658 + %660 = OpLoad %int %l_1 + %661 = OpAccessChain %_ptr_Function_int %stack %562 + %662 = OpLoad %int %661 + %663 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %663 %int_0 + %664 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %664 %662 + %665 = OpCompositeExtract %float %497 0 + %666 = OpCompositeExtract %float %659 0 + %667 = OpCompositeConstruct %v2float %665 %666 + %668 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %665 - %666 = OpIAdd %int %int_1 %641 - %667 = OpAccessChain %_ptr_Function_int %stack %529 - %668 = OpLoad %int %667 - %669 = OpAccessChain %_ptr_Function_int %stack %529 - OpStore %669 %int_0 - %670 = OpAccessChain %_ptr_Function_int %stack %529 - OpStore %670 %668 - %671 = OpCompositeExtract %float %509 1 - %672 = OpCompositeExtract %float %509 1 - %673 = OpCompositeExtract %float %487 0 - %674 = OpCompositeConstruct %v3float %671 %672 %673 - %675 = OpLoad %int %param_5 + OpStore %param_5 %668 + %669 = OpIAdd %int %int_1 %644 + %670 = OpAccessChain %_ptr_Function_int %stack %532 + %671 = OpLoad %int %670 + %672 = OpAccessChain %_ptr_Function_int %stack %532 + OpStore %672 %int_0 + %673 = OpAccessChain %_ptr_Function_int %stack %532 + OpStore %673 %671 + %674 = OpCompositeExtract %float %512 1 + %675 = OpCompositeExtract %float %512 1 + %676 = OpCompositeExtract %float %490 0 + %677 = OpCompositeConstruct %v3float %674 %675 %676 + %678 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %675 - %676 = OpAccessChain %_ptr_Function_int %stack %666 - OpStore %676 %657 - %677 = OpLoad %int %top - %678 = OpAccessChain %_ptr_Function_int %stack %479 - %679 = OpLoad %int %678 - %680 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %680 %int_0 - %681 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %681 %679 - %682 = OpCompositeExtract %float %577 1 - %683 = OpCompositeExtract %float %577 0 - %684 = OpCompositeConstruct %v2float %682 %683 - %685 = OpAccessChain %_ptr_Function_int %stack %666 - %686 = OpLoad %int %685 - %687 = OpAccessChain %_ptr_Function_int %stack %666 - OpStore %687 %int_0 - %688 = OpAccessChain %_ptr_Function_int %stack %666 - OpStore %688 %686 - %690 = OpBitcast %uint %677 - %691 = OpIAdd %uint %uint_1 %690 - %689 = OpBitcast %int %691 - %692 = OpAccessChain %_ptr_Function_int %stack %479 - %693 = OpLoad %int %692 - %694 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %694 %int_0 - %695 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %695 %693 - %696 = OpCompositeExtract %float %588 2 - %697 = OpCompositeExtract %float %684 1 - %698 = OpCompositeExtract %float %588 2 - %699 = OpCompositeConstruct %v3float %696 %697 %698 - %700 = OpLoad %int %h_1 + OpStore %param_5 %678 + %679 = OpAccessChain %_ptr_Function_int %stack %669 + OpStore %679 %660 + %680 = OpLoad %int %top + %681 = OpAccessChain %_ptr_Function_int %stack %482 + %682 = OpLoad %int %681 + %683 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %683 %int_0 + %684 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %684 %682 + %685 = OpCompositeExtract %float %580 1 + %686 = OpCompositeExtract %float %580 0 + %687 = OpCompositeConstruct %v2float %685 %686 + %688 = OpAccessChain %_ptr_Function_int %stack %669 + %689 = OpLoad %int %688 + %690 = OpAccessChain %_ptr_Function_int %stack %669 + OpStore %690 %int_0 + %691 = OpAccessChain %_ptr_Function_int %stack %669 + OpStore %691 %689 + %693 = OpBitcast %uint %680 + %694 = OpIAdd %uint %uint_1 %693 + %692 = OpBitcast %int %694 + %695 = OpAccessChain %_ptr_Function_int %stack %482 + %696 = OpLoad %int %695 + %697 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %697 %int_0 + %698 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %698 %696 + %699 = OpCompositeExtract %float %591 2 + %700 = OpCompositeExtract %float %687 1 + %701 = OpCompositeExtract %float %591 2 + %702 = OpCompositeConstruct %v3float %699 %700 %701 + %703 = OpLoad %int %h_1 OpStore %h_1 %int_0 - OpStore %h_1 %700 - OpStore %top %689 - %701 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %701 - %702 = OpLoad %int %p - %703 = OpCompositeExtract %float %588 0 - %704 = OpCompositeExtract %float %567 1 - %705 = OpCompositeConstruct %v2float %703 %704 - %706 = OpAccessChain %_ptr_Function_int %stack %559 - %707 = OpLoad %int %706 - %708 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %708 %int_0 - %709 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %709 %707 - %710 = OpAccessChain %_ptr_Function_int %stack %559 - %711 = OpLoad %int %710 - %712 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %712 %int_0 - %713 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %713 %711 - %714 = OpAccessChain %_ptr_Function_int %stack %689 - %715 = OpBitcast %int %uint_1 - %716 = OpISub %int %702 %715 - OpStore %714 %716 - %717 = OpAccessChain %_ptr_Function_int %stack %443 - %718 = OpLoad %int %717 - %719 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %719 %int_0 - %720 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %720 %718 - %721 = OpCompositeExtract %float %533 2 - %722 = OpCompositeExtract %float %533 1 - %723 = OpCompositeConstruct %v2float %721 %722 - %724 = OpAccessChain %_ptr_Function_int %stack %689 - %725 = OpLoad %int %724 - %726 = OpAccessChain %_ptr_Function_int %stack %689 - OpStore %726 %int_0 - %727 = OpAccessChain %_ptr_Function_int %stack %689 - OpStore %727 %725 - OpBranch %638 - %638 = OpLabel - %728 = OpAccessChain %_ptr_Function_int %stack %443 - %729 = OpLoad %int %728 - %730 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %730 %int_0 - %731 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %731 %729 - %732 = OpCompositeExtract %float %35 0 - %733 = OpCompositeExtract %float %35 1 - %734 = OpCompositeConstruct %v2float %732 %733 - %735 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %735 - %736 = OpLoad %int %p - %737 = OpAccessChain %_ptr_Function_int %stack %559 - %738 = OpLoad %int %737 - %739 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %739 %int_0 - %740 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %740 %738 - %741 = OpCompositeExtract %float %552 2 - %742 = OpCompositeExtract %float %433 0 - %743 = OpCompositeExtract %float %433 1 - %744 = OpCompositeConstruct %v3float %741 %742 %743 - %745 = OpLoad %int %p + OpStore %h_1 %703 + OpStore %top %692 + %704 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %704 + %705 = OpLoad %int %p + %706 = OpCompositeExtract %float %591 0 + %707 = OpCompositeExtract %float %570 1 + %708 = OpCompositeConstruct %v2float %706 %707 + %709 = OpAccessChain %_ptr_Function_int %stack %562 + %710 = OpLoad %int %709 + %711 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %711 %int_0 + %712 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %712 %710 + %713 = OpAccessChain %_ptr_Function_int %stack %562 + %714 = OpLoad %int %713 + %715 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %715 %int_0 + %716 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %716 %714 + %717 = OpAccessChain %_ptr_Function_int %stack %692 + %718 = OpBitcast %int %uint_1 + %719 = OpISub %int %705 %718 + OpStore %717 %719 + %720 = OpAccessChain %_ptr_Function_int %stack %446 + %721 = OpLoad %int %720 + %722 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %722 %int_0 + %723 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %723 %721 + %724 = OpCompositeExtract %float %536 2 + %725 = OpCompositeExtract %float %536 1 + %726 = OpCompositeConstruct %v2float %724 %725 + %727 = OpAccessChain %_ptr_Function_int %stack %692 + %728 = OpLoad %int %727 + %729 = OpAccessChain %_ptr_Function_int %stack %692 + OpStore %729 %int_0 + %730 = OpAccessChain %_ptr_Function_int %stack %692 + OpStore %730 %728 + OpBranch %641 + %641 = OpLabel + %731 = OpAccessChain %_ptr_Function_int %stack %446 + %732 = OpLoad %int %731 + %733 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %733 %int_0 + %734 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %734 %732 + %735 = OpCompositeExtract %float %38 0 + %736 = OpCompositeExtract %float %38 1 + %737 = OpCompositeConstruct %v2float %735 %736 + %738 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %738 + %739 = OpLoad %int %p + %740 = OpAccessChain %_ptr_Function_int %stack %562 + %741 = OpLoad %int %740 + %742 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %742 %int_0 + %743 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %743 %741 + %744 = OpCompositeExtract %float %555 2 + %745 = OpCompositeExtract %float %436 0 + %746 = OpCompositeExtract %float %436 1 + %747 = OpCompositeConstruct %v3float %744 %745 %746 + %748 = OpLoad %int %p OpStore %p %int_0 - OpStore %p %745 - %746 = OpCompositeExtract %float %487 2 - %747 = OpCompositeExtract %float %487 0 - %748 = OpCompositeExtract %float %577 0 - %749 = OpCompositeConstruct %v3float %746 %747 %748 - %750 = OpAccessChain %_ptr_Function_int %stack %559 - %751 = OpLoad %int %750 - %752 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %752 %int_0 - %753 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %753 %751 - %754 = OpLoad %int %h_1 - %755 = OpLoad %int %top + OpStore %p %748 + %749 = OpCompositeExtract %float %490 2 + %750 = OpCompositeExtract %float %490 0 + %751 = OpCompositeExtract %float %580 0 + %752 = OpCompositeConstruct %v3float %749 %750 %751 + %753 = OpAccessChain %_ptr_Function_int %stack %562 + %754 = OpLoad %int %753 + %755 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %755 %int_0 + %756 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %756 %754 + %757 = OpLoad %int %h_1 + %758 = OpLoad %int %top OpStore %top %int_0 - OpStore %top %755 - %756 = OpCompositeExtract %float %460 2 - %757 = OpCompositeExtract %float %527 0 - %758 = OpCompositeExtract %float %460 0 - %759 = OpCompositeConstruct %v3float %756 %757 %758 - %760 = OpAccessChain %_ptr_Function_int %stack %479 - %761 = OpLoad %int %760 - %762 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %762 %int_0 - %763 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %763 %761 - %764 = OpLoad %int %p + OpStore %top %758 + %759 = OpCompositeExtract %float %463 2 + %760 = OpCompositeExtract %float %530 0 + %761 = OpCompositeExtract %float %463 0 + %762 = OpCompositeConstruct %v3float %759 %760 %761 + %763 = OpAccessChain %_ptr_Function_int %stack %482 + %764 = OpLoad %int %763 + %765 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %765 %int_0 + %766 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %766 %764 + %767 = OpLoad %int %p OpStore %p %int_0 - OpStore %p %764 - %766 = OpBitcast %uint %736 - %767 = OpIAdd %uint %uint_1 %766 - %765 = OpBitcast %int %767 - %768 = OpSLessThan %bool %765 %754 - OpSelectionMerge %769 None - OpBranchConditional %768 %770 %769 - %770 = OpLabel - %771 = OpAccessChain %_ptr_Function_int %stack %559 - %772 = OpLoad %int %771 - %773 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %773 %int_0 - %774 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %774 %772 - %775 = OpCompositeExtract %float %734 1 - %776 = OpCompositeExtract %float %630 0 - %777 = OpCompositeConstruct %v2float %775 %776 - %778 = OpLoad %int %l_1 + OpStore %p %767 + %769 = OpBitcast %uint %739 + %770 = OpIAdd %uint %uint_1 %769 + %768 = OpBitcast %int %770 + %771 = OpSLessThan %bool %768 %757 + OpSelectionMerge %772 None + OpBranchConditional %771 %773 %772 + %773 = OpLabel + %774 = OpAccessChain %_ptr_Function_int %stack %562 + %775 = OpLoad %int %774 + %776 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %776 %int_0 + %777 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %777 %775 + %778 = OpCompositeExtract %float %737 1 + %779 = OpCompositeExtract %float %633 0 + %780 = OpCompositeConstruct %v2float %778 %779 + %781 = OpLoad %int %l_1 OpStore %l_1 %int_0 - OpStore %l_1 %778 - %779 = OpLoad %int %top - %780 = OpAccessChain %_ptr_Function_int %stack %559 - %781 = OpLoad %int %780 - %782 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %782 %int_0 - %783 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %783 %781 - %784 = OpCompositeExtract %float %474 1 - %785 = OpCompositeExtract %float %460 1 - %786 = OpCompositeExtract %float %460 1 - %787 = OpCompositeConstruct %v3float %784 %785 %786 - %788 = OpIAdd %int %779 %int_1 - %789 = OpLoad %int %param_5 + OpStore %l_1 %781 + %782 = OpLoad %int %top + %783 = OpAccessChain %_ptr_Function_int %stack %562 + %784 = OpLoad %int %783 + %785 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %785 %int_0 + %786 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %786 %784 + %787 = OpCompositeExtract %float %477 1 + %788 = OpCompositeExtract %float %463 1 + %789 = OpCompositeExtract %float %463 1 + %790 = OpCompositeConstruct %v3float %787 %788 %789 + %791 = OpIAdd %int %782 %int_1 + %792 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %789 - OpStore %top %788 - %790 = OpAccessChain %_ptr_Function_int %stack %559 - %791 = OpLoad %int %790 - %792 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %792 %int_0 - %793 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %793 %791 - %794 = OpLoad %int %p - %795 = OpLoad %int %param_5 + OpStore %param_5 %792 + OpStore %top %791 + %793 = OpAccessChain %_ptr_Function_int %stack %562 + %794 = OpLoad %int %793 + %795 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %795 %int_0 + %796 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %796 %794 + %797 = OpLoad %int %p + %798 = OpLoad %int %param_5 OpStore %param_5 %int_0 - OpStore %param_5 %795 - %796 = OpCompositeExtract %float %460 2 - %797 = OpCompositeExtract %float %460 0 - %798 = OpCompositeExtract %float %527 0 - %799 = OpCompositeConstruct %v3float %796 %797 %798 - %800 = OpLoad %int %p + OpStore %param_5 %798 + %799 = OpCompositeExtract %float %463 2 + %800 = OpCompositeExtract %float %463 0 + %801 = OpCompositeExtract %float %530 0 + %802 = OpCompositeConstruct %v3float %799 %800 %801 + %803 = OpLoad %int %p OpStore %p %int_0 - OpStore %p %800 - %801 = OpCompositeExtract %float %433 0 - %802 = OpCompositeExtract %float %619 0 - %803 = OpCompositeExtract %float %619 0 - %804 = OpCompositeConstruct %v3float %801 %802 %803 - %805 = OpAccessChain %_ptr_Function_int %stack %479 - %806 = OpLoad %int %805 - %807 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %807 %int_0 - %808 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %808 %806 - %809 = OpAccessChain %_ptr_Function_int %stack %529 - %810 = OpLoad %int %809 - %811 = OpAccessChain %_ptr_Function_int %stack %529 - OpStore %811 %int_0 - %812 = OpAccessChain %_ptr_Function_int %stack %529 - OpStore %812 %810 - %813 = OpCompositeExtract %float %487 0 - %814 = OpCompositeExtract %float %487 1 - %815 = OpCompositeConstruct %v2float %813 %814 - %816 = OpAccessChain %_ptr_Function_int %stack %788 - %818 = OpBitcast %uint %794 - %819 = OpIAdd %uint %uint_1 %818 - %817 = OpBitcast %int %819 - OpStore %816 %817 - %820 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %820 - %821 = OpLoad %int %top - %822 = OpAccessChain %_ptr_Function_int %stack %559 - %823 = OpLoad %int %822 - %824 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %824 %int_0 - %825 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %825 %823 - %826 = OpCompositeExtract %float %499 1 - %827 = OpCompositeExtract %float %799 1 - %828 = OpCompositeConstruct %v2float %826 %827 - %829 = OpLoad %_arr_int_uint_10 %stack - OpStore %stack %99 - OpStore %stack %829 - %830 = OpBitcast %int %uint_1 - %831 = OpIAdd %int %821 %830 - %832 = OpAccessChain %_ptr_Function_int %stack %788 - %833 = OpLoad %int %832 - %834 = OpAccessChain %_ptr_Function_int %stack %788 - OpStore %834 %int_0 - %835 = OpAccessChain %_ptr_Function_int %stack %788 - OpStore %835 %833 - OpStore %top %831 - %836 = OpLoad %int %param_4 + OpStore %p %803 + %804 = OpCompositeExtract %float %436 0 + %805 = OpCompositeExtract %float %622 0 + %806 = OpCompositeExtract %float %622 0 + %807 = OpCompositeConstruct %v3float %804 %805 %806 + %808 = OpAccessChain %_ptr_Function_int %stack %482 + %809 = OpLoad %int %808 + %810 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %810 %int_0 + %811 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %811 %809 + %812 = OpAccessChain %_ptr_Function_int %stack %532 + %813 = OpLoad %int %812 + %814 = OpAccessChain %_ptr_Function_int %stack %532 + OpStore %814 %int_0 + %815 = OpAccessChain %_ptr_Function_int %stack %532 + OpStore %815 %813 + %816 = OpCompositeExtract %float %490 0 + %817 = OpCompositeExtract %float %490 1 + %818 = OpCompositeConstruct %v2float %816 %817 + %819 = OpAccessChain %_ptr_Function_int %stack %791 + %821 = OpBitcast %uint %797 + %822 = OpIAdd %uint %uint_1 %821 + %820 = OpBitcast %int %822 + OpStore %819 %820 + %823 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %823 + %824 = OpLoad %int %top + %825 = OpAccessChain %_ptr_Function_int %stack %562 + %826 = OpLoad %int %825 + %827 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %827 %int_0 + %828 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %828 %826 + %829 = OpCompositeExtract %float %502 1 + %830 = OpCompositeExtract %float %802 1 + %831 = OpCompositeConstruct %v2float %829 %830 + %832 = OpLoad %_arr_int_uint_10 %stack + OpStore %stack %102 + OpStore %stack %832 + %833 = OpBitcast %int %uint_1 + %834 = OpIAdd %int %824 %833 + %835 = OpAccessChain %_ptr_Function_int %stack %791 + %836 = OpLoad %int %835 + %837 = OpAccessChain %_ptr_Function_int %stack %791 + OpStore %837 %int_0 + %838 = OpAccessChain %_ptr_Function_int %stack %791 + OpStore %838 %836 + OpStore %top %834 + %839 = OpLoad %int %param_4 OpStore %param_4 %int_0 - OpStore %param_4 %836 - %837 = OpLoad %int %h_1 - %838 = OpAccessChain %_ptr_Function_int %stack %479 - %839 = OpLoad %int %838 - %840 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %840 %int_0 - %841 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %841 %839 - %842 = OpAccessChain %_ptr_Function_int %stack %443 - %843 = OpLoad %int %842 - %844 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %844 %int_0 - %845 = OpAccessChain %_ptr_Function_int %stack %443 - OpStore %845 %843 - %846 = OpAccessChain %_ptr_Function_int %stack %831 - OpStore %846 %837 - %847 = OpAccessChain %_ptr_Function_int %stack %559 - %848 = OpLoad %int %847 - %849 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %849 %int_0 - %850 = OpAccessChain %_ptr_Function_int %stack %559 - OpStore %850 %848 - %851 = OpCompositeExtract %float %527 1 - %852 = OpCompositeExtract %float %494 0 - %853 = OpCompositeExtract %float %494 0 - %854 = OpCompositeConstruct %v3float %851 %852 %853 - %855 = OpLoad %int %l_1 + OpStore %param_4 %839 + %840 = OpLoad %int %h_1 + %841 = OpAccessChain %_ptr_Function_int %stack %482 + %842 = OpLoad %int %841 + %843 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %843 %int_0 + %844 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %844 %842 + %845 = OpAccessChain %_ptr_Function_int %stack %446 + %846 = OpLoad %int %845 + %847 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %847 %int_0 + %848 = OpAccessChain %_ptr_Function_int %stack %446 + OpStore %848 %846 + %849 = OpAccessChain %_ptr_Function_int %stack %834 + OpStore %849 %840 + %850 = OpAccessChain %_ptr_Function_int %stack %562 + %851 = OpLoad %int %850 + %852 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %852 %int_0 + %853 = OpAccessChain %_ptr_Function_int %stack %562 + OpStore %853 %851 + %854 = OpCompositeExtract %float %530 1 + %855 = OpCompositeExtract %float %497 0 + %856 = OpCompositeExtract %float %497 0 + %857 = OpCompositeConstruct %v3float %854 %855 %856 + %858 = OpLoad %int %l_1 OpStore %l_1 %int_0 - OpStore %l_1 %855 - OpBranch %769 - %769 = OpLabel - %856 = OpAccessChain %_ptr_Function_int %stack %479 - %857 = OpLoad %int %856 - %858 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %858 %int_0 - %859 = OpAccessChain %_ptr_Function_int %stack %479 - OpStore %859 %857 - OpBranch %504 - %504 = OpLabel - %860 = OpLoad %int %l_1 + OpStore %l_1 %858 + OpBranch %772 + %772 = OpLabel + %859 = OpAccessChain %_ptr_Function_int %stack %482 + %860 = OpLoad %int %859 + %861 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %861 %int_0 + %862 = OpAccessChain %_ptr_Function_int %stack %482 + OpStore %862 %860 + OpBranch %507 + %507 = OpLabel + %863 = OpLoad %int %l_1 OpStore %l_1 %int_0 - OpStore %l_1 %860 - %861 = OpCompositeExtract %float %487 2 - %862 = OpCompositeExtract %float %494 0 - %863 = OpCompositeConstruct %v2float %861 %862 - %864 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %864 - OpBranch %502 - %503 = OpLabel - %865 = OpLoad %int %h_1 + OpStore %l_1 %863 + %864 = OpCompositeExtract %float %490 2 + %865 = OpCompositeExtract %float %497 0 + %866 = OpCompositeConstruct %v2float %864 %865 + %867 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %867 + OpBranch %505 + %506 = OpLabel + %868 = OpLoad %int %h_1 OpStore %h_1 %int_0 - OpStore %h_1 %865 + OpStore %h_1 %868 OpReturn OpFunctionEnd - %main = OpFunction %void None %416 - %867 = OpLabel - %color = OpVariable %_ptr_Function_v3float Function %168 - %i_2 = OpVariable %_ptr_Function_int Function %28 - %uv = OpVariable %_ptr_Function_v2float Function %165 - %871 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %871 + %main_1 = OpFunction %void None %419 + %870 = OpLabel + %color = OpVariable %_ptr_Function_v3float Function %171 + %i_2 = OpVariable %_ptr_Function_int Function %31 + %uv = OpVariable %_ptr_Function_v2float Function %168 + %874 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %874 OpStore %i_2 %int_0 - %874 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %874 - OpSelectionMerge %876 None - OpBranchConditional %true %877 %876 - %877 = OpLabel - %878 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %878 - %879 = OpCompositeExtract %float %35 0 - %880 = OpCompositeExtract %float %35 0 - %881 = OpCompositeConstruct %v2float %879 %880 - %882 = OpLoad %int %i_2 - %883 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %883 - %884 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %884 - %886 = OpCompositeExtract %float %881 1 - %887 = OpCompositeExtract %float %881 1 - %888 = OpCompositeConstruct %v2float %886 %887 - %889 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %889 - OpBranch %876 - %876 = OpLabel - %890 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %890 - %891 = OpCompositeExtract %float %873 0 - %892 = OpCompositeExtract %float %873 0 - %893 = OpCompositeConstruct %v2float %891 %892 - %894 = OpLoad %int %i_2 + %877 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %877 + OpSelectionMerge %879 None + OpBranchConditional %true %880 %879 + %880 = OpLabel + %881 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %881 + %882 = OpCompositeExtract %float %38 0 + %883 = OpCompositeExtract %float %38 0 + %884 = OpCompositeConstruct %v2float %882 %883 + %885 = OpLoad %int %i_2 + %886 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %886 + %887 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %887 + %889 = OpCompositeExtract %float %884 1 + %890 = OpCompositeExtract %float %884 1 + %891 = OpCompositeConstruct %v2float %889 %890 + %892 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %892 + OpBranch %879 + %879 = OpLabel + %893 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %893 + %894 = OpCompositeExtract %float %876 0 + %895 = OpCompositeExtract %float %876 0 + %896 = OpCompositeConstruct %v2float %894 %895 + %897 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %894 - %895 = OpFunctionCall %void %quicksort_ - %896 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %896 - %897 = OpLoad %v4float %gl_FragCoord - %898 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %898 - %899 = OpCompositeExtract %float %873 1 - %900 = OpCompositeExtract %float %873 1 - %901 = OpCompositeConstruct %v2float %899 %900 - %902 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %902 - %903 = OpCompositeExtract %float %897 0 - %904 = OpCompositeExtract %float %897 1 - %905 = OpCompositeConstruct %v2float %903 %904 - %906 = OpCompositeExtract %float %905 1 - %907 = OpCompositeExtract %float %893 1 - %908 = OpCompositeExtract %float %893 1 - %909 = OpCompositeConstruct %v3float %906 %907 %908 - %910 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %910 - %911 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %911 - %913 = OpAccessChain %_ptr_Uniform_v2float %x_188 %uint_0 - %914 = OpLoad %v2float %913 - %915 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %915 - %916 = OpCompositeExtract %float %897 1 - %917 = OpCompositeExtract %float %35 2 - %918 = OpCompositeExtract %float %897 3 - %919 = OpCompositeConstruct %v3float %916 %917 %918 - %920 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %920 - %921 = OpFDiv %v2float %905 %914 - %922 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %922 - %923 = OpCompositeExtract %float %901 0 - %924 = OpCompositeExtract %float %905 1 - %925 = OpCompositeConstruct %v2float %923 %924 - %926 = OpLoad %v3float %color - OpStore %color %885 - %927 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %927 - OpStore %color %926 - OpStore %uv %921 - OpStore %color %35 - %928 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %928 - %929 = OpCompositeExtract %float %905 0 - %930 = OpCompositeExtract %float %905 1 - %931 = OpCompositeExtract %float %893 1 - %932 = OpCompositeConstruct %v3float %929 %930 %931 - %933 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %933 - %934 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - %935 = OpLoad %int %934 - %936 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %936 %int_0 + OpStore %i_2 %897 + %898 = OpFunctionCall %void %quicksort_ + %899 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %899 + %900 = OpLoad %v4float %gl_FragCoord + %901 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %901 + %902 = OpCompositeExtract %float %876 1 + %903 = OpCompositeExtract %float %876 1 + %904 = OpCompositeConstruct %v2float %902 %903 + %905 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %905 + %906 = OpCompositeExtract %float %900 0 + %907 = OpCompositeExtract %float %900 1 + %908 = OpCompositeConstruct %v2float %906 %907 + %909 = OpCompositeExtract %float %908 1 + %910 = OpCompositeExtract %float %896 1 + %911 = OpCompositeExtract %float %896 1 + %912 = OpCompositeConstruct %v3float %909 %910 %911 + %913 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %913 + %914 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %914 + %916 = OpAccessChain %_ptr_Uniform_v2float %x_188 %uint_0 + %917 = OpLoad %v2float %916 + %918 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %918 + %919 = OpCompositeExtract %float %900 1 + %920 = OpCompositeExtract %float %38 2 + %921 = OpCompositeExtract %float %900 3 + %922 = OpCompositeConstruct %v3float %919 %920 %921 + %923 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %923 + %924 = OpFDiv %v2float %908 %917 + %925 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %925 + %926 = OpCompositeExtract %float %904 0 + %927 = OpCompositeExtract %float %908 1 + %928 = OpCompositeConstruct %v2float %926 %927 + %929 = OpLoad %v3float %color + OpStore %color %888 + %930 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %930 + OpStore %color %929 + OpStore %uv %924 + OpStore %color %38 + %931 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %931 + %932 = OpCompositeExtract %float %908 0 + %933 = OpCompositeExtract %float %908 1 + %934 = OpCompositeExtract %float %896 1 + %935 = OpCompositeConstruct %v3float %932 %933 %934 + %936 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %936 %937 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %937 %935 - %938 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - %939 = OpLoad %int %938 - %940 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %940 + %938 = OpLoad %int %937 + %939 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %939 %int_0 + %940 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %940 %938 %941 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 %942 = OpLoad %int %941 - %943 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %943 %int_0 + %943 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %943 %944 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %944 %942 - %945 = OpAccessChain %_ptr_Function_float %color %uint_0 - %946 = OpLoad %float %945 - %947 = OpAccessChain %_ptr_Function_float %color %uint_0 - %948 = OpLoad %float %947 - %949 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %949 %float_0 + %945 = OpLoad %int %944 + %946 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %946 %int_0 + %947 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %947 %945 + %948 = OpAccessChain %_ptr_Function_float %color %uint_0 + %949 = OpLoad %float %948 %950 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %950 %948 - %951 = OpCompositeExtract %float %35 2 - %952 = OpCompositeExtract %float %35 1 - %953 = OpCompositeConstruct %v2float %951 %952 - %954 = OpLoad %int %i_2 + %951 = OpLoad %float %950 + %952 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %952 %float_0 + %953 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %953 %951 + %954 = OpCompositeExtract %float %38 2 + %955 = OpCompositeExtract %float %38 1 + %956 = OpCompositeConstruct %v2float %954 %955 + %957 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %954 - %955 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %955 - %956 = OpCompositeExtract %float %932 0 - %957 = OpCompositeExtract %float %925 0 - %958 = OpCompositeExtract %float %925 1 - %959 = OpCompositeConstruct %v3float %956 %957 %958 - %960 = OpAccessChain %_ptr_Function_float %color %uint_0 - %961 = OpConvertSToF %float %939 - %962 = OpFAdd %float %946 %961 - OpStore %960 %962 - %963 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %963 - %964 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %964 - %965 = OpCompositeExtract %float %897 1 - %966 = OpCompositeExtract %float %897 1 - %967 = OpCompositeConstruct %v2float %965 %966 - %968 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %969 = OpLoad %float %968 - %970 = OpCompositeExtract %float %921 1 - %971 = OpCompositeExtract %float %921 0 - %972 = OpCompositeConstruct %v2float %970 %971 - %973 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %974 = OpLoad %float %973 - %975 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %975 %float_0 + OpStore %i_2 %957 + %958 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %958 + %959 = OpCompositeExtract %float %935 0 + %960 = OpCompositeExtract %float %928 0 + %961 = OpCompositeExtract %float %928 1 + %962 = OpCompositeConstruct %v3float %959 %960 %961 + %963 = OpAccessChain %_ptr_Function_float %color %uint_0 + %964 = OpConvertSToF %float %942 + %965 = OpFAdd %float %949 %964 + OpStore %963 %965 + %966 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %966 + %967 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %967 + %968 = OpCompositeExtract %float %900 1 + %969 = OpCompositeExtract %float %900 1 + %970 = OpCompositeConstruct %v2float %968 %969 + %971 = OpAccessChain %_ptr_Function_float %uv %uint_0 + %972 = OpLoad %float %971 + %973 = OpCompositeExtract %float %924 1 + %974 = OpCompositeExtract %float %924 0 + %975 = OpCompositeConstruct %v2float %973 %974 %976 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %976 %974 - %977 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %977 - %979 = OpFOrdGreaterThan %bool %969 %float_0_25 - OpSelectionMerge %980 None - OpBranchConditional %979 %981 %980 - %981 = OpLabel - %982 = OpLoad %int %i_2 + %977 = OpLoad %float %976 + %978 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %978 %float_0 + %979 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %979 %977 + %980 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %980 + %982 = OpFOrdGreaterThan %bool %972 %float_0_25 + OpSelectionMerge %983 None + OpBranchConditional %982 %984 %983 + %984 = OpLabel + %985 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %982 - %983 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - %984 = OpLoad %int %983 - %985 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %985 %int_0 + OpStore %i_2 %985 %986 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %986 %984 - %987 = OpCompositeExtract %float %873 1 - %988 = OpCompositeExtract %float %909 1 - %989 = OpCompositeExtract %float %909 1 - %990 = OpCompositeConstruct %v3float %987 %988 %989 - %991 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %992 = OpLoad %float %991 - %993 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %993 %float_0 + %987 = OpLoad %int %986 + %988 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %988 %int_0 + %989 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %989 %987 + %990 = OpCompositeExtract %float %876 1 + %991 = OpCompositeExtract %float %912 1 + %992 = OpCompositeExtract %float %912 1 + %993 = OpCompositeConstruct %v3float %990 %991 %992 %994 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %994 %992 - %995 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_1 - %996 = OpLoad %int %995 - %997 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %997 - %998 = OpCompositeExtract %float %967 0 - %999 = OpCompositeExtract %float %967 0 - %1000 = OpCompositeConstruct %v2float %998 %999 - %1001 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %1001 - %1002 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %1002 - %1003 = OpCompositeExtract %float %35 2 - %1004 = OpCompositeExtract %float %873 1 - %1005 = OpCompositeConstruct %v2float %1003 %1004 - %1006 = OpLoad %int %i_2 + %995 = OpLoad %float %994 + %996 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %996 %float_0 + %997 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %997 %995 + %998 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_1 + %999 = OpLoad %int %998 + %1000 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1000 + %1001 = OpCompositeExtract %float %970 0 + %1002 = OpCompositeExtract %float %970 0 + %1003 = OpCompositeConstruct %v2float %1001 %1002 + %1004 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %1004 + %1005 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1005 + %1006 = OpCompositeExtract %float %38 2 + %1007 = OpCompositeExtract %float %876 1 + %1008 = OpCompositeConstruct %v2float %1006 %1007 + %1009 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1006 - %1007 = OpAccessChain %_ptr_Function_float %color %int_0 - %1008 = OpLoad %float %1007 - %1009 = OpAccessChain %_ptr_Function_float %color %int_0 - %1010 = OpLoad %float %1009 - %1011 = OpAccessChain %_ptr_Function_float %color %int_0 - OpStore %1011 %float_0 + OpStore %i_2 %1009 + %1010 = OpAccessChain %_ptr_Function_float %color %int_0 + %1011 = OpLoad %float %1010 %1012 = OpAccessChain %_ptr_Function_float %color %int_0 - OpStore %1012 %1010 - %1013 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1013 - %1014 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1014 - %1015 = OpCompositeExtract %float %967 1 - %1016 = OpCompositeExtract %float %967 1 - %1017 = OpCompositeExtract %float %901 1 - %1018 = OpCompositeConstruct %v3float %1015 %1016 %1017 - %1019 = OpAccessChain %_ptr_Function_float %color %int_0 - %1020 = OpLoad %float %1019 - %1021 = OpAccessChain %_ptr_Function_float %color %int_0 - OpStore %1021 %float_0 + %1013 = OpLoad %float %1012 + %1014 = OpAccessChain %_ptr_Function_float %color %int_0 + OpStore %1014 %float_0 + %1015 = OpAccessChain %_ptr_Function_float %color %int_0 + OpStore %1015 %1013 + %1016 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1016 + %1017 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1017 + %1018 = OpCompositeExtract %float %970 1 + %1019 = OpCompositeExtract %float %970 1 + %1020 = OpCompositeExtract %float %904 1 + %1021 = OpCompositeConstruct %v3float %1018 %1019 %1020 %1022 = OpAccessChain %_ptr_Function_float %color %int_0 - OpStore %1022 %1020 - %1023 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1024 = OpConvertSToF %float %996 - %1025 = OpFAdd %float %1024 %1008 - OpStore %1023 %1025 - %1026 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - %1027 = OpLoad %int %1026 - %1028 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1028 %int_0 + %1023 = OpLoad %float %1022 + %1024 = OpAccessChain %_ptr_Function_float %color %int_0 + OpStore %1024 %float_0 + %1025 = OpAccessChain %_ptr_Function_float %color %int_0 + OpStore %1025 %1023 + %1026 = OpAccessChain %_ptr_Function_float %color %uint_0 + %1027 = OpConvertSToF %float %999 + %1028 = OpFAdd %float %1027 %1011 + OpStore %1026 %1028 %1029 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1029 %1027 - OpBranch %980 - %980 = OpLabel - %1030 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1031 = OpLoad %float %1030 - %1032 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1032 %float_0 + %1030 = OpLoad %int %1029 + %1031 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1031 %int_0 + %1032 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1032 %1030 + OpBranch %983 + %983 = OpLabel %1033 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1033 %1031 - %1034 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1035 = OpLoad %float %1034 + %1034 = OpLoad %float %1033 + %1035 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1035 %float_0 %1036 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1036 %float_0 + OpStore %1036 %1034 %1037 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1037 %1035 - %1038 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1039 = OpLoad %float %1038 + %1038 = OpLoad %float %1037 + %1039 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1039 %float_0 %1040 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1041 = OpLoad %float %1040 - %1042 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1042 %float_0 + OpStore %1040 %1038 + %1041 = OpAccessChain %_ptr_Function_float %uv %uint_0 + %1042 = OpLoad %float %1041 %1043 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1043 %1041 - %1044 = OpCompositeExtract %float %959 2 - %1045 = OpCompositeExtract %float %959 1 - %1046 = OpCompositeExtract %float %959 1 - %1047 = OpCompositeConstruct %v3float %1044 %1045 %1046 - %1048 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %1048 - %1049 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1050 = OpLoad %float %1049 - %1051 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1051 %float_0 + %1044 = OpLoad %float %1043 + %1045 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1045 %float_0 + %1046 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1046 %1044 + %1047 = OpCompositeExtract %float %962 2 + %1048 = OpCompositeExtract %float %962 1 + %1049 = OpCompositeExtract %float %962 1 + %1050 = OpCompositeConstruct %v3float %1047 %1048 %1049 + %1051 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %1051 %1052 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1052 %1050 - %1053 = OpCompositeExtract %float %873 1 - %1054 = OpCompositeExtract %float %873 1 - %1055 = OpCompositeConstruct %v2float %1053 %1054 - %1056 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1057 = OpLoad %float %1056 - %1058 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1058 %float_0 + %1053 = OpLoad %float %1052 + %1054 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1054 %float_0 + %1055 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1055 %1053 + %1056 = OpCompositeExtract %float %876 1 + %1057 = OpCompositeExtract %float %876 1 + %1058 = OpCompositeConstruct %v2float %1056 %1057 %1059 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1059 %1057 - %1061 = OpFOrdGreaterThan %bool %1039 %float_0_5 - OpSelectionMerge %1062 None - OpBranchConditional %1061 %1063 %1062 - %1063 = OpLabel - %1064 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1065 = OpLoad %float %1064 - %1066 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1066 %float_0 + %1060 = OpLoad %float %1059 + %1061 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1061 %float_0 + %1062 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1062 %1060 + %1064 = OpFOrdGreaterThan %bool %1042 %float_0_5 + OpSelectionMerge %1065 None + OpBranchConditional %1064 %1066 %1065 + %1066 = OpLabel %1067 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1067 %1065 - %1068 = OpCompositeExtract %float %893 0 - %1069 = OpCompositeExtract %float %893 0 - %1070 = OpCompositeConstruct %v2float %1068 %1069 - %1071 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1072 = OpLoad %float %1071 - %1073 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1073 %float_0 + %1068 = OpLoad %float %1067 + %1069 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1069 %float_0 + %1070 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1070 %1068 + %1071 = OpCompositeExtract %float %896 0 + %1072 = OpCompositeExtract %float %896 0 + %1073 = OpCompositeConstruct %v2float %1071 %1072 %1074 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1074 %1072 - %1075 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1076 = OpLoad %float %1075 + %1075 = OpLoad %float %1074 + %1076 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1076 %float_0 %1077 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1077 %float_0 + OpStore %1077 %1075 %1078 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1078 %1076 - %1079 = OpCompositeExtract %float %959 0 - %1080 = OpCompositeExtract %float %959 2 - %1081 = OpCompositeExtract %float %1055 1 - %1082 = OpCompositeConstruct %v3float %1079 %1080 %1081 - %1083 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1084 = OpLoad %float %1083 - %1085 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1085 %float_0 + %1079 = OpLoad %float %1078 + %1080 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1080 %float_0 + %1081 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1081 %1079 + %1082 = OpCompositeExtract %float %962 0 + %1083 = OpCompositeExtract %float %962 2 + %1084 = OpCompositeExtract %float %1058 1 + %1085 = OpCompositeConstruct %v3float %1082 %1083 %1084 %1086 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1086 %1084 - %1088 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 - %1089 = OpLoad %int %1088 - %1090 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1091 = OpLoad %float %1090 - %1092 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1092 %float_0 + %1087 = OpLoad %float %1086 + %1088 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1088 %float_0 + %1089 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1089 %1087 + %1091 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 + %1092 = OpLoad %int %1091 %1093 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1093 %1091 - %1094 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1095 = OpLoad %float %1094 - %1096 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1096 %float_0 + %1094 = OpLoad %float %1093 + %1095 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1095 %float_0 + %1096 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1096 %1094 %1097 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1097 %1095 - %1098 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 - %1099 = OpLoad %int %1098 - %1100 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 - OpStore %1100 %int_0 + %1098 = OpLoad %float %1097 + %1099 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1099 %float_0 + %1100 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1100 %1098 %1101 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 - OpStore %1101 %1099 - %1102 = OpCompositeExtract %float %925 1 - %1103 = OpCompositeExtract %float %914 0 - %1104 = OpCompositeConstruct %v2float %1102 %1103 - %1105 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1106 = OpLoad %float %1105 - %1107 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1107 %float_0 + %1102 = OpLoad %int %1101 + %1103 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 + OpStore %1103 %int_0 + %1104 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 + OpStore %1104 %1102 + %1105 = OpCompositeExtract %float %928 1 + %1106 = OpCompositeExtract %float %917 0 + %1107 = OpCompositeConstruct %v2float %1105 %1106 %1108 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1108 %1106 - %1109 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1110 = OpLoad %float %1109 - %1111 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 - %1112 = OpLoad %int %1111 - %1113 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 - OpStore %1113 %int_0 + %1109 = OpLoad %float %1108 + %1110 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1110 %float_0 + %1111 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1111 %1109 + %1112 = OpAccessChain %_ptr_Function_float %color %uint_1 + %1113 = OpLoad %float %1112 %1114 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 - OpStore %1114 %1112 - %1115 = OpCompositeExtract %float %1082 0 - %1116 = OpCompositeExtract %float %905 0 - %1117 = OpCompositeConstruct %v2float %1115 %1116 - %1118 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1119 = OpLoad %float %1118 - %1120 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1120 %float_0 + %1115 = OpLoad %int %1114 + %1116 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 + OpStore %1116 %int_0 + %1117 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_2 + OpStore %1117 %1115 + %1118 = OpCompositeExtract %float %1085 0 + %1119 = OpCompositeExtract %float %908 0 + %1120 = OpCompositeConstruct %v2float %1118 %1119 %1121 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1121 %1119 - %1122 = OpLoad %int %i_2 + %1122 = OpLoad %float %1121 + %1123 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1123 %float_0 + %1124 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1124 %1122 + %1125 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1122 - %1123 = OpCompositeExtract %float %972 1 - %1124 = OpCompositeExtract %float %873 1 - %1125 = OpCompositeConstruct %v2float %1123 %1124 - %1126 = OpLoad %int %i_2 + OpStore %i_2 %1125 + %1126 = OpCompositeExtract %float %975 1 + %1127 = OpCompositeExtract %float %876 1 + %1128 = OpCompositeConstruct %v2float %1126 %1127 + %1129 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1126 - %1127 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1128 = OpConvertSToF %float %1089 - %1129 = OpFAdd %float %1128 %1110 - OpStore %1127 %1129 - %1130 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1131 = OpLoad %float %1130 - %1132 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1132 %float_0 + OpStore %i_2 %1129 + %1130 = OpAccessChain %_ptr_Function_float %color %uint_1 + %1131 = OpConvertSToF %float %1092 + %1132 = OpFAdd %float %1131 %1113 + OpStore %1130 %1132 %1133 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1133 %1131 - OpBranch %1062 - %1062 = OpLabel - %1134 = OpLoad %int %i_2 + %1134 = OpLoad %float %1133 + %1135 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1135 %float_0 + %1136 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1136 %1134 + OpBranch %1065 + %1065 = OpLabel + %1137 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1134 - %1135 = OpCompositeExtract %float %914 0 - %1136 = OpCompositeExtract %float %914 0 - %1137 = OpCompositeConstruct %v2float %1135 %1136 - %1138 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1139 = OpLoad %float %1138 - %1140 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1140 %float_0 + OpStore %i_2 %1137 + %1138 = OpCompositeExtract %float %917 0 + %1139 = OpCompositeExtract %float %917 0 + %1140 = OpCompositeConstruct %v2float %1138 %1139 %1141 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1141 %1139 - %1142 = OpAccessChain %_ptr_Function_float %uv %int_0 - %1143 = OpLoad %float %1142 - %1144 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1144 - %1145 = OpAccessChain %_ptr_Function_float %color %uint_0 + %1142 = OpLoad %float %1141 + %1143 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1143 %float_0 + %1144 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1144 %1142 + %1145 = OpAccessChain %_ptr_Function_float %uv %int_0 %1146 = OpLoad %float %1145 - %1147 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1147 %float_0 + %1147 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1147 %1148 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1148 %1146 - %1150 = OpFOrdGreaterThan %bool %1143 %float_0_75 - OpSelectionMerge %1151 None - OpBranchConditional %1150 %1152 %1151 - %1152 = OpLabel - %1153 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1154 = OpLoad %float %1153 - %1155 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1155 %float_0 + %1149 = OpLoad %float %1148 + %1150 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1150 %float_0 + %1151 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1151 %1149 + %1153 = OpFOrdGreaterThan %bool %1146 %float_0_75 + OpSelectionMerge %1154 None + OpBranchConditional %1153 %1155 %1154 + %1155 = OpLabel %1156 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1156 %1154 - %1158 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_3 - %1159 = OpLoad %int %1158 - %1160 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1161 = OpLoad %float %1160 - %1162 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1162 %float_0 + %1157 = OpLoad %float %1156 + %1158 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1158 %float_0 + %1159 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1159 %1157 + %1161 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_3 + %1162 = OpLoad %int %1161 %1163 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1163 %1161 - %1164 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %1164 - %1165 = OpCompositeExtract %float %1137 0 - %1166 = OpCompositeExtract %float %1137 0 - %1167 = OpCompositeExtract %float %1137 0 - %1168 = OpCompositeConstruct %v3float %1165 %1166 %1167 - %1169 = OpAccessChain %_ptr_Function_float %uv %int_0 - %1170 = OpLoad %float %1169 - %1171 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1171 %float_0 + %1164 = OpLoad %float %1163 + %1165 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1165 %float_0 + %1166 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1166 %1164 + %1167 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1167 + %1168 = OpCompositeExtract %float %1140 0 + %1169 = OpCompositeExtract %float %1140 0 + %1170 = OpCompositeExtract %float %1140 0 + %1171 = OpCompositeConstruct %v3float %1168 %1169 %1170 %1172 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1172 %1170 - %1173 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1174 = OpLoad %float %1173 - %1175 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1175 %float_0 + %1173 = OpLoad %float %1172 + %1174 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1174 %float_0 + %1175 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1175 %1173 %1176 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1176 %1174 - %1177 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1178 = OpLoad %float %1177 - %1179 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1179 - %1180 = OpCompositeExtract %float %1137 0 - %1181 = OpCompositeExtract %float %914 1 - %1182 = OpCompositeExtract %float %1137 1 - %1183 = OpCompositeConstruct %v3float %1180 %1181 %1182 - %1184 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1185 = OpLoad %float %1184 - %1186 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1186 %float_0 + %1177 = OpLoad %float %1176 + %1178 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1178 %float_0 + %1179 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1179 %1177 + %1180 = OpAccessChain %_ptr_Function_float %color %uint_2 + %1181 = OpLoad %float %1180 + %1182 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1182 + %1183 = OpCompositeExtract %float %1140 0 + %1184 = OpCompositeExtract %float %917 1 + %1185 = OpCompositeExtract %float %1140 1 + %1186 = OpCompositeConstruct %v3float %1183 %1184 %1185 %1187 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1187 %1185 - %1188 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - %1189 = OpLoad %int %1188 - %1190 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1190 %int_0 + %1188 = OpLoad %float %1187 + %1189 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1189 %float_0 + %1190 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1190 %1188 %1191 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1191 %1189 - %1192 = OpCompositeExtract %float %873 0 - %1193 = OpCompositeExtract %float %873 1 - %1194 = OpCompositeConstruct %v2float %1192 %1193 - %1195 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1196 = OpLoad %float %1195 - %1197 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1197 %float_0 + %1192 = OpLoad %int %1191 + %1193 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1193 %int_0 + %1194 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1194 %1192 + %1195 = OpCompositeExtract %float %876 0 + %1196 = OpCompositeExtract %float %876 1 + %1197 = OpCompositeConstruct %v2float %1195 %1196 %1198 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1198 %1196 - %1199 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1200 = OpConvertSToF %float %1159 - %1201 = OpFAdd %float %1178 %1200 - OpStore %1199 %1201 - %1202 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %1202 - %1203 = OpCompositeExtract %float %1194 1 - %1204 = OpCompositeExtract %float %1194 1 - %1205 = OpCompositeConstruct %v2float %1203 %1204 - OpBranch %1151 - %1151 = OpLabel - %1206 = OpAccessChain %_ptr_Function_float %uv %int_0 - %1207 = OpLoad %float %1206 - %1208 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1208 %float_0 + %1199 = OpLoad %float %1198 + %1200 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1200 %float_0 + %1201 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1201 %1199 + %1202 = OpAccessChain %_ptr_Function_float %color %uint_2 + %1203 = OpConvertSToF %float %1162 + %1204 = OpFAdd %float %1181 %1203 + OpStore %1202 %1204 + %1205 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %1205 + %1206 = OpCompositeExtract %float %1197 1 + %1207 = OpCompositeExtract %float %1197 1 + %1208 = OpCompositeConstruct %v2float %1206 %1207 + OpBranch %1154 + %1154 = OpLabel %1209 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1209 %1207 - %1210 = OpCompositeExtract %float %967 0 - %1211 = OpCompositeExtract %float %967 1 - %1212 = OpCompositeExtract %float %967 1 - %1213 = OpCompositeConstruct %v3float %1210 %1211 %1212 - %1215 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - %1216 = OpLoad %int %1215 - %1217 = OpAccessChain %_ptr_Function_float %uv %int_0 - %1218 = OpLoad %float %1217 - %1219 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1219 %float_0 + %1210 = OpLoad %float %1209 + %1211 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1211 %float_0 + %1212 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1212 %1210 + %1213 = OpCompositeExtract %float %970 0 + %1214 = OpCompositeExtract %float %970 1 + %1215 = OpCompositeExtract %float %970 1 + %1216 = OpCompositeConstruct %v3float %1213 %1214 %1215 + %1218 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + %1219 = OpLoad %int %1218 %1220 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1220 %1218 - %1221 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1221 - %1222 = OpCompositeExtract %float %893 1 - %1223 = OpCompositeExtract %float %959 0 - %1224 = OpCompositeExtract %float %959 0 - %1225 = OpCompositeConstruct %v3float %1222 %1223 %1224 - %1226 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - %1227 = OpLoad %int %1226 - %1228 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1228 %int_0 + %1221 = OpLoad %float %1220 + %1222 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1222 %float_0 + %1223 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1223 %1221 + %1224 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1224 + %1225 = OpCompositeExtract %float %896 1 + %1226 = OpCompositeExtract %float %962 0 + %1227 = OpCompositeExtract %float %962 0 + %1228 = OpCompositeConstruct %v3float %1225 %1226 %1227 %1229 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1229 %1227 - %1230 = OpCompositeExtract %float %914 0 - %1231 = OpCompositeExtract %float %897 2 - %1232 = OpCompositeConstruct %v2float %1230 %1231 - %1233 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1234 = OpLoad %float %1233 - %1235 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1235 %float_0 + %1230 = OpLoad %int %1229 + %1231 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1231 %int_0 + %1232 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1232 %1230 + %1233 = OpCompositeExtract %float %917 0 + %1234 = OpCompositeExtract %float %900 2 + %1235 = OpCompositeConstruct %v2float %1233 %1234 %1236 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1236 %1234 - %1237 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1238 = OpLoad %float %1237 - %1239 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1240 = OpLoad %float %1239 - %1241 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1241 %float_0 + %1237 = OpLoad %float %1236 + %1238 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1238 %float_0 + %1239 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1239 %1237 + %1240 = OpAccessChain %_ptr_Function_float %color %uint_1 + %1241 = OpLoad %float %1240 %1242 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1242 %1240 - %1243 = OpCompositeExtract %float %1137 0 - %1244 = OpCompositeExtract %float %925 0 - %1245 = OpCompositeConstruct %v2float %1243 %1244 - %1246 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1247 = OpLoad %float %1246 - %1248 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1248 %float_0 + %1243 = OpLoad %float %1242 + %1244 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1244 %float_0 + %1245 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1245 %1243 + %1246 = OpCompositeExtract %float %1140 0 + %1247 = OpCompositeExtract %float %928 0 + %1248 = OpCompositeConstruct %v2float %1246 %1247 %1249 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1249 %1247 - %1250 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1251 = OpLoad %float %1250 - %1252 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1252 %float_0 + %1250 = OpLoad %float %1249 + %1251 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1251 %float_0 + %1252 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1252 %1250 %1253 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1253 %1251 - %1254 = OpCompositeExtract %float %932 2 - %1255 = OpCompositeExtract %float %1047 1 - %1256 = OpCompositeConstruct %v2float %1254 %1255 - %1257 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1258 = OpConvertSToF %float %1216 - %1259 = OpFAdd %float %1238 %1258 - OpStore %1257 %1259 - %1260 = OpCompositeExtract %float %873 0 - %1261 = OpCompositeExtract %float %1213 0 - %1262 = OpCompositeExtract %float %873 1 - %1263 = OpCompositeConstruct %v3float %1260 %1261 %1262 - %1264 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1265 = OpLoad %float %1264 - %1266 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1266 %float_0 + %1254 = OpLoad %float %1253 + %1255 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1255 %float_0 + %1256 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1256 %1254 + %1257 = OpCompositeExtract %float %935 2 + %1258 = OpCompositeExtract %float %1050 1 + %1259 = OpCompositeConstruct %v2float %1257 %1258 + %1260 = OpAccessChain %_ptr_Function_float %color %uint_1 + %1261 = OpConvertSToF %float %1219 + %1262 = OpFAdd %float %1241 %1261 + OpStore %1260 %1262 + %1263 = OpCompositeExtract %float %876 0 + %1264 = OpCompositeExtract %float %1216 0 + %1265 = OpCompositeExtract %float %876 1 + %1266 = OpCompositeConstruct %v3float %1263 %1264 %1265 %1267 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1267 %1265 - %1268 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1269 = OpLoad %float %1268 - %1270 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1270 %float_0 + %1268 = OpLoad %float %1267 + %1269 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1269 %float_0 + %1270 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1270 %1268 %1271 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1271 %1269 - %1272 = OpCompositeExtract %float %1213 0 - %1273 = OpCompositeExtract %float %1213 1 - %1274 = OpCompositeConstruct %v2float %1272 %1273 - %1275 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1276 = OpLoad %float %1275 - %1277 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1277 %float_0 + %1272 = OpLoad %float %1271 + %1273 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1273 %float_0 + %1274 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1274 %1272 + %1275 = OpCompositeExtract %float %1216 0 + %1276 = OpCompositeExtract %float %1216 1 + %1277 = OpCompositeConstruct %v2float %1275 %1276 %1278 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1278 %1276 - %1279 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1280 = OpLoad %float %1279 - %1281 = OpLoad %int %i_2 + %1279 = OpLoad %float %1278 + %1280 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1280 %float_0 + %1281 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1281 %1279 + %1282 = OpAccessChain %_ptr_Function_float %uv %uint_1 + %1283 = OpLoad %float %1282 + %1284 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1281 - %1282 = OpCompositeExtract %float %873 1 - %1283 = OpCompositeExtract %float %967 1 - %1284 = OpCompositeExtract %float %873 0 - %1285 = OpCompositeConstruct %v3float %1282 %1283 %1284 - %1286 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - %1287 = OpLoad %int %1286 - %1288 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1288 %int_0 + OpStore %i_2 %1284 + %1285 = OpCompositeExtract %float %876 1 + %1286 = OpCompositeExtract %float %970 1 + %1287 = OpCompositeExtract %float %876 0 + %1288 = OpCompositeConstruct %v3float %1285 %1286 %1287 %1289 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1289 %1287 - %1290 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1291 = OpLoad %float %1290 - %1292 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1292 %float_0 + %1290 = OpLoad %int %1289 + %1291 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1291 %int_0 + %1292 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1292 %1290 %1293 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1293 %1291 - %1294 = OpCompositeExtract %float %893 0 - %1295 = OpCompositeExtract %float %893 0 - %1296 = OpCompositeExtract %float %873 1 - %1297 = OpCompositeConstruct %v3float %1294 %1295 %1296 - %1298 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1299 = OpLoad %float %1298 - %1300 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1300 %float_0 + %1294 = OpLoad %float %1293 + %1295 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1295 %float_0 + %1296 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1296 %1294 + %1297 = OpCompositeExtract %float %896 0 + %1298 = OpCompositeExtract %float %896 0 + %1299 = OpCompositeExtract %float %876 1 + %1300 = OpCompositeConstruct %v3float %1297 %1298 %1299 %1301 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1301 %1299 - %1302 = OpFOrdGreaterThan %bool %1280 %float_0_25 - OpSelectionMerge %1303 None - OpBranchConditional %1302 %1304 %1303 - %1304 = OpLabel - %1305 = OpCompositeExtract %float %901 0 - %1306 = OpCompositeExtract %float %1297 2 - %1307 = OpCompositeConstruct %v2float %1305 %1306 - %1308 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1308 - %1310 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_5 - %1311 = OpLoad %int %1310 - %1312 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1313 = OpLoad %float %1312 - %1314 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1314 %float_0 + %1302 = OpLoad %float %1301 + %1303 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1303 %float_0 + %1304 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1304 %1302 + %1305 = OpFOrdGreaterThan %bool %1283 %float_0_25 + OpSelectionMerge %1306 None + OpBranchConditional %1305 %1307 %1306 + %1307 = OpLabel + %1308 = OpCompositeExtract %float %904 0 + %1309 = OpCompositeExtract %float %1300 2 + %1310 = OpCompositeConstruct %v2float %1308 %1309 + %1311 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1311 + %1313 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_5 + %1314 = OpLoad %int %1313 %1315 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1315 %1313 - %1316 = OpLoad %int %i_2 - OpStore %i_2 %int_0 - OpStore %i_2 %1316 - %1317 = OpLoad %int %i_2 - OpStore %i_2 %int_0 - OpStore %i_2 %1317 + %1316 = OpLoad %float %1315 + %1317 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1317 %float_0 %1318 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1319 = OpLoad %float %1318 - %1320 = OpAccessChain %_ptr_Function_float %uv %int_0 - %1321 = OpLoad %float %1320 - %1322 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1322 %float_0 + OpStore %1318 %1316 + %1319 = OpLoad %int %i_2 + OpStore %i_2 %int_0 + OpStore %i_2 %1319 + %1320 = OpLoad %int %i_2 + OpStore %i_2 %int_0 + OpStore %i_2 %1320 + %1321 = OpAccessChain %_ptr_Function_float %color %uint_0 + %1322 = OpLoad %float %1321 %1323 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1323 %1321 - %1324 = OpCompositeExtract %float %972 0 - %1325 = OpCompositeExtract %float %1245 1 - %1326 = OpCompositeExtract %float %972 1 - %1327 = OpCompositeConstruct %v3float %1324 %1325 %1326 - %1328 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %1328 - %1329 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1330 = OpLoad %float %1329 - %1331 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1331 %float_0 + %1324 = OpLoad %float %1323 + %1325 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1325 %float_0 + %1326 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1326 %1324 + %1327 = OpCompositeExtract %float %975 0 + %1328 = OpCompositeExtract %float %1248 1 + %1329 = OpCompositeExtract %float %975 1 + %1330 = OpCompositeConstruct %v3float %1327 %1328 %1329 + %1331 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1331 %1332 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1332 %1330 - %1333 = OpLoad %int %i_2 + %1333 = OpLoad %float %1332 + %1334 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1334 %float_0 + %1335 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1335 %1333 + %1336 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1333 - %1334 = OpCompositeExtract %float %897 3 - %1335 = OpCompositeExtract %float %897 3 - %1336 = OpCompositeExtract %float %921 0 - %1337 = OpCompositeConstruct %v3float %1334 %1335 %1336 - %1338 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1339 = OpLoad %float %1338 - %1340 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1340 %float_0 + OpStore %i_2 %1336 + %1337 = OpCompositeExtract %float %900 3 + %1338 = OpCompositeExtract %float %900 3 + %1339 = OpCompositeExtract %float %924 0 + %1340 = OpCompositeConstruct %v3float %1337 %1338 %1339 %1341 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1341 %1339 - %1342 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1343 = OpConvertSToF %float %1311 - %1344 = OpFAdd %float %1343 %1319 - OpStore %1342 %1344 - %1345 = OpCompositeExtract %float %967 1 - %1346 = OpCompositeExtract %float %925 0 - %1347 = OpCompositeExtract %float %967 1 - %1348 = OpCompositeConstruct %v3float %1345 %1346 %1347 - %1349 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1350 = OpLoad %float %1349 - %1351 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1351 %float_0 + %1342 = OpLoad %float %1341 + %1343 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1343 %float_0 + %1344 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1344 %1342 + %1345 = OpAccessChain %_ptr_Function_float %color %uint_0 + %1346 = OpConvertSToF %float %1314 + %1347 = OpFAdd %float %1346 %1322 + OpStore %1345 %1347 + %1348 = OpCompositeExtract %float %970 1 + %1349 = OpCompositeExtract %float %928 0 + %1350 = OpCompositeExtract %float %970 1 + %1351 = OpCompositeConstruct %v3float %1348 %1349 %1350 %1352 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1352 %1350 - OpBranch %1303 - %1303 = OpLabel - %1353 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1354 = OpLoad %float %1353 - %1355 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1355 %float_0 + %1353 = OpLoad %float %1352 + %1354 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1354 %float_0 + %1355 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1355 %1353 + OpBranch %1306 + %1306 = OpLabel %1356 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1356 %1354 - %1357 = OpCompositeExtract %float %1137 0 - %1358 = OpCompositeExtract %float %925 1 - %1359 = OpCompositeExtract %float %925 0 - %1360 = OpCompositeConstruct %v3float %1357 %1358 %1359 - %1361 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1362 = OpLoad %float %1361 - %1363 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1363 %float_0 + %1357 = OpLoad %float %1356 + %1358 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1358 %float_0 + %1359 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1359 %1357 + %1360 = OpCompositeExtract %float %1140 0 + %1361 = OpCompositeExtract %float %928 1 + %1362 = OpCompositeExtract %float %928 0 + %1363 = OpCompositeConstruct %v3float %1360 %1361 %1362 %1364 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1364 %1362 - %1365 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - %1366 = OpLoad %int %1365 - %1367 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1367 %int_0 + %1365 = OpLoad %float %1364 + %1366 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1366 %float_0 + %1367 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1367 %1365 %1368 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1368 %1366 - %1369 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1370 = OpLoad %float %1369 - %1371 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - %1372 = OpLoad %int %1371 - %1373 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1373 %int_0 + %1369 = OpLoad %int %1368 + %1370 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1370 %int_0 + %1371 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1371 %1369 + %1372 = OpAccessChain %_ptr_Function_float %uv %uint_1 + %1373 = OpLoad %float %1372 %1374 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1374 %1372 - %1375 = OpFOrdGreaterThan %bool %1370 %float_0_5 - OpSelectionMerge %1376 None - OpBranchConditional %1375 %1377 %1376 - %1377 = OpLabel - %1378 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1379 = OpLoad %float %1378 - %1380 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1380 %float_0 + %1375 = OpLoad %int %1374 + %1376 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1376 %int_0 + %1377 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1377 %1375 + %1378 = OpFOrdGreaterThan %bool %1373 %float_0_5 + OpSelectionMerge %1379 None + OpBranchConditional %1378 %1380 %1379 + %1380 = OpLabel %1381 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1381 %1379 - %1382 = OpCompositeExtract %float %1297 1 - %1383 = OpCompositeExtract %float %972 1 - %1384 = OpCompositeConstruct %v2float %1382 %1383 - %1385 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1386 = OpLoad %float %1385 - %1387 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1387 %float_0 + %1382 = OpLoad %float %1381 + %1383 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1383 %float_0 + %1384 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1384 %1382 + %1385 = OpCompositeExtract %float %1300 1 + %1386 = OpCompositeExtract %float %975 1 + %1387 = OpCompositeConstruct %v2float %1385 %1386 %1388 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1388 %1386 - %1389 = OpCompositeExtract %float %919 2 - %1390 = OpCompositeExtract %float %919 1 - %1391 = OpCompositeConstruct %v2float %1389 %1390 - %1392 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1393 = OpLoad %float %1392 - %1394 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1394 %float_0 + %1389 = OpLoad %float %1388 + %1390 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1390 %float_0 + %1391 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1391 %1389 + %1392 = OpCompositeExtract %float %922 2 + %1393 = OpCompositeExtract %float %922 1 + %1394 = OpCompositeConstruct %v2float %1392 %1393 %1395 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1395 %1393 - %1397 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 - %1398 = OpLoad %int %1397 - %1399 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1400 = OpLoad %float %1399 - %1401 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1401 %float_0 + %1396 = OpLoad %float %1395 + %1397 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1397 %float_0 + %1398 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1398 %1396 + %1400 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 + %1401 = OpLoad %int %1400 %1402 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1402 %1400 - %1403 = OpLoad %int %i_2 + %1403 = OpLoad %float %1402 + %1404 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1404 %float_0 + %1405 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1405 %1403 + %1406 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1403 - %1404 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - %1405 = OpLoad %int %1404 - %1406 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1406 %int_0 + OpStore %i_2 %1406 %1407 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1407 %1405 - %1408 = OpCompositeExtract %float %1225 2 - %1409 = OpCompositeExtract %float %1225 1 - %1410 = OpCompositeConstruct %v2float %1408 %1409 - %1411 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1412 = OpLoad %float %1411 - %1413 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %1413 - %1414 = OpAccessChain %_ptr_Function_float %color %uint_0 + %1408 = OpLoad %int %1407 + %1409 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1409 %int_0 + %1410 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1410 %1408 + %1411 = OpCompositeExtract %float %1228 2 + %1412 = OpCompositeExtract %float %1228 1 + %1413 = OpCompositeConstruct %v2float %1411 %1412 + %1414 = OpAccessChain %_ptr_Function_float %color %uint_1 %1415 = OpLoad %float %1414 - %1416 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1416 %float_0 + %1416 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %1416 %1417 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1417 %1415 - %1418 = OpCompositeExtract %float %1245 1 - %1419 = OpCompositeExtract %float %1245 0 - %1420 = OpCompositeConstruct %v2float %1418 %1419 - %1421 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 - %1422 = OpLoad %int %1421 - %1423 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 - OpStore %1423 %int_0 + %1418 = OpLoad %float %1417 + %1419 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1419 %float_0 + %1420 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1420 %1418 + %1421 = OpCompositeExtract %float %1248 1 + %1422 = OpCompositeExtract %float %1248 0 + %1423 = OpCompositeConstruct %v2float %1421 %1422 %1424 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 - OpStore %1424 %1422 - %1425 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 - %1426 = OpLoad %int %1425 + %1425 = OpLoad %int %1424 + %1426 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 + OpStore %1426 %int_0 %1427 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 - OpStore %1427 %int_0 + OpStore %1427 %1425 %1428 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 - OpStore %1428 %1426 - %1429 = OpCompositeExtract %float %1297 2 - %1430 = OpCompositeExtract %float %1297 2 - %1431 = OpCompositeConstruct %v2float %1429 %1430 - %1432 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %1432 - %1433 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1434 = OpConvertSToF %float %1398 - %1435 = OpFAdd %float %1434 %1412 - OpStore %1433 %1435 - %1436 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1437 = OpLoad %float %1436 - %1438 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1438 %float_0 + %1429 = OpLoad %int %1428 + %1430 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 + OpStore %1430 %int_0 + %1431 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_6 + OpStore %1431 %1429 + %1432 = OpCompositeExtract %float %1300 2 + %1433 = OpCompositeExtract %float %1300 2 + %1434 = OpCompositeConstruct %v2float %1432 %1433 + %1435 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1435 + %1436 = OpAccessChain %_ptr_Function_float %color %uint_1 + %1437 = OpConvertSToF %float %1401 + %1438 = OpFAdd %float %1437 %1415 + OpStore %1436 %1438 %1439 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1439 %1437 - %1440 = OpCompositeExtract %float %35 1 - %1441 = OpCompositeExtract %float %967 0 - %1442 = OpCompositeConstruct %v2float %1440 %1441 - %1443 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1444 = OpLoad %float %1443 - %1445 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1445 %float_0 + %1440 = OpLoad %float %1439 + %1441 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1441 %float_0 + %1442 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1442 %1440 + %1443 = OpCompositeExtract %float %38 1 + %1444 = OpCompositeExtract %float %970 0 + %1445 = OpCompositeConstruct %v2float %1443 %1444 %1446 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1446 %1444 - OpBranch %1376 - %1376 = OpLabel - %1447 = OpCompositeExtract %float %972 1 - %1448 = OpCompositeExtract %float %972 1 - %1449 = OpCompositeConstruct %v2float %1447 %1448 - %1450 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1451 = OpLoad %float %1450 - %1452 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1452 %float_0 + %1447 = OpLoad %float %1446 + %1448 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1448 %float_0 + %1449 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1449 %1447 + OpBranch %1379 + %1379 = OpLabel + %1450 = OpCompositeExtract %float %975 1 + %1451 = OpCompositeExtract %float %975 1 + %1452 = OpCompositeConstruct %v2float %1450 %1451 %1453 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1453 %1451 - %1454 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1455 = OpLoad %float %1454 - %1456 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %1456 - %1457 = OpCompositeExtract %float %1245 0 - %1458 = OpCompositeExtract %float %1245 1 - %1459 = OpCompositeConstruct %v2float %1457 %1458 - %1460 = OpAccessChain %_ptr_Function_float %uv %int_0 - %1461 = OpLoad %float %1460 - %1462 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1462 %float_0 + %1454 = OpLoad %float %1453 + %1455 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1455 %float_0 + %1456 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1456 %1454 + %1457 = OpAccessChain %_ptr_Function_float %uv %uint_1 + %1458 = OpLoad %float %1457 + %1459 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1459 + %1460 = OpCompositeExtract %float %1248 0 + %1461 = OpCompositeExtract %float %1248 1 + %1462 = OpCompositeConstruct %v2float %1460 %1461 %1463 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1463 %1461 - %1464 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1465 = OpLoad %float %1464 - %1466 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1466 %float_0 + %1464 = OpLoad %float %1463 + %1465 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1465 %float_0 + %1466 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1466 %1464 %1467 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1467 %1465 - %1468 = OpCompositeExtract %float %914 0 - %1469 = OpCompositeExtract %float %914 1 - %1470 = OpCompositeExtract %float %914 1 - %1471 = OpCompositeConstruct %v3float %1468 %1469 %1470 - %1472 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - %1473 = OpLoad %int %1472 - %1474 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1474 %int_0 + %1468 = OpLoad %float %1467 + %1469 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1469 %float_0 + %1470 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1470 %1468 + %1471 = OpCompositeExtract %float %917 0 + %1472 = OpCompositeExtract %float %917 1 + %1473 = OpCompositeExtract %float %917 1 + %1474 = OpCompositeConstruct %v3float %1471 %1472 %1473 %1475 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1475 %1473 - %1476 = OpFOrdGreaterThan %bool %1455 %float_0_75 - OpSelectionMerge %1477 None - OpBranchConditional %1476 %1478 %1477 - %1478 = OpLabel - %1479 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1479 - %1480 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1481 = OpLoad %float %1480 - %1482 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1482 %float_0 + %1476 = OpLoad %int %1475 + %1477 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1477 %int_0 + %1478 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1478 %1476 + %1479 = OpFOrdGreaterThan %bool %1458 %float_0_75 + OpSelectionMerge %1480 None + OpBranchConditional %1479 %1481 %1480 + %1481 = OpLabel + %1482 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1482 %1483 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1483 %1481 - %1484 = OpCompositeExtract %float %921 1 - %1485 = OpCompositeExtract %float %921 0 - %1486 = OpCompositeExtract %float %921 1 - %1487 = OpCompositeConstruct %v3float %1484 %1485 %1486 - %1488 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1488 - %1490 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_7 - %1491 = OpLoad %int %1490 - %1492 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1493 = OpLoad %float %1492 - %1494 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1494 %float_0 + %1484 = OpLoad %float %1483 + %1485 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1485 %float_0 + %1486 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1486 %1484 + %1487 = OpCompositeExtract %float %924 1 + %1488 = OpCompositeExtract %float %924 0 + %1489 = OpCompositeExtract %float %924 1 + %1490 = OpCompositeConstruct %v3float %1487 %1488 %1489 + %1491 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1491 + %1493 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_7 + %1494 = OpLoad %int %1493 %1495 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1495 %1493 - %1496 = OpCompositeExtract %float %1245 0 - %1497 = OpCompositeExtract %float %1137 1 - %1498 = OpCompositeExtract %float %1137 0 - %1499 = OpCompositeConstruct %v3float %1496 %1497 %1498 - %1500 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1501 = OpLoad %float %1500 - %1502 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1502 %float_0 + %1496 = OpLoad %float %1495 + %1497 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1497 %float_0 + %1498 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1498 %1496 + %1499 = OpCompositeExtract %float %1248 0 + %1500 = OpCompositeExtract %float %1140 1 + %1501 = OpCompositeExtract %float %1140 0 + %1502 = OpCompositeConstruct %v3float %1499 %1500 %1501 %1503 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1503 %1501 - %1504 = OpCompositeExtract %float %1263 0 - %1505 = OpCompositeExtract %float %1055 1 - %1506 = OpCompositeConstruct %v2float %1504 %1505 - %1507 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - %1508 = OpLoad %int %1507 - %1509 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1509 %int_0 + %1504 = OpLoad %float %1503 + %1505 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1505 %float_0 + %1506 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1506 %1504 + %1507 = OpCompositeExtract %float %1266 0 + %1508 = OpCompositeExtract %float %1058 1 + %1509 = OpCompositeConstruct %v2float %1507 %1508 %1510 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 - OpStore %1510 %1508 - %1511 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1512 = OpLoad %float %1511 - %1513 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1513 %float_0 + %1511 = OpLoad %int %1510 + %1512 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1512 %int_0 + %1513 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_0 + OpStore %1513 %1511 %1514 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1514 %1512 - %1515 = OpCompositeExtract %float %1274 0 - %1516 = OpCompositeExtract %float %1274 1 - %1517 = OpCompositeExtract %float %1274 0 - %1518 = OpCompositeConstruct %v3float %1515 %1516 %1517 - %1519 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1520 = OpLoad %float %1519 - %1521 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1521 %float_0 + %1515 = OpLoad %float %1514 + %1516 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1516 %float_0 + %1517 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1517 %1515 + %1518 = OpCompositeExtract %float %1277 0 + %1519 = OpCompositeExtract %float %1277 1 + %1520 = OpCompositeExtract %float %1277 0 + %1521 = OpCompositeConstruct %v3float %1518 %1519 %1520 %1522 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1522 %1520 - %1523 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1524 = OpLoad %float %1523 - %1525 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1526 = OpLoad %float %1525 - %1527 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1527 %float_0 + %1523 = OpLoad %float %1522 + %1524 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1524 %float_0 + %1525 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1525 %1523 + %1526 = OpAccessChain %_ptr_Function_float %color %uint_2 + %1527 = OpLoad %float %1526 %1528 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1528 %1526 - %1529 = OpCompositeExtract %float %897 0 - %1530 = OpCompositeExtract %float %897 1 - %1531 = OpCompositeConstruct %v2float %1529 %1530 - %1532 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1533 = OpLoad %float %1532 - %1534 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1534 %float_0 + %1529 = OpLoad %float %1528 + %1530 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1530 %float_0 + %1531 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1531 %1529 + %1532 = OpCompositeExtract %float %900 0 + %1533 = OpCompositeExtract %float %900 1 + %1534 = OpCompositeConstruct %v2float %1532 %1533 %1535 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1535 %1533 - %1536 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1537 = OpLoad %float %1536 - %1538 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1538 %float_0 + %1536 = OpLoad %float %1535 + %1537 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1537 %float_0 + %1538 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1538 %1536 %1539 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1539 %1537 - %1540 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1541 = OpLoad %float %1540 + %1540 = OpLoad %float %1539 + %1541 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1541 %float_0 %1542 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1542 %float_0 + OpStore %1542 %1540 %1543 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1543 %1541 - %1544 = OpCompositeExtract %float %1531 1 - %1545 = OpCompositeExtract %float %1531 1 - %1546 = OpCompositeExtract %float %1471 2 - %1547 = OpCompositeConstruct %v3float %1544 %1545 %1546 - %1548 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1549 = OpLoad %float %1548 - %1550 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1550 %float_0 + %1544 = OpLoad %float %1543 + %1545 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1545 %float_0 + %1546 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1546 %1544 + %1547 = OpCompositeExtract %float %1534 1 + %1548 = OpCompositeExtract %float %1534 1 + %1549 = OpCompositeExtract %float %1474 2 + %1550 = OpCompositeConstruct %v3float %1547 %1548 %1549 %1551 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1551 %1549 - %1552 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1553 = OpConvertSToF %float %1491 - %1554 = OpFAdd %float %1553 %1524 - OpStore %1552 %1554 - %1555 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1556 = OpLoad %float %1555 - %1557 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1557 %float_0 + %1552 = OpLoad %float %1551 + %1553 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1553 %float_0 + %1554 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1554 %1552 + %1555 = OpAccessChain %_ptr_Function_float %color %uint_2 + %1556 = OpConvertSToF %float %1494 + %1557 = OpFAdd %float %1556 %1527 + OpStore %1555 %1557 %1558 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1558 %1556 - %1559 = OpCompositeExtract %float %959 0 - %1560 = OpCompositeExtract %float %959 2 - %1561 = OpCompositeConstruct %v2float %1559 %1560 - %1562 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1563 = OpLoad %float %1562 - %1564 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1564 %float_0 + %1559 = OpLoad %float %1558 + %1560 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1560 %float_0 + %1561 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1561 %1559 + %1562 = OpCompositeExtract %float %962 0 + %1563 = OpCompositeExtract %float %962 2 + %1564 = OpCompositeConstruct %v2float %1562 %1563 %1565 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1565 %1563 - OpBranch %1477 - %1477 = OpLabel - %1566 = OpLoad %int %i_2 + %1566 = OpLoad %float %1565 + %1567 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1567 %float_0 + %1568 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1568 %1566 + OpBranch %1480 + %1480 = OpLabel + %1569 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1566 - %1567 = OpCompositeExtract %float %932 1 - %1568 = OpCompositeExtract %float %921 1 - %1569 = OpCompositeConstruct %v2float %1567 %1568 - %1570 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %1570 - %1572 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 - %1573 = OpLoad %int %1572 - %1574 = OpLoad %int %i_2 + OpStore %i_2 %1569 + %1570 = OpCompositeExtract %float %935 1 + %1571 = OpCompositeExtract %float %924 1 + %1572 = OpCompositeConstruct %v2float %1570 %1571 + %1573 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %1573 + %1575 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 + %1576 = OpLoad %int %1575 + %1577 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1574 - %1575 = OpCompositeExtract %float %905 0 - %1576 = OpCompositeExtract %float %932 2 - %1577 = OpCompositeConstruct %v2float %1575 %1576 - %1578 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 - %1579 = OpLoad %int %1578 - %1580 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 - OpStore %1580 %int_0 + OpStore %i_2 %1577 + %1578 = OpCompositeExtract %float %908 0 + %1579 = OpCompositeExtract %float %935 2 + %1580 = OpCompositeConstruct %v2float %1578 %1579 %1581 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 - OpStore %1581 %1579 - %1582 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1583 = OpLoad %float %1582 - %1584 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1584 %float_0 + %1582 = OpLoad %int %1581 + %1583 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 + OpStore %1583 %int_0 + %1584 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 + OpStore %1584 %1582 %1585 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1585 %1583 - %1586 = OpCompositeExtract %float %959 1 - %1587 = OpCompositeExtract %float %873 0 - %1588 = OpCompositeConstruct %v2float %1586 %1587 - %1589 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1590 = OpLoad %float %1589 - %1591 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1591 %float_0 + %1586 = OpLoad %float %1585 + %1587 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1587 %float_0 + %1588 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1588 %1586 + %1589 = OpCompositeExtract %float %962 1 + %1590 = OpCompositeExtract %float %876 0 + %1591 = OpCompositeConstruct %v2float %1589 %1590 %1592 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1592 %1590 - %1593 = OpCompositeExtract %float %1588 0 - %1594 = OpCompositeExtract %float %1588 1 - %1595 = OpCompositeExtract %float %1588 0 - %1596 = OpCompositeConstruct %v3float %1593 %1594 %1595 - %1597 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1598 = OpLoad %float %1597 - %1599 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1599 %float_0 + %1593 = OpLoad %float %1592 + %1594 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1594 %float_0 + %1595 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1595 %1593 + %1596 = OpCompositeExtract %float %1591 0 + %1597 = OpCompositeExtract %float %1591 1 + %1598 = OpCompositeExtract %float %1591 0 + %1599 = OpCompositeConstruct %v3float %1596 %1597 %1598 %1600 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1600 %1598 - %1601 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1602 = OpLoad %float %1601 - %1603 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1604 = OpLoad %float %1603 - %1605 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1605 %float_0 + %1601 = OpLoad %float %1600 + %1602 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1602 %float_0 + %1603 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1603 %1601 + %1604 = OpAccessChain %_ptr_Function_float %color %uint_2 + %1605 = OpLoad %float %1604 %1606 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1606 %1604 - %1607 = OpCompositeExtract %float %1459 0 - %1608 = OpCompositeExtract %float %1449 0 - %1609 = OpCompositeConstruct %v2float %1607 %1608 - %1610 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - %1611 = OpLoad %int %1610 - %1612 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1612 %int_0 + %1607 = OpLoad %float %1606 + %1608 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1608 %float_0 + %1609 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1609 %1607 + %1610 = OpCompositeExtract %float %1462 0 + %1611 = OpCompositeExtract %float %1452 0 + %1612 = OpCompositeConstruct %v2float %1610 %1611 %1613 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1613 %1611 - %1614 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1615 = OpLoad %float %1614 - %1616 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1616 %float_0 + %1614 = OpLoad %int %1613 + %1615 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1615 %int_0 + %1616 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1616 %1614 %1617 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1617 %1615 - %1618 = OpCompositeExtract %float %1055 0 - %1619 = OpCompositeExtract %float %901 0 - %1620 = OpCompositeConstruct %v2float %1618 %1619 - %1621 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1622 = OpLoad %float %1621 - %1623 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1623 %float_0 + %1618 = OpLoad %float %1617 + %1619 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1619 %float_0 + %1620 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1620 %1618 + %1621 = OpCompositeExtract %float %1058 0 + %1622 = OpCompositeExtract %float %904 0 + %1623 = OpCompositeConstruct %v2float %1621 %1622 %1624 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1624 %1622 - %1625 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1626 = OpConvertSToF %float %1573 - %1627 = OpFAdd %float %1602 %1626 - OpStore %1625 %1627 - %1628 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %1628 - %1629 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1630 = OpLoad %float %1629 - %1631 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1631 %float_0 + %1625 = OpLoad %float %1624 + %1626 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1626 %float_0 + %1627 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1627 %1625 + %1628 = OpAccessChain %_ptr_Function_float %color %uint_2 + %1629 = OpConvertSToF %float %1576 + %1630 = OpFAdd %float %1605 %1629 + OpStore %1628 %1630 + %1631 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %1631 %1632 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1632 %1630 - %1633 = OpCompositeExtract %float %1055 1 - %1634 = OpCompositeExtract %float %1055 0 - %1635 = OpCompositeExtract %float %1609 1 - %1636 = OpCompositeConstruct %v3float %1633 %1634 %1635 - %1637 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1638 = OpLoad %float %1637 - %1639 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1639 %float_0 + %1633 = OpLoad %float %1632 + %1634 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1634 %float_0 + %1635 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1635 %1633 + %1636 = OpCompositeExtract %float %1058 1 + %1637 = OpCompositeExtract %float %1058 0 + %1638 = OpCompositeExtract %float %1612 1 + %1639 = OpCompositeConstruct %v3float %1636 %1637 %1638 %1640 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1640 %1638 - %1641 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1642 = OpLoad %float %1641 - %1643 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1644 = OpLoad %float %1643 - %1645 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1645 %float_0 + %1641 = OpLoad %float %1640 + %1642 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1642 %float_0 + %1643 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1643 %1641 + %1644 = OpAccessChain %_ptr_Function_float %uv %uint_0 + %1645 = OpLoad %float %1644 %1646 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1646 %1644 - %1647 = OpCompositeExtract %float %1577 1 - %1648 = OpCompositeExtract %float %1577 0 - %1649 = OpCompositeExtract %float %909 2 - %1650 = OpCompositeConstruct %v3float %1647 %1648 %1649 - %1651 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1652 = OpLoad %float %1651 - %1653 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1653 %float_0 + %1647 = OpLoad %float %1646 + %1648 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1648 %float_0 + %1649 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1649 %1647 + %1650 = OpCompositeExtract %float %1580 1 + %1651 = OpCompositeExtract %float %1580 0 + %1652 = OpCompositeExtract %float %912 2 + %1653 = OpCompositeConstruct %v3float %1650 %1651 %1652 %1654 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1654 %1652 - %1655 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1656 = OpLoad %float %1655 + %1655 = OpLoad %float %1654 + %1656 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1656 %float_0 %1657 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1658 = OpLoad %float %1657 - %1659 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1659 %float_0 + OpStore %1657 %1655 + %1658 = OpAccessChain %_ptr_Function_float %uv %uint_1 + %1659 = OpLoad %float %1658 %1660 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1660 %1658 - %1661 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1662 = OpLoad %float %1661 - %1663 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1663 %float_0 + %1661 = OpLoad %float %1660 + %1662 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1662 %float_0 + %1663 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1663 %1661 %1664 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1664 %1662 - %1665 = OpCompositeExtract %float %35 1 - %1666 = OpCompositeExtract %float %1360 1 - %1667 = OpCompositeExtract %float %1360 2 - %1668 = OpCompositeConstruct %v3float %1665 %1666 %1667 - %1669 = OpAccessChain %_ptr_Function_float %color %uint_2 - %1670 = OpLoad %float %1669 - %1671 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1671 %float_0 + %1665 = OpLoad %float %1664 + %1666 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1666 %float_0 + %1667 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1667 %1665 + %1668 = OpCompositeExtract %float %38 1 + %1669 = OpCompositeExtract %float %1363 1 + %1670 = OpCompositeExtract %float %1363 2 + %1671 = OpCompositeConstruct %v3float %1668 %1669 %1670 %1672 = OpAccessChain %_ptr_Function_float %color %uint_2 - OpStore %1672 %1670 - %1673 = OpLoad %int %i_2 + %1673 = OpLoad %float %1672 + %1674 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1674 %float_0 + %1675 = OpAccessChain %_ptr_Function_float %color %uint_2 + OpStore %1675 %1673 + %1676 = OpLoad %int %i_2 OpStore %i_2 %int_0 - OpStore %i_2 %1673 - %1674 = OpCompositeExtract %float %1360 2 - %1675 = OpCompositeExtract %float %1360 1 - %1676 = OpCompositeConstruct %v2float %1674 %1675 - %1677 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1677 - %1678 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1679 = OpLoad %float %1678 - %1680 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1680 %float_0 + OpStore %i_2 %1676 + %1677 = OpCompositeExtract %float %1363 2 + %1678 = OpCompositeExtract %float %1363 1 + %1679 = OpCompositeConstruct %v2float %1677 %1678 + %1680 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1680 %1681 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1681 %1679 - %1682 = OpCompositeExtract %float %972 1 - %1683 = OpCompositeExtract %float %972 1 - %1684 = OpCompositeExtract %float %972 1 - %1685 = OpCompositeConstruct %v3float %1682 %1683 %1684 - %1686 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - %1687 = OpLoad %int %1686 - %1688 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1688 %int_0 + %1682 = OpLoad %float %1681 + %1683 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1683 %float_0 + %1684 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1684 %1682 + %1685 = OpCompositeExtract %float %975 1 + %1686 = OpCompositeExtract %float %975 1 + %1687 = OpCompositeExtract %float %975 1 + %1688 = OpCompositeConstruct %v3float %1685 %1686 %1687 %1689 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 - OpStore %1689 %1687 - %1692 = OpFSub %float %1642 %1656 - %1690 = OpExtInst %float %1691 FAbs %1692 - %1693 = OpFOrdLessThan %bool %1690 %float_0_25 - OpSelectionMerge %1694 None - OpBranchConditional %1693 %1695 %1694 - %1695 = OpLabel - %1696 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1697 = OpLoad %float %1696 - %1698 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1698 %float_0 + %1690 = OpLoad %int %1689 + %1691 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1691 %int_0 + %1692 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_4 + OpStore %1692 %1690 + %1695 = OpFSub %float %1645 %1659 + %1693 = OpExtInst %float %1694 FAbs %1695 + %1696 = OpFOrdLessThan %bool %1693 %float_0_25 + OpSelectionMerge %1697 None + OpBranchConditional %1696 %1698 %1697 + %1698 = OpLabel %1699 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1699 %1697 - %1700 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %1700 - %1701 = OpCompositeExtract %float %1596 2 - %1702 = OpCompositeExtract %float %1596 0 - %1703 = OpCompositeExtract %float %909 0 - %1704 = OpCompositeConstruct %v3float %1701 %1702 %1703 - %1705 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 - %1706 = OpLoad %int %1705 - %1707 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 - OpStore %1707 %int_0 + %1700 = OpLoad %float %1699 + %1701 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1701 %float_0 + %1702 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1702 %1700 + %1703 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1703 + %1704 = OpCompositeExtract %float %1599 2 + %1705 = OpCompositeExtract %float %1599 0 + %1706 = OpCompositeExtract %float %912 0 + %1707 = OpCompositeConstruct %v3float %1704 %1705 %1706 %1708 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 - OpStore %1708 %1706 - %1710 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_9 - %1711 = OpLoad %int %1710 - %1712 = OpCompositeExtract %float %1232 1 - %1713 = OpCompositeExtract %float %1232 1 - %1714 = OpCompositeExtract %float %1232 1 - %1715 = OpCompositeConstruct %v3float %1712 %1713 %1714 - %1716 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1717 = OpLoad %float %1716 - %1718 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1718 %float_0 + %1709 = OpLoad %int %1708 + %1710 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 + OpStore %1710 %int_0 + %1711 = OpAccessChain %_ptr_Private_int %obj %uint_0 %int_8 + OpStore %1711 %1709 + %1713 = OpAccessChain %_ptr_Private_int %obj %uint_0 %uint_9 + %1714 = OpLoad %int %1713 + %1715 = OpCompositeExtract %float %1235 1 + %1716 = OpCompositeExtract %float %1235 1 + %1717 = OpCompositeExtract %float %1235 1 + %1718 = OpCompositeConstruct %v3float %1715 %1716 %1717 %1719 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1719 %1717 - %1720 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1721 = OpLoad %float %1720 + %1720 = OpLoad %float %1719 + %1721 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1721 %float_0 %1722 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1723 = OpLoad %float %1722 - %1724 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1724 %float_0 + OpStore %1722 %1720 + %1723 = OpAccessChain %_ptr_Function_float %color %uint_0 + %1724 = OpLoad %float %1723 %1725 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1725 %1723 - %1726 = OpCompositeExtract %float %1569 0 - %1727 = OpCompositeExtract %float %1569 1 - %1728 = OpCompositeConstruct %v2float %1726 %1727 - %1729 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1730 = OpLoad %float %1729 - %1731 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1731 %float_0 + %1726 = OpLoad %float %1725 + %1727 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1727 %float_0 + %1728 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1728 %1726 + %1729 = OpCompositeExtract %float %1572 0 + %1730 = OpCompositeExtract %float %1572 1 + %1731 = OpCompositeConstruct %v2float %1729 %1730 %1732 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1732 %1730 - %1733 = OpLoad %v3float %color - OpStore %color %885 - OpStore %color %1733 - %1734 = OpCompositeExtract %float %953 0 - %1735 = OpCompositeExtract %float %953 0 - %1736 = OpCompositeConstruct %v2float %1734 %1735 - %1737 = OpLoad %v2float %uv - OpStore %uv %873 - OpStore %uv %1737 - %1738 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1739 = OpLoad %float %1738 - %1740 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1740 %float_0 + %1733 = OpLoad %float %1732 + %1734 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1734 %float_0 + %1735 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1735 %1733 + %1736 = OpLoad %v3float %color + OpStore %color %888 + OpStore %color %1736 + %1737 = OpCompositeExtract %float %956 0 + %1738 = OpCompositeExtract %float %956 0 + %1739 = OpCompositeConstruct %v2float %1737 %1738 + %1740 = OpLoad %v2float %uv + OpStore %uv %876 + OpStore %uv %1740 %1741 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1741 %1739 - %1742 = OpCompositeExtract %float %873 0 - %1743 = OpCompositeExtract %float %873 0 - %1744 = OpCompositeExtract %float %873 1 - %1745 = OpCompositeConstruct %v3float %1742 %1743 %1744 - %1746 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1747 = OpConvertSToF %float %1711 - %1748 = OpFAdd %float %1747 %1721 - OpStore %1746 %1748 + %1742 = OpLoad %float %1741 + %1743 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1743 %float_0 + %1744 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1744 %1742 + %1745 = OpCompositeExtract %float %876 0 + %1746 = OpCompositeExtract %float %876 0 + %1747 = OpCompositeExtract %float %876 1 + %1748 = OpCompositeConstruct %v3float %1745 %1746 %1747 %1749 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1750 = OpLoad %float %1749 - %1751 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1751 %float_0 + %1750 = OpConvertSToF %float %1714 + %1751 = OpFAdd %float %1750 %1724 + OpStore %1749 %1751 %1752 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1752 %1750 - %1753 = OpCompositeExtract %float %1297 1 - %1754 = OpCompositeExtract %float %1636 0 - %1755 = OpCompositeExtract %float %1297 0 - %1756 = OpCompositeConstruct %v3float %1753 %1754 %1755 - %1757 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1758 = OpLoad %float %1757 - %1759 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1759 %float_0 + %1753 = OpLoad %float %1752 + %1754 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1754 %float_0 + %1755 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1755 %1753 + %1756 = OpCompositeExtract %float %1300 1 + %1757 = OpCompositeExtract %float %1639 0 + %1758 = OpCompositeExtract %float %1300 0 + %1759 = OpCompositeConstruct %v3float %1756 %1757 %1758 %1760 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1760 %1758 - OpBranch %1694 - %1694 = OpLabel - %1761 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1762 = OpLoad %float %1761 - %1763 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1763 %float_0 + %1761 = OpLoad %float %1760 + %1762 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1762 %float_0 + %1763 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1763 %1761 + OpBranch %1697 + %1697 = OpLabel %1764 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1764 %1762 - %1765 = OpLoad %v3float %color - %1766 = OpAccessChain %_ptr_Function_float %uv %int_0 - %1767 = OpLoad %float %1766 - %1768 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1768 %float_0 + %1765 = OpLoad %float %1764 + %1766 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1766 %float_0 + %1767 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1767 %1765 + %1768 = OpLoad %v3float %color %1769 = OpAccessChain %_ptr_Function_float %uv %int_0 - OpStore %1769 %1767 - %1770 = OpCompositeExtract %float %901 0 - %1771 = OpCompositeExtract %float %893 0 - %1772 = OpCompositeExtract %float %893 1 - %1773 = OpCompositeConstruct %v3float %1770 %1771 %1772 - %1774 = OpExtInst %v3float %1691 Normalize %1765 - %1775 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1776 = OpLoad %float %1775 - %1777 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1777 %float_0 + %1770 = OpLoad %float %1769 + %1771 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1771 %float_0 + %1772 = OpAccessChain %_ptr_Function_float %uv %int_0 + OpStore %1772 %1770 + %1773 = OpCompositeExtract %float %904 0 + %1774 = OpCompositeExtract %float %896 0 + %1775 = OpCompositeExtract %float %896 1 + %1776 = OpCompositeConstruct %v3float %1773 %1774 %1775 + %1777 = OpExtInst %v3float %1694 Normalize %1768 %1778 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1778 %1776 - %1779 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %1779 - %1780 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %1780 - %1781 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1782 = OpLoad %float %1781 - %1783 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1783 %float_0 + %1779 = OpLoad %float %1778 + %1780 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1780 %float_0 + %1781 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1781 %1779 + %1782 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1782 + %1783 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1783 %1784 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1784 %1782 - %1785 = OpCompositeExtract %float %1609 1 - %1786 = OpCompositeExtract %float %1773 1 - %1787 = OpCompositeConstruct %v2float %1785 %1786 - %1788 = OpAccessChain %_ptr_Function_float %color %uint_1 - %1789 = OpLoad %float %1788 - %1790 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1790 %float_0 + %1785 = OpLoad %float %1784 + %1786 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1786 %float_0 + %1787 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1787 %1785 + %1788 = OpCompositeExtract %float %1612 1 + %1789 = OpCompositeExtract %float %1776 1 + %1790 = OpCompositeConstruct %v2float %1788 %1789 %1791 = OpAccessChain %_ptr_Function_float %color %uint_1 - OpStore %1791 %1789 - %1792 = OpCompositeExtract %float %1774 0 - %1793 = OpCompositeExtract %float %1774 1 - %1794 = OpCompositeExtract %float %1774 2 - %1795 = OpCompositeConstruct %v4float %1792 %1793 %1794 %float_1 - %1796 = OpAccessChain %_ptr_Function_float %uv %uint_1 - %1797 = OpLoad %float %1796 - %1798 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1798 %float_0 + %1792 = OpLoad %float %1791 + %1793 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1793 %float_0 + %1794 = OpAccessChain %_ptr_Function_float %color %uint_1 + OpStore %1794 %1792 + %1795 = OpCompositeExtract %float %1777 0 + %1796 = OpCompositeExtract %float %1777 1 + %1797 = OpCompositeExtract %float %1777 2 + %1798 = OpCompositeConstruct %v4float %1795 %1796 %1797 %float_1 %1799 = OpAccessChain %_ptr_Function_float %uv %uint_1 - OpStore %1799 %1797 - %1800 = OpCompositeExtract %float %35 1 - %1801 = OpCompositeExtract %float %35 1 - %1802 = OpCompositeExtract %float %1787 1 - %1803 = OpCompositeConstruct %v3float %1800 %1801 %1802 - %1804 = OpAccessChain %_ptr_Function_float %uv %uint_0 - %1805 = OpLoad %float %1804 - %1806 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1806 %float_0 + %1800 = OpLoad %float %1799 + %1801 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1801 %float_0 + %1802 = OpAccessChain %_ptr_Function_float %uv %uint_1 + OpStore %1802 %1800 + %1803 = OpCompositeExtract %float %38 1 + %1804 = OpCompositeExtract %float %38 1 + %1805 = OpCompositeExtract %float %1790 1 + %1806 = OpCompositeConstruct %v3float %1803 %1804 %1805 %1807 = OpAccessChain %_ptr_Function_float %uv %uint_0 - OpStore %1807 %1805 - OpStore %x_GLF_color %1795 - %1808 = OpLoad %QuicksortObject %obj - OpStore %obj %100 - OpStore %obj %1808 - %1809 = OpCompositeExtract %float %1795 3 - %1810 = OpCompositeExtract %float %1795 1 - %1811 = OpCompositeExtract %float %1459 0 - %1812 = OpCompositeConstruct %v3float %1809 %1810 %1811 - %1813 = OpAccessChain %_ptr_Function_float %color %uint_0 - %1814 = OpLoad %float %1813 - %1815 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1815 %float_0 + %1808 = OpLoad %float %1807 + %1809 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1809 %float_0 + %1810 = OpAccessChain %_ptr_Function_float %uv %uint_0 + OpStore %1810 %1808 + OpStore %x_GLF_color %1798 + %1811 = OpLoad %QuicksortObject %obj + OpStore %obj %103 + OpStore %obj %1811 + %1812 = OpCompositeExtract %float %1798 3 + %1813 = OpCompositeExtract %float %1798 1 + %1814 = OpCompositeExtract %float %1462 0 + %1815 = OpCompositeConstruct %v3float %1812 %1813 %1814 %1816 = OpAccessChain %_ptr_Function_float %color %uint_0 - OpStore %1816 %1814 + %1817 = OpLoad %float %1816 + %1818 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1818 %float_0 + %1819 = OpAccessChain %_ptr_Function_float %color %uint_0 + OpStore %1819 %1817 + OpReturn + OpFunctionEnd +%tint_symbol_3 = OpFunction %void None %1820 +%tint_symbol_1 = OpFunctionParameter %main_out + %1824 = OpLabel + %1825 = OpCompositeExtract %v4float %tint_symbol_1 0 + OpStore %tint_symbol_2 %1825 + OpReturn + OpFunctionEnd + %main = OpFunction %void None %419 + %1827 = OpLabel + %1828 = OpLoad %v4float %tint_symbol + OpStore %gl_FragCoord %1828 + %1829 = OpFunctionCall %void %main_1 + %1831 = OpLoad %v4float %x_GLF_color + %1832 = OpCompositeConstruct %main_out %1831 + %1830 = OpFunctionCall %void %tint_symbol_3 %1832 OpReturn OpFunctionEnd diff --git a/test/bug/tint/749.spvasm.expected.wgsl b/test/bug/tint/749.spvasm.expected.wgsl index 48bb5b7910..f24a266a24 100644 --- a/test/bug/tint/749.spvasm.expected.wgsl +++ b/test/bug/tint/749.spvasm.expected.wgsl @@ -9,11 +9,11 @@ struct buf0 { var obj : QuicksortObject; -[[builtin(position)]] var gl_FragCoord : vec4; +var gl_FragCoord : vec4; [[group(0), binding(0)]] var x_188 : buf0; -[[location(0)]] var x_GLF_color : vec4; +var x_GLF_color : vec4; fn swap_i1_i1_(i : ptr, j : ptr) { var temp : i32; @@ -770,8 +770,7 @@ fn quicksort_() { return; } -[[stage(fragment)]] -fn main() { +fn main_1() { var color : vec3; var i_2 : i32; var uv : vec2; @@ -1492,3 +1491,15 @@ fn main() { *(x_208) = x_931; return; } + +struct main_out { + [[location(0)]] + x_GLF_color : vec4; +}; + +[[stage(fragment)]] +fn main([[builtin(position)]] gl_FragCoord_param : vec4) -> main_out { + gl_FragCoord = gl_FragCoord_param; + main_1(); + return main_out(x_GLF_color); +} diff --git a/test/bug/tint/757.wgsl.expected.msl b/test/bug/tint/757.wgsl.expected.msl index 4df311b468..7501d7acca 100644 --- a/test/bug/tint/757.wgsl.expected.msl +++ b/test/bug/tint/757.wgsl.expected.msl @@ -1,19 +1,34 @@ -SKIP: FAILED +#include -bug/tint/757.wgsl:3:5 warning: use of deprecated language feature: [[offset]] has been replaced with [[size]] and [[align]] - [[offset(0)]] level : i32; - ^^^^^^ +using namespace metal; +struct Constants { + /* 0x0000 */ int level; +}; +struct Result { + /* 0x0000 */ float values[1]; +}; -bug/tint/757.wgsl:10:5 warning: use of deprecated language feature: [[offset]] has been replaced with [[size]] and [[align]] - [[offset(0)]] values : [[stride(4)]] array; - ^^^^^^ +kernel void tint_symbol(texture2d_array tint_symbol_2 [[texture(1)]], uint3 GlobalInvocationID [[thread_position_in_grid]], device Result& result [[buffer(3)]]) { + uint flatIndex = ((((2u * 2u) * GlobalInvocationID.z) + (2u * GlobalInvocationID.y)) + GlobalInvocationID.x); + flatIndex = (flatIndex * 1u); + float4 texel = tint_symbol_2.read(uint2(int2(GlobalInvocationID.xy)), 0, 0); + { + uint i = 0u; + { + bool tint_msl_is_first_1 = true; + for(;;) { + if (!tint_msl_is_first_1) { + i = (i + 1u); + } + tint_msl_is_first_1 = false; + if (!((i < 1u))) { + break; + } + result.values[(flatIndex + i)] = texel.r; + } + } + } + return; +} - -Validation Failure: - -Compilation failed: - -program_source:14:18: error: use of undeclared identifier 'myTexture' - float4 texel = myTexture.read(int2(GlobalInvocationID.xy), 0, 0); - ^ diff --git a/test/bug/tint/827.wgsl.expected.msl b/test/bug/tint/827.wgsl.expected.msl index e326fda441..3570acda97 100644 --- a/test/bug/tint/827.wgsl.expected.msl +++ b/test/bug/tint/827.wgsl.expected.msl @@ -1,15 +1,13 @@ -SKIP: FAILED +#include -bug/tint/827.wgsl:8:26 warning: use of deprecated language feature: declare access with var instead of using [[access]] decoration -[[group(0), binding(1)]] var result : [[access(read_write)]] Result; - ^^^ +using namespace metal; +struct Result { + /* 0x0000 */ float values[1]; +}; +constant uint width = 128u; +kernel void tint_symbol(depth2d tint_symbol_2 [[texture(0)]], uint3 GlobalInvocationId [[thread_position_in_grid]], device Result& result [[buffer(1)]]) { + result.values[((GlobalInvocationId.y * width) + GlobalInvocationId.x)] = tint_symbol_2.read(uint2(int2(int(GlobalInvocationId.x), int(GlobalInvocationId.y))), 0); + return; +} - -Validation Failure: - -Compilation failed: - -program_source:10:76: error: use of undeclared identifier 'tex' - result.values[((GlobalInvocationId.y * width) + GlobalInvocationId.x)] = tex.read(int2(int(GlobalInvocationId.x), int(GlobalInvocationId.y)), 0); - ^ diff --git a/test/bug/tint/870.spvasm.expected.hlsl b/test/bug/tint/870.spvasm.expected.hlsl index 56649a2ecc..7cb227e127 100644 --- a/test/bug/tint/870.spvasm.expected.hlsl +++ b/test/bug/tint/870.spvasm.expected.hlsl @@ -9,7 +9,7 @@ tint_array_wrapper tint_symbol_1(ByteAddressBuffer buffer, uint offset) { ByteAddressBuffer sspp962805860buildInformation : register(t2, space0); -void main() { +void main_1() { tint_array_wrapper orientation = {{0, 0, 0, 0, 0, 0}}; const tint_array_wrapper x_23 = tint_symbol_1(sspp962805860buildInformation, 36u); orientation.arr[0] = x_23.arr[0u]; @@ -20,3 +20,8 @@ void main() { orientation.arr[5] = x_23.arr[5u]; return; } + +void main() { + main_1(); + return; +} diff --git a/test/bug/tint/870.spvasm.expected.msl b/test/bug/tint/870.spvasm.expected.msl index 0ca37a883a..b97dedee62 100644 --- a/test/bug/tint/870.spvasm.expected.msl +++ b/test/bug/tint/870.spvasm.expected.msl @@ -14,7 +14,7 @@ struct x_B4_BuildInformation { /* 0x0000 */ sspp962805860buildInformationS passthru; }; -fragment void tint_symbol(const device x_B4_BuildInformation& sspp962805860buildInformation [[buffer(2)]]) { +void main_1(const device x_B4_BuildInformation& sspp962805860buildInformation) { tint_array_wrapper orientation = {}; tint_array_wrapper const x_23 = sspp962805860buildInformation.passthru.orientation; orientation.arr[0] = x_23.arr[0u]; @@ -26,3 +26,8 @@ fragment void tint_symbol(const device x_B4_BuildInformation& sspp962805860build return; } +fragment void tint_symbol(const device x_B4_BuildInformation& sspp962805860buildInformation [[buffer(2)]]) { + main_1(sspp962805860buildInformation); + return; +} + diff --git a/test/bug/tint/870.spvasm.expected.spvasm b/test/bug/tint/870.spvasm.expected.spvasm index d40b60b648..d502ddabf4 100644 --- a/test/bug/tint/870.spvasm.expected.spvasm +++ b/test/bug/tint/870.spvasm.expected.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 46 +; Bound: 49 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 @@ -15,8 +15,9 @@ OpMemberName %sspp962805860buildInformationS 2 "essence" OpMemberName %sspp962805860buildInformationS 3 "orientation" OpName %sspp962805860buildInformation "sspp962805860buildInformation" - OpName %main "main" + OpName %main_1 "main_1" OpName %orientation "orientation" + OpName %main "main" OpDecorate %x_B4_BuildInformation Block OpMemberDecorate %x_B4_BuildInformation 0 Offset 0 OpMemberDecorate %sspp962805860buildInformationS 0 Offset 0 @@ -55,7 +56,7 @@ %uint_4 = OpConstant %uint 4 %int_5 = OpConstant %int 5 %uint_5 = OpConstant %uint 5 - %main = OpFunction %void None %11 + %main_1 = OpFunction %void None %11 %14 = OpLabel %orientation = OpVariable %_ptr_Function__arr_int_uint_6 Function %17 %21 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_6 %sspp962805860buildInformation %uint_0 %uint_3 @@ -80,3 +81,8 @@ OpStore %43 %45 OpReturn OpFunctionEnd + %main = OpFunction %void None %11 + %47 = OpLabel + %48 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/bug/tint/870.spvasm.expected.wgsl b/test/bug/tint/870.spvasm.expected.wgsl index e6818c35fb..7729cc11d6 100644 --- a/test/bug/tint/870.spvasm.expected.wgsl +++ b/test/bug/tint/870.spvasm.expected.wgsl @@ -14,8 +14,7 @@ struct x_B4_BuildInformation { [[group(0), binding(2)]] var sspp962805860buildInformation : x_B4_BuildInformation; -[[stage(fragment)]] -fn main() { +fn main_1() { var orientation : array; let x_23 : Arr = sspp962805860buildInformation.passthru.orientation; orientation[0] = x_23[0u]; @@ -26,3 +25,8 @@ fn main() { orientation[5] = x_23[5u]; return; } + +[[stage(fragment)]] +fn main() { + main_1(); +} diff --git a/test/intrinsics/gen/textureSampleCompareLevel/011a8f.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompareLevel/011a8f.wgsl.expected.msl index 5e2ddd2ba5..1d5f63f463 100644 --- a/test/intrinsics/gen/textureSampleCompareLevel/011a8f.wgsl.expected.msl +++ b/test/intrinsics/gen/textureSampleCompareLevel/011a8f.wgsl.expected.msl @@ -1,14 +1,27 @@ -SKIP: FAILED +#include +using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; +void textureSampleCompareLevel_011a8f(depth2d_array tint_symbol_2, sampler tint_symbol_3) { + float res = tint_symbol_2.sample_compare(tint_symbol_3, float2(), 1, 1.0f, level(0), int2()); +} -Validation Failure: +vertex tint_symbol vertex_main(depth2d_array tint_symbol_4 [[texture(0)]], sampler tint_symbol_5 [[sampler(1)]]) { + textureSampleCompareLevel_011a8f(tint_symbol_4, tint_symbol_5); + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; +} -Compilation failed: +fragment void fragment_main(depth2d_array tint_symbol_6 [[texture(0)]], sampler tint_symbol_7 [[sampler(1)]]) { + textureSampleCompareLevel_011a8f(tint_symbol_6, tint_symbol_7); + return; +} + +kernel void compute_main(depth2d_array tint_symbol_8 [[texture(0)]], sampler tint_symbol_9 [[sampler(1)]]) { + textureSampleCompareLevel_011a8f(tint_symbol_8, tint_symbol_9); + return; +} -program_source:9:15: error: use of undeclared identifier 'arg_0' - float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, level(0), int2()); - ^ -program_source:9:36: error: use of undeclared identifier 'arg_1' - float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, level(0), int2()); - ^ diff --git a/test/intrinsics/gen/textureSampleCompareLevel/1116ed.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompareLevel/1116ed.wgsl.expected.msl index 0f3eb0d9b7..1501fc5c31 100644 --- a/test/intrinsics/gen/textureSampleCompareLevel/1116ed.wgsl.expected.msl +++ b/test/intrinsics/gen/textureSampleCompareLevel/1116ed.wgsl.expected.msl @@ -1,14 +1,27 @@ -SKIP: FAILED +#include +using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; +void textureSampleCompareLevel_1116ed(depth2d_array tint_symbol_2, sampler tint_symbol_3) { + float res = tint_symbol_2.sample_compare(tint_symbol_3, float2(), 1, 1.0f, level(0)); +} -Validation Failure: +vertex tint_symbol vertex_main(depth2d_array tint_symbol_4 [[texture(0)]], sampler tint_symbol_5 [[sampler(1)]]) { + textureSampleCompareLevel_1116ed(tint_symbol_4, tint_symbol_5); + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; +} -Compilation failed: +fragment void fragment_main(depth2d_array tint_symbol_6 [[texture(0)]], sampler tint_symbol_7 [[sampler(1)]]) { + textureSampleCompareLevel_1116ed(tint_symbol_6, tint_symbol_7); + return; +} + +kernel void compute_main(depth2d_array tint_symbol_8 [[texture(0)]], sampler tint_symbol_9 [[sampler(1)]]) { + textureSampleCompareLevel_1116ed(tint_symbol_8, tint_symbol_9); + return; +} -program_source:9:15: error: use of undeclared identifier 'arg_0' - float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, level(0)); - ^ -program_source:9:36: error: use of undeclared identifier 'arg_1' - float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, level(0)); - ^ diff --git a/test/intrinsics/gen/textureSampleCompareLevel/1568e3.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompareLevel/1568e3.wgsl.expected.msl index 89da216ffa..6382fd5c1e 100644 --- a/test/intrinsics/gen/textureSampleCompareLevel/1568e3.wgsl.expected.msl +++ b/test/intrinsics/gen/textureSampleCompareLevel/1568e3.wgsl.expected.msl @@ -1,14 +1,27 @@ -SKIP: FAILED +#include +using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; +void textureSampleCompareLevel_1568e3(depthcube tint_symbol_2, sampler tint_symbol_3) { + float res = tint_symbol_2.sample_compare(tint_symbol_3, float3(), 1.0f, level(0)); +} -Validation Failure: +vertex tint_symbol vertex_main(depthcube tint_symbol_4 [[texture(0)]], sampler tint_symbol_5 [[sampler(1)]]) { + textureSampleCompareLevel_1568e3(tint_symbol_4, tint_symbol_5); + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; +} -Compilation failed: +fragment void fragment_main(depthcube tint_symbol_6 [[texture(0)]], sampler tint_symbol_7 [[sampler(1)]]) { + textureSampleCompareLevel_1568e3(tint_symbol_6, tint_symbol_7); + return; +} + +kernel void compute_main(depthcube tint_symbol_8 [[texture(0)]], sampler tint_symbol_9 [[sampler(1)]]) { + textureSampleCompareLevel_1568e3(tint_symbol_8, tint_symbol_9); + return; +} -program_source:9:15: error: use of undeclared identifier 'arg_0' - float res = arg_0.sample_compare(arg_1, float3(), 1.0f, level(0)); - ^ -program_source:9:36: error: use of undeclared identifier 'arg_1' - float res = arg_0.sample_compare(arg_1, float3(), 1.0f, level(0)); - ^ diff --git a/test/intrinsics/gen/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl index 06b950450e..c838bede41 100644 --- a/test/intrinsics/gen/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl +++ b/test/intrinsics/gen/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl @@ -1,14 +1,27 @@ -SKIP: FAILED +#include +using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; +void textureSampleCompareLevel_2ad2b1(depth2d tint_symbol_2, sampler tint_symbol_3) { + float res = tint_symbol_2.sample_compare(tint_symbol_3, float2(), 1.0f, level(0)); +} -Validation Failure: +vertex tint_symbol vertex_main(depth2d tint_symbol_4 [[texture(0)]], sampler tint_symbol_5 [[sampler(1)]]) { + textureSampleCompareLevel_2ad2b1(tint_symbol_4, tint_symbol_5); + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; +} -Compilation failed: +fragment void fragment_main(depth2d tint_symbol_6 [[texture(0)]], sampler tint_symbol_7 [[sampler(1)]]) { + textureSampleCompareLevel_2ad2b1(tint_symbol_6, tint_symbol_7); + return; +} + +kernel void compute_main(depth2d tint_symbol_8 [[texture(0)]], sampler tint_symbol_9 [[sampler(1)]]) { + textureSampleCompareLevel_2ad2b1(tint_symbol_8, tint_symbol_9); + return; +} -program_source:9:15: error: use of undeclared identifier 'arg_0' - float res = arg_0.sample_compare(arg_1, float2(), 1.0f, level(0)); - ^ -program_source:9:36: error: use of undeclared identifier 'arg_1' - float res = arg_0.sample_compare(arg_1, float2(), 1.0f, level(0)); - ^ diff --git a/test/intrinsics/gen/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl index 8d09590f76..d7a3b56774 100644 --- a/test/intrinsics/gen/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl +++ b/test/intrinsics/gen/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl @@ -1,14 +1,27 @@ -SKIP: FAILED +#include +using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; +void textureSampleCompareLevel_4cf3a2(depthcube_array tint_symbol_2, sampler tint_symbol_3) { + float res = tint_symbol_2.sample_compare(tint_symbol_3, float3(), 1, 1.0f, level(0)); +} -Validation Failure: +vertex tint_symbol vertex_main(depthcube_array tint_symbol_4 [[texture(0)]], sampler tint_symbol_5 [[sampler(1)]]) { + textureSampleCompareLevel_4cf3a2(tint_symbol_4, tint_symbol_5); + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; +} -Compilation failed: +fragment void fragment_main(depthcube_array tint_symbol_6 [[texture(0)]], sampler tint_symbol_7 [[sampler(1)]]) { + textureSampleCompareLevel_4cf3a2(tint_symbol_6, tint_symbol_7); + return; +} + +kernel void compute_main(depthcube_array tint_symbol_8 [[texture(0)]], sampler tint_symbol_9 [[sampler(1)]]) { + textureSampleCompareLevel_4cf3a2(tint_symbol_8, tint_symbol_9); + return; +} -program_source:9:15: error: use of undeclared identifier 'arg_0' - float res = arg_0.sample_compare(arg_1, float3(), 1, 1.0f, level(0)); - ^ -program_source:9:36: error: use of undeclared identifier 'arg_1' - float res = arg_0.sample_compare(arg_1, float3(), 1, 1.0f, level(0)); - ^ diff --git a/test/intrinsics/gen/textureSampleCompareLevel/f8121c.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompareLevel/f8121c.wgsl.expected.msl index 21f108a89f..485e108815 100644 --- a/test/intrinsics/gen/textureSampleCompareLevel/f8121c.wgsl.expected.msl +++ b/test/intrinsics/gen/textureSampleCompareLevel/f8121c.wgsl.expected.msl @@ -1,14 +1,27 @@ -SKIP: FAILED +#include +using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; +void textureSampleCompareLevel_f8121c(depth2d tint_symbol_2, sampler tint_symbol_3) { + float res = tint_symbol_2.sample_compare(tint_symbol_3, float2(), 1.0f, level(0), int2()); +} -Validation Failure: +vertex tint_symbol vertex_main(depth2d tint_symbol_4 [[texture(0)]], sampler tint_symbol_5 [[sampler(1)]]) { + textureSampleCompareLevel_f8121c(tint_symbol_4, tint_symbol_5); + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; +} -Compilation failed: +fragment void fragment_main(depth2d tint_symbol_6 [[texture(0)]], sampler tint_symbol_7 [[sampler(1)]]) { + textureSampleCompareLevel_f8121c(tint_symbol_6, tint_symbol_7); + return; +} + +kernel void compute_main(depth2d tint_symbol_8 [[texture(0)]], sampler tint_symbol_9 [[sampler(1)]]) { + textureSampleCompareLevel_f8121c(tint_symbol_8, tint_symbol_9); + return; +} -program_source:9:15: error: use of undeclared identifier 'arg_0' - float res = arg_0.sample_compare(arg_1, float2(), 1.0f, level(0), int2()); - ^ -program_source:9:36: error: use of undeclared identifier 'arg_1' - float res = arg_0.sample_compare(arg_1, float2(), 1.0f, level(0), int2()); - ^ diff --git a/test/ptr_ref/access/matrix.spvasm.expected.hlsl b/test/ptr_ref/access/matrix.spvasm.expected.hlsl index 0b1e5411cc..0dfd7dfdc4 100644 --- a/test/ptr_ref/access/matrix.spvasm.expected.hlsl +++ b/test/ptr_ref/access/matrix.spvasm.expected.hlsl @@ -1,7 +1,12 @@ -[numthreads(1, 1, 1)] -void main() { +void main_1() { float3x3 m = float3x3(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); m = float3x3(float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f), float3(7.0f, 8.0f, 9.0f)); m[1] = float3(5.0f, 5.0f, 5.0f); return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/access/matrix.spvasm.expected.msl b/test/ptr_ref/access/matrix.spvasm.expected.msl index beac5b502e..355f9031a2 100644 --- a/test/ptr_ref/access/matrix.spvasm.expected.msl +++ b/test/ptr_ref/access/matrix.spvasm.expected.msl @@ -1,10 +1,15 @@ #include using namespace metal; -kernel void tint_symbol() { +void main_1() { float3x3 m = float3x3(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); m = float3x3(float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f), float3(7.0f, 8.0f, 9.0f)); m[1] = float3(5.0f, 5.0f, 5.0f); return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/ptr_ref/access/matrix.spvasm.expected.spvasm b/test/ptr_ref/access/matrix.spvasm.expected.spvasm index 762777bf00..7f8383464e 100644 --- a/test/ptr_ref/access/matrix.spvasm.expected.spvasm +++ b/test/ptr_ref/access/matrix.spvasm.expected.spvasm @@ -1,14 +1,15 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 35 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 - OpName %main "main" + OpName %main_1 "main_1" OpName %m "m" + OpName %main "main" %void = OpTypeVoid %1 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -36,7 +37,7 @@ %int_1 = OpConstant %int 1 %_ptr_Function_v3float = OpTypePointer Function %v3float %31 = OpConstantComposite %v3float %float_5 %float_5 %float_5 - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %m = OpVariable %_ptr_Function_mat3v3float Function %13 OpStore %m %10 @@ -45,3 +46,8 @@ OpStore %30 %31 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %33 = OpLabel + %34 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/access/matrix.spvasm.expected.wgsl b/test/ptr_ref/access/matrix.spvasm.expected.wgsl index dabe5d49e2..9318800c12 100644 --- a/test/ptr_ref/access/matrix.spvasm.expected.wgsl +++ b/test/ptr_ref/access/matrix.spvasm.expected.wgsl @@ -1,7 +1,11 @@ -[[stage(compute)]] -fn main() { +fn main_1() { var m : mat3x3 = mat3x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)); m = mat3x3(vec3(1.0, 2.0, 3.0), vec3(4.0, 5.0, 6.0), vec3(7.0, 8.0, 9.0)); m[1] = vec3(5.0, 5.0, 5.0); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/access/vector.spvasm.expected.hlsl b/test/ptr_ref/access/vector.spvasm.expected.hlsl index d1fb5ff1f0..1249175d69 100644 --- a/test/ptr_ref/access/vector.spvasm.expected.hlsl +++ b/test/ptr_ref/access/vector.spvasm.expected.hlsl @@ -1,7 +1,12 @@ -[numthreads(1, 1, 1)] -void main() { +void main_1() { float3 v = float3(0.0f, 0.0f, 0.0f); v = float3(1.0f, 2.0f, 3.0f); v.y = 5.0f; return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/access/vector.spvasm.expected.msl b/test/ptr_ref/access/vector.spvasm.expected.msl index 650c7525d0..2d93596c0a 100644 --- a/test/ptr_ref/access/vector.spvasm.expected.msl +++ b/test/ptr_ref/access/vector.spvasm.expected.msl @@ -1,10 +1,15 @@ #include using namespace metal; -kernel void tint_symbol() { +void main_1() { float3 v = float3(0.0f, 0.0f, 0.0f); v = float3(1.0f, 2.0f, 3.0f); v.y = 5.0f; return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/ptr_ref/access/vector.spvasm.expected.spvasm b/test/ptr_ref/access/vector.spvasm.expected.spvasm index 5d2c9155a9..bfedf84992 100644 --- a/test/ptr_ref/access/vector.spvasm.expected.spvasm +++ b/test/ptr_ref/access/vector.spvasm.expected.spvasm @@ -1,14 +1,15 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 21 +; Bound: 24 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 - OpName %main "main" + OpName %main_1 "main_1" OpName %v "v" + OpName %main "main" %void = OpTypeVoid %1 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -25,7 +26,7 @@ %uint_1 = OpConstant %uint 1 %_ptr_Function_float = OpTypePointer Function %float %float_5 = OpConstant %float 5 - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %v = OpVariable %_ptr_Function_v3float Function %11 OpStore %v %8 @@ -34,3 +35,8 @@ OpStore %19 %float_5 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %22 = OpLabel + %23 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/access/vector.spvasm.expected.wgsl b/test/ptr_ref/access/vector.spvasm.expected.wgsl index dce7b8f895..1c01974801 100644 --- a/test/ptr_ref/access/vector.spvasm.expected.wgsl +++ b/test/ptr_ref/access/vector.spvasm.expected.wgsl @@ -1,7 +1,11 @@ -[[stage(compute)]] -fn main() { +fn main_1() { var v : vec3 = vec3(0.0, 0.0, 0.0); v = vec3(1.0, 2.0, 3.0); v.y = 5.0; return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/copy/ptr_copy.spvasm.expected.hlsl b/test/ptr_ref/copy/ptr_copy.spvasm.expected.hlsl index cd118a726a..0bc2907bba 100644 --- a/test/ptr_ref/copy/ptr_copy.spvasm.expected.hlsl +++ b/test/ptr_ref/copy/ptr_copy.spvasm.expected.hlsl @@ -1,5 +1,10 @@ -[numthreads(1, 1, 1)] -void main() { +void main_1() { uint x_10 = 0u; return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/copy/ptr_copy.spvasm.expected.msl b/test/ptr_ref/copy/ptr_copy.spvasm.expected.msl index 6577255310..5495c634ee 100644 --- a/test/ptr_ref/copy/ptr_copy.spvasm.expected.msl +++ b/test/ptr_ref/copy/ptr_copy.spvasm.expected.msl @@ -1,10 +1,15 @@ #include using namespace metal; -kernel void tint_symbol() { +void main_1() { uint x_10 = 0u; thread uint* const x_1 = &(x_10); thread uint* const x_2 = x_1; return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/ptr_ref/copy/ptr_copy.spvasm.expected.spvasm b/test/ptr_ref/copy/ptr_copy.spvasm.expected.spvasm index 2ced51cd26..bf3b29419e 100644 --- a/test/ptr_ref/copy/ptr_copy.spvasm.expected.spvasm +++ b/test/ptr_ref/copy/ptr_copy.spvasm.expected.spvasm @@ -1,21 +1,27 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 9 +; Bound: 12 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 - OpName %main "main" + OpName %main_1 "main_1" OpName %x_10 "x_10" + OpName %main "main" %void = OpTypeVoid %1 = OpTypeFunction %void %uint = OpTypeInt 32 0 %_ptr_Function_uint = OpTypePointer Function %uint %8 = OpConstantNull %uint - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %x_10 = OpVariable %_ptr_Function_uint Function %8 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %10 = OpLabel + %11 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/copy/ptr_copy.spvasm.expected.wgsl b/test/ptr_ref/copy/ptr_copy.spvasm.expected.wgsl index ef4c546f29..360caf4c3a 100644 --- a/test/ptr_ref/copy/ptr_copy.spvasm.expected.wgsl +++ b/test/ptr_ref/copy/ptr_copy.spvasm.expected.wgsl @@ -1,7 +1,11 @@ -[[stage(compute)]] -fn main() { +fn main_1() { var x_10 : u32; let x_1 : ptr = &(x_10); let x_2 : ptr = x_1; return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/load/global/i32.spvasm.expected.hlsl b/test/ptr_ref/load/global/i32.spvasm.expected.hlsl index c105145281..949fd0b2b3 100644 --- a/test/ptr_ref/load/global/i32.spvasm.expected.hlsl +++ b/test/ptr_ref/load/global/i32.spvasm.expected.hlsl @@ -1,8 +1,13 @@ static int I = 0; -[numthreads(1, 1, 1)] -void main() { +void main_1() { const int x_9 = I; const int x_11 = (x_9 + 1); return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/load/global/i32.spvasm.expected.msl b/test/ptr_ref/load/global/i32.spvasm.expected.msl index b12f8098e3..58c70f561a 100644 --- a/test/ptr_ref/load/global/i32.spvasm.expected.msl +++ b/test/ptr_ref/load/global/i32.spvasm.expected.msl @@ -1,10 +1,15 @@ #include using namespace metal; -kernel void tint_symbol() { - thread int tint_symbol_1 = 0; - int const x_9 = tint_symbol_1; +void main_1(thread int* const tint_symbol_1) { + int const x_9 = *(tint_symbol_1); int const x_11 = (x_9 + 1); return; } +kernel void tint_symbol() { + thread int tint_symbol_2 = 0; + main_1(&(tint_symbol_2)); + return; +} + diff --git a/test/ptr_ref/load/global/i32.spvasm.expected.spvasm b/test/ptr_ref/load/global/i32.spvasm.expected.spvasm index df454002a4..c105555c7e 100644 --- a/test/ptr_ref/load/global/i32.spvasm.expected.spvasm +++ b/test/ptr_ref/load/global/i32.spvasm.expected.spvasm @@ -1,13 +1,14 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 12 +; Bound: 15 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 OpName %I "I" + OpName %main_1 "main_1" OpName %main "main" %int = OpTypeInt 32 1 %int_0 = OpConstant %int 0 @@ -16,9 +17,14 @@ %void = OpTypeVoid %5 = OpTypeFunction %void %int_1 = OpConstant %int 1 - %main = OpFunction %void None %5 + %main_1 = OpFunction %void None %5 %8 = OpLabel %9 = OpLoad %int %I %11 = OpIAdd %int %9 %int_1 OpReturn OpFunctionEnd + %main = OpFunction %void None %5 + %13 = OpLabel + %14 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/load/global/i32.spvasm.expected.wgsl b/test/ptr_ref/load/global/i32.spvasm.expected.wgsl index ba8f551a1b..f9147e488d 100644 --- a/test/ptr_ref/load/global/i32.spvasm.expected.wgsl +++ b/test/ptr_ref/load/global/i32.spvasm.expected.wgsl @@ -1,8 +1,12 @@ var I : i32 = 0; -[[stage(compute)]] -fn main() { +fn main_1() { let x_9 : i32 = I; let x_11 : i32 = (x_9 + 1); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/load/global/struct_field.spvasm.expected.hlsl b/test/ptr_ref/load/global/struct_field.spvasm.expected.hlsl index f966e8b8b0..038d7fcc20 100644 --- a/test/ptr_ref/load/global/struct_field.spvasm.expected.hlsl +++ b/test/ptr_ref/load/global/struct_field.spvasm.expected.hlsl @@ -4,10 +4,15 @@ struct S { static S V; -[numthreads(1, 1, 1)] -void main() { +void main_1() { int i = 0; const int x_15 = V.i; i = x_15; return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/load/global/struct_field.spvasm.expected.msl b/test/ptr_ref/load/global/struct_field.spvasm.expected.msl index e1c15209e2..5ac3552344 100644 --- a/test/ptr_ref/load/global/struct_field.spvasm.expected.msl +++ b/test/ptr_ref/load/global/struct_field.spvasm.expected.msl @@ -5,11 +5,16 @@ struct S { int i; }; -kernel void tint_symbol() { - thread S tint_symbol_1 = {}; +void main_1(thread S* const tint_symbol_1) { int i = 0; - int const x_15 = tint_symbol_1.i; + int const x_15 = (*(tint_symbol_1)).i; i = x_15; return; } +kernel void tint_symbol() { + thread S tint_symbol_2 = {}; + main_1(&(tint_symbol_2)); + return; +} + diff --git a/test/ptr_ref/load/global/struct_field.spvasm.expected.spvasm b/test/ptr_ref/load/global/struct_field.spvasm.expected.spvasm index 2a1da682f4..a6960ac919 100644 --- a/test/ptr_ref/load/global/struct_field.spvasm.expected.spvasm +++ b/test/ptr_ref/load/global/struct_field.spvasm.expected.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 18 +; Bound: 21 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 @@ -10,8 +10,9 @@ OpName %S "S" OpMemberName %S 0 "i" OpName %V "V" - OpName %main "main" + OpName %main_1 "main_1" OpName %i "i" + OpName %main "main" OpMemberDecorate %S 0 Offset 0 %int = OpTypeInt 32 1 %S = OpTypeStruct %int @@ -25,7 +26,7 @@ %uint = OpTypeInt 32 0 %uint_0 = OpConstant %uint 0 %_ptr_Private_int = OpTypePointer Private %int - %main = OpFunction %void None %6 + %main_1 = OpFunction %void None %6 %9 = OpLabel %i = OpVariable %_ptr_Function_int Function %12 %16 = OpAccessChain %_ptr_Private_int %V %uint_0 @@ -33,3 +34,8 @@ OpStore %i %17 OpReturn OpFunctionEnd + %main = OpFunction %void None %6 + %19 = OpLabel + %20 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/load/global/struct_field.spvasm.expected.wgsl b/test/ptr_ref/load/global/struct_field.spvasm.expected.wgsl index e3f4540ae2..c423f7795e 100644 --- a/test/ptr_ref/load/global/struct_field.spvasm.expected.wgsl +++ b/test/ptr_ref/load/global/struct_field.spvasm.expected.wgsl @@ -4,10 +4,14 @@ struct S { var V : S; -[[stage(compute)]] -fn main() { +fn main_1() { var i : i32; let x_15 : i32 = V.i; i = x_15; return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/load/local/i32.spvasm.expected.hlsl b/test/ptr_ref/load/local/i32.spvasm.expected.hlsl index fc4a24b985..e93814c678 100644 --- a/test/ptr_ref/load/local/i32.spvasm.expected.hlsl +++ b/test/ptr_ref/load/local/i32.spvasm.expected.hlsl @@ -1,8 +1,13 @@ -[numthreads(1, 1, 1)] -void main() { +void main_1() { int i = 0; i = 123; const int x_10 = i; const int x_12 = (x_10 + 1); return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/load/local/i32.spvasm.expected.msl b/test/ptr_ref/load/local/i32.spvasm.expected.msl index 738dfeacc7..bfbd8e517e 100644 --- a/test/ptr_ref/load/local/i32.spvasm.expected.msl +++ b/test/ptr_ref/load/local/i32.spvasm.expected.msl @@ -1,7 +1,7 @@ #include using namespace metal; -kernel void tint_symbol() { +void main_1() { int i = 0; i = 123; int const x_10 = i; @@ -9,3 +9,8 @@ kernel void tint_symbol() { return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/ptr_ref/load/local/i32.spvasm.expected.spvasm b/test/ptr_ref/load/local/i32.spvasm.expected.spvasm index bc6f46793c..f5dfd09b77 100644 --- a/test/ptr_ref/load/local/i32.spvasm.expected.spvasm +++ b/test/ptr_ref/load/local/i32.spvasm.expected.spvasm @@ -1,14 +1,15 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 14 +; Bound: 17 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 - OpName %main "main" + OpName %main_1 "main_1" OpName %i "i" + OpName %main "main" %void = OpTypeVoid %1 = OpTypeFunction %void %int = OpTypeInt 32 1 @@ -17,7 +18,7 @@ %9 = OpConstantNull %int %int_123 = OpConstant %int 123 %int_1 = OpConstant %int 1 - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %i = OpVariable %_ptr_Function_int Function %9 OpStore %i %int_0 @@ -26,3 +27,8 @@ %13 = OpIAdd %int %11 %int_1 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %15 = OpLabel + %16 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/load/local/i32.spvasm.expected.wgsl b/test/ptr_ref/load/local/i32.spvasm.expected.wgsl index 60551cdf9a..8a47e29786 100644 --- a/test/ptr_ref/load/local/i32.spvasm.expected.wgsl +++ b/test/ptr_ref/load/local/i32.spvasm.expected.wgsl @@ -1,8 +1,12 @@ -[[stage(compute)]] -fn main() { +fn main_1() { var i : i32 = 0; i = 123; let x_10 : i32 = i; let x_12 : i32 = (x_10 + 1); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/load/local/struct_field.spvasm.expected.hlsl b/test/ptr_ref/load/local/struct_field.spvasm.expected.hlsl index 0f937955f9..33da9c4c3d 100644 --- a/test/ptr_ref/load/local/struct_field.spvasm.expected.hlsl +++ b/test/ptr_ref/load/local/struct_field.spvasm.expected.hlsl @@ -2,11 +2,16 @@ struct S { int i; }; -[numthreads(1, 1, 1)] -void main() { +void main_1() { int i = 0; S V = {0}; const int x_14 = V.i; i = x_14; return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/load/local/struct_field.spvasm.expected.msl b/test/ptr_ref/load/local/struct_field.spvasm.expected.msl index 185bd720cb..686dc6e6b5 100644 --- a/test/ptr_ref/load/local/struct_field.spvasm.expected.msl +++ b/test/ptr_ref/load/local/struct_field.spvasm.expected.msl @@ -5,7 +5,7 @@ struct S { int i; }; -kernel void tint_symbol() { +void main_1() { int i = 0; S V = {}; int const x_14 = V.i; @@ -13,3 +13,8 @@ kernel void tint_symbol() { return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/ptr_ref/load/local/struct_field.spvasm.expected.spvasm b/test/ptr_ref/load/local/struct_field.spvasm.expected.spvasm index 814dd1b693..14bc4f7b29 100644 --- a/test/ptr_ref/load/local/struct_field.spvasm.expected.spvasm +++ b/test/ptr_ref/load/local/struct_field.spvasm.expected.spvasm @@ -1,17 +1,18 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 17 +; Bound: 20 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 - OpName %main "main" + OpName %main_1 "main_1" OpName %i "i" OpName %S "S" OpMemberName %S 0 "i" OpName %V "V" + OpName %main "main" OpMemberDecorate %S 0 Offset 0 %void = OpTypeVoid %1 = OpTypeFunction %void @@ -23,7 +24,7 @@ %12 = OpConstantNull %S %uint = OpTypeInt 32 0 %uint_0 = OpConstant %uint 0 - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %i = OpVariable %_ptr_Function_int Function %8 %V = OpVariable %_ptr_Function_S Function %12 @@ -32,3 +33,8 @@ OpStore %i %16 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %18 = OpLabel + %19 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/load/local/struct_field.spvasm.expected.wgsl b/test/ptr_ref/load/local/struct_field.spvasm.expected.wgsl index ae1c95e7ba..8ddaccf949 100644 --- a/test/ptr_ref/load/local/struct_field.spvasm.expected.wgsl +++ b/test/ptr_ref/load/local/struct_field.spvasm.expected.wgsl @@ -2,11 +2,15 @@ struct S { i : i32; }; -[[stage(compute)]] -fn main() { +fn main_1() { var i : i32; var V : S; let x_14 : i32 = V.i; i = x_14; return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/load/param/ptr.spvasm.expected.hlsl b/test/ptr_ref/load/param/ptr.spvasm.expected.hlsl index 102d13e368..abdb81c0c0 100644 --- a/test/ptr_ref/load/param/ptr.spvasm.expected.hlsl +++ b/test/ptr_ref/load/param/ptr.spvasm.expected.hlsl @@ -3,11 +3,16 @@ int func(int value, inout int pointer) { return (value + x_9); } -[numthreads(1, 1, 1)] -void main() { +void main_1() { int i = 0; i = 123; const int x_19 = i; const int x_18 = func(x_19, i); return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/load/param/ptr.spvasm.expected.msl b/test/ptr_ref/load/param/ptr.spvasm.expected.msl index 19998585a0..9c1e7cbb0e 100644 --- a/test/ptr_ref/load/param/ptr.spvasm.expected.msl +++ b/test/ptr_ref/load/param/ptr.spvasm.expected.msl @@ -6,7 +6,7 @@ int func(int value, thread int* const pointer) { return (value + x_9); } -kernel void tint_symbol() { +void main_1() { int i = 0; i = 123; int const x_19 = i; @@ -14,3 +14,8 @@ kernel void tint_symbol() { return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/ptr_ref/load/param/ptr.spvasm.expected.spvasm b/test/ptr_ref/load/param/ptr.spvasm.expected.spvasm index 967e2a68d4..c487a58ed2 100644 --- a/test/ptr_ref/load/param/ptr.spvasm.expected.spvasm +++ b/test/ptr_ref/load/param/ptr.spvasm.expected.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 22 +; Bound: 25 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 @@ -10,8 +10,9 @@ OpName %func "func" OpName %value "value" OpName %pointer "pointer" - OpName %main "main" + OpName %main_1 "main_1" OpName %i "i" + OpName %main "main" %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int %1 = OpTypeFunction %int %int %_ptr_Function_int @@ -28,7 +29,7 @@ %10 = OpIAdd %int %value %9 OpReturnValue %10 OpFunctionEnd - %main = OpFunction %void None %11 + %main_1 = OpFunction %void None %11 %14 = OpLabel %i = OpVariable %_ptr_Function_int Function %17 OpStore %i %int_0 @@ -37,3 +38,8 @@ %20 = OpFunctionCall %int %func %19 %i OpReturn OpFunctionEnd + %main = OpFunction %void None %11 + %23 = OpLabel + %24 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/load/param/ptr.spvasm.expected.wgsl b/test/ptr_ref/load/param/ptr.spvasm.expected.wgsl index e74bd4e7db..97ca0e7588 100644 --- a/test/ptr_ref/load/param/ptr.spvasm.expected.wgsl +++ b/test/ptr_ref/load/param/ptr.spvasm.expected.wgsl @@ -3,11 +3,15 @@ fn func(value : i32, pointer : ptr) -> i32 { return (value + x_9); } -[[stage(compute)]] -fn main() { +fn main_1() { var i : i32 = 0; i = 123; let x_19 : i32 = i; let x_18 : i32 = func(x_19, &(i)); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/store/global/i32.spvasm.expected.hlsl b/test/ptr_ref/store/global/i32.spvasm.expected.hlsl index cb1bb3dbd8..ffe06339c1 100644 --- a/test/ptr_ref/store/global/i32.spvasm.expected.hlsl +++ b/test/ptr_ref/store/global/i32.spvasm.expected.hlsl @@ -1,8 +1,13 @@ static int I = 0; -[numthreads(1, 1, 1)] -void main() { +void main_1() { I = 123; I = ((100 + 20) + 3); return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/store/global/i32.spvasm.expected.msl b/test/ptr_ref/store/global/i32.spvasm.expected.msl index 7eaf2d692a..6451fe4d19 100644 --- a/test/ptr_ref/store/global/i32.spvasm.expected.msl +++ b/test/ptr_ref/store/global/i32.spvasm.expected.msl @@ -1,10 +1,15 @@ #include using namespace metal; -kernel void tint_symbol() { - thread int tint_symbol_1 = 0; - tint_symbol_1 = 123; - tint_symbol_1 = ((100 + 20) + 3); +void main_1(thread int* const tint_symbol_1) { + *(tint_symbol_1) = 123; + *(tint_symbol_1) = ((100 + 20) + 3); + return; +} + +kernel void tint_symbol() { + thread int tint_symbol_2 = 0; + main_1(&(tint_symbol_2)); return; } diff --git a/test/ptr_ref/store/global/i32.spvasm.expected.spvasm b/test/ptr_ref/store/global/i32.spvasm.expected.spvasm index 786fc8a232..dc2e27124d 100644 --- a/test/ptr_ref/store/global/i32.spvasm.expected.spvasm +++ b/test/ptr_ref/store/global/i32.spvasm.expected.spvasm @@ -1,13 +1,14 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 15 +; Bound: 18 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 OpName %I "I" + OpName %main_1 "main_1" OpName %main "main" %int = OpTypeInt 32 1 %int_0 = OpConstant %int 0 @@ -19,7 +20,7 @@ %int_100 = OpConstant %int 100 %int_20 = OpConstant %int 20 %int_3 = OpConstant %int 3 - %main = OpFunction %void None %5 + %main_1 = OpFunction %void None %5 %8 = OpLabel OpStore %I %int_123 %12 = OpIAdd %int %int_100 %int_20 @@ -27,3 +28,8 @@ OpStore %I %14 OpReturn OpFunctionEnd + %main = OpFunction %void None %5 + %16 = OpLabel + %17 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/store/global/i32.spvasm.expected.wgsl b/test/ptr_ref/store/global/i32.spvasm.expected.wgsl index 9d7722f2a0..ffd907acef 100644 --- a/test/ptr_ref/store/global/i32.spvasm.expected.wgsl +++ b/test/ptr_ref/store/global/i32.spvasm.expected.wgsl @@ -1,8 +1,12 @@ var I : i32 = 0; -[[stage(compute)]] -fn main() { +fn main_1() { I = 123; I = ((100 + 20) + 3); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/store/global/struct_field.spvasm.expected.hlsl b/test/ptr_ref/store/global/struct_field.spvasm.expected.hlsl index 0d554940b7..0ce7881bd0 100644 --- a/test/ptr_ref/store/global/struct_field.spvasm.expected.hlsl +++ b/test/ptr_ref/store/global/struct_field.spvasm.expected.hlsl @@ -4,8 +4,13 @@ struct S { static S V; -[numthreads(1, 1, 1)] -void main() { +void main_1() { V.i = 5; return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/store/global/struct_field.spvasm.expected.msl b/test/ptr_ref/store/global/struct_field.spvasm.expected.msl index 243f1d60c3..451a322e55 100644 --- a/test/ptr_ref/store/global/struct_field.spvasm.expected.msl +++ b/test/ptr_ref/store/global/struct_field.spvasm.expected.msl @@ -5,9 +5,14 @@ struct S { int i; }; -kernel void tint_symbol() { - thread S tint_symbol_1 = {}; - tint_symbol_1.i = 5; +void main_1(thread S* const tint_symbol_1) { + (*(tint_symbol_1)).i = 5; + return; +} + +kernel void tint_symbol() { + thread S tint_symbol_2 = {}; + main_1(&(tint_symbol_2)); return; } diff --git a/test/ptr_ref/store/global/struct_field.spvasm.expected.spvasm b/test/ptr_ref/store/global/struct_field.spvasm.expected.spvasm index e63c070c44..7a712bc5e8 100644 --- a/test/ptr_ref/store/global/struct_field.spvasm.expected.spvasm +++ b/test/ptr_ref/store/global/struct_field.spvasm.expected.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 15 +; Bound: 18 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 @@ -10,6 +10,7 @@ OpName %S "S" OpMemberName %S 0 "i" OpName %V "V" + OpName %main_1 "main_1" OpName %main "main" OpMemberDecorate %S 0 Offset 0 %int = OpTypeInt 32 1 @@ -23,9 +24,14 @@ %uint_0 = OpConstant %uint 0 %_ptr_Private_int = OpTypePointer Private %int %int_5 = OpConstant %int 5 - %main = OpFunction %void None %6 + %main_1 = OpFunction %void None %6 %9 = OpLabel %13 = OpAccessChain %_ptr_Private_int %V %uint_0 OpStore %13 %int_5 OpReturn OpFunctionEnd + %main = OpFunction %void None %6 + %16 = OpLabel + %17 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/store/global/struct_field.spvasm.expected.wgsl b/test/ptr_ref/store/global/struct_field.spvasm.expected.wgsl index 50cb6f400a..7362392bcc 100644 --- a/test/ptr_ref/store/global/struct_field.spvasm.expected.wgsl +++ b/test/ptr_ref/store/global/struct_field.spvasm.expected.wgsl @@ -4,8 +4,12 @@ struct S { var V : S; -[[stage(compute)]] -fn main() { +fn main_1() { V.i = 5; return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/store/local/i32.spvasm.expected.hlsl b/test/ptr_ref/store/local/i32.spvasm.expected.hlsl index d9ec3d2fbe..5a9d251b30 100644 --- a/test/ptr_ref/store/local/i32.spvasm.expected.hlsl +++ b/test/ptr_ref/store/local/i32.spvasm.expected.hlsl @@ -1,8 +1,13 @@ -[numthreads(1, 1, 1)] -void main() { +void main_1() { int i = 0; i = 123; i = 123; i = ((100 + 20) + 3); return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/store/local/i32.spvasm.expected.msl b/test/ptr_ref/store/local/i32.spvasm.expected.msl index 21174ae8cf..dd05e5cd02 100644 --- a/test/ptr_ref/store/local/i32.spvasm.expected.msl +++ b/test/ptr_ref/store/local/i32.spvasm.expected.msl @@ -1,7 +1,7 @@ #include using namespace metal; -kernel void tint_symbol() { +void main_1() { int i = 0; i = 123; i = 123; @@ -9,3 +9,8 @@ kernel void tint_symbol() { return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/ptr_ref/store/local/i32.spvasm.expected.spvasm b/test/ptr_ref/store/local/i32.spvasm.expected.spvasm index 5a05b5ef88..85a187aad3 100644 --- a/test/ptr_ref/store/local/i32.spvasm.expected.spvasm +++ b/test/ptr_ref/store/local/i32.spvasm.expected.spvasm @@ -1,14 +1,15 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 16 +; Bound: 19 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 - OpName %main "main" + OpName %main_1 "main_1" OpName %i "i" + OpName %main "main" %void = OpTypeVoid %1 = OpTypeFunction %void %int = OpTypeInt 32 1 @@ -19,7 +20,7 @@ %int_100 = OpConstant %int 100 %int_20 = OpConstant %int 20 %int_3 = OpConstant %int 3 - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %i = OpVariable %_ptr_Function_int Function %9 OpStore %i %int_0 @@ -30,3 +31,8 @@ OpStore %i %15 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %17 = OpLabel + %18 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/store/local/i32.spvasm.expected.wgsl b/test/ptr_ref/store/local/i32.spvasm.expected.wgsl index ebc870ac4f..f1695d1f8b 100644 --- a/test/ptr_ref/store/local/i32.spvasm.expected.wgsl +++ b/test/ptr_ref/store/local/i32.spvasm.expected.wgsl @@ -1,8 +1,12 @@ -[[stage(compute)]] -fn main() { +fn main_1() { var i : i32 = 0; i = 123; i = 123; i = ((100 + 20) + 3); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/store/local/struct_field.spvasm.expected.hlsl b/test/ptr_ref/store/local/struct_field.spvasm.expected.hlsl index 9f99f65d71..f28389baef 100644 --- a/test/ptr_ref/store/local/struct_field.spvasm.expected.hlsl +++ b/test/ptr_ref/store/local/struct_field.spvasm.expected.hlsl @@ -2,9 +2,14 @@ struct S { int i; }; -[numthreads(1, 1, 1)] -void main() { +void main_1() { S V = {0}; V.i = 5; return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/store/local/struct_field.spvasm.expected.msl b/test/ptr_ref/store/local/struct_field.spvasm.expected.msl index 2e6989d13e..8be537869a 100644 --- a/test/ptr_ref/store/local/struct_field.spvasm.expected.msl +++ b/test/ptr_ref/store/local/struct_field.spvasm.expected.msl @@ -5,9 +5,14 @@ struct S { int i; }; -kernel void tint_symbol() { +void main_1() { S V = {}; V.i = 5; return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/ptr_ref/store/local/struct_field.spvasm.expected.spvasm b/test/ptr_ref/store/local/struct_field.spvasm.expected.spvasm index 255c691960..1724b729b7 100644 --- a/test/ptr_ref/store/local/struct_field.spvasm.expected.spvasm +++ b/test/ptr_ref/store/local/struct_field.spvasm.expected.spvasm @@ -1,16 +1,17 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 15 +; Bound: 18 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 - OpName %main "main" + OpName %main_1 "main_1" OpName %S "S" OpMemberName %S 0 "i" OpName %V "V" + OpName %main "main" OpMemberDecorate %S 0 Offset 0 %void = OpTypeVoid %1 = OpTypeFunction %void @@ -22,10 +23,15 @@ %uint_0 = OpConstant %uint 0 %_ptr_Function_int = OpTypePointer Function %int %int_5 = OpConstant %int 5 - %main = OpFunction %void None %1 + %main_1 = OpFunction %void None %1 %4 = OpLabel %V = OpVariable %_ptr_Function_S Function %9 %13 = OpAccessChain %_ptr_Function_int %V %uint_0 OpStore %13 %int_5 OpReturn OpFunctionEnd + %main = OpFunction %void None %1 + %16 = OpLabel + %17 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/store/local/struct_field.spvasm.expected.wgsl b/test/ptr_ref/store/local/struct_field.spvasm.expected.wgsl index 77d7681d3d..d9c0e1fa2f 100644 --- a/test/ptr_ref/store/local/struct_field.spvasm.expected.wgsl +++ b/test/ptr_ref/store/local/struct_field.spvasm.expected.wgsl @@ -2,9 +2,13 @@ struct S { i : i32; }; -[[stage(compute)]] -fn main() { +fn main_1() { var V : S; V.i = 5; return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/ptr_ref/store/param/ptr.spvasm.expected.hlsl b/test/ptr_ref/store/param/ptr.spvasm.expected.hlsl index 7caf2f144b..319111830d 100644 --- a/test/ptr_ref/store/param/ptr.spvasm.expected.hlsl +++ b/test/ptr_ref/store/param/ptr.spvasm.expected.hlsl @@ -3,10 +3,15 @@ void func(int value, inout int pointer) { return; } -[numthreads(1, 1, 1)] -void main() { +void main_1() { int i = 0; i = 123; func(123, i); return; } + +[numthreads(1, 1, 1)] +void main() { + main_1(); + return; +} diff --git a/test/ptr_ref/store/param/ptr.spvasm.expected.msl b/test/ptr_ref/store/param/ptr.spvasm.expected.msl index 98cc63cb88..e689f47c2b 100644 --- a/test/ptr_ref/store/param/ptr.spvasm.expected.msl +++ b/test/ptr_ref/store/param/ptr.spvasm.expected.msl @@ -6,10 +6,15 @@ void func(int value, thread int* const pointer) { return; } -kernel void tint_symbol() { +void main_1() { int i = 0; i = 123; func(123, &(i)); return; } +kernel void tint_symbol() { + main_1(); + return; +} + diff --git a/test/ptr_ref/store/param/ptr.spvasm.expected.spvasm b/test/ptr_ref/store/param/ptr.spvasm.expected.spvasm index 8126ab6ada..c4a8e196b6 100644 --- a/test/ptr_ref/store/param/ptr.spvasm.expected.spvasm +++ b/test/ptr_ref/store/param/ptr.spvasm.expected.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 19 +; Bound: 22 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 @@ -10,8 +10,9 @@ OpName %func "func" OpName %value "value" OpName %pointer "pointer" - OpName %main "main" + OpName %main_1 "main_1" OpName %i "i" + OpName %main "main" %void = OpTypeVoid %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int @@ -27,7 +28,7 @@ OpStore %pointer %value OpReturn OpFunctionEnd - %main = OpFunction %void None %10 + %main_1 = OpFunction %void None %10 %12 = OpLabel %i = OpVariable %_ptr_Function_int Function %15 OpStore %i %int_0 @@ -35,3 +36,8 @@ %17 = OpFunctionCall %void %func %int_123 %i OpReturn OpFunctionEnd + %main = OpFunction %void None %10 + %20 = OpLabel + %21 = OpFunctionCall %void %main_1 + OpReturn + OpFunctionEnd diff --git a/test/ptr_ref/store/param/ptr.spvasm.expected.wgsl b/test/ptr_ref/store/param/ptr.spvasm.expected.wgsl index b3de2ebe12..d56ff4cbfe 100644 --- a/test/ptr_ref/store/param/ptr.spvasm.expected.wgsl +++ b/test/ptr_ref/store/param/ptr.spvasm.expected.wgsl @@ -3,10 +3,14 @@ fn func(value : i32, pointer : ptr) { return; } -[[stage(compute)]] -fn main() { +fn main_1() { var i : i32 = 0; i = 123; func(123, &(i)); return; } + +[[stage(compute)]] +fn main() { + main_1(); +} diff --git a/test/samples/simple_vertex.spvasm.expected.msl b/test/samples/simple_vertex.spvasm.expected.msl index 58199d461f..cbba9403c3 100644 --- a/test/samples/simple_vertex.spvasm.expected.msl +++ b/test/samples/simple_vertex.spvasm.expected.msl @@ -1,13 +1,23 @@ #include using namespace metal; -struct tint_symbol_out { +struct main_out { + float4 gl_Position; +}; +struct tint_symbol_1 { float4 gl_Position [[position]]; }; -vertex tint_symbol_out tint_symbol() { - tint_symbol_out _tint_out = {}; - _tint_out.gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); - return _tint_out; +void main_1(thread float4* const tint_symbol_4) { + *(tint_symbol_4) = float4(0.0f, 0.0f, 0.0f, 0.0f); + return; +} + +vertex tint_symbol_1 tint_symbol() { + thread float4 tint_symbol_5 = 0.0f; + main_1(&(tint_symbol_5)); + main_out const tint_symbol_2 = {.gl_Position=tint_symbol_5}; + tint_symbol_1 const tint_symbol_3 = {.gl_Position=tint_symbol_2.gl_Position}; + return tint_symbol_3; } diff --git a/test/samples/simple_vertex.spvasm.expected.spvasm b/test/samples/simple_vertex.spvasm.expected.spvasm index 89ff63f91f..e96f80d8e3 100644 --- a/test/samples/simple_vertex.spvasm.expected.spvasm +++ b/test/samples/simple_vertex.spvasm.expected.spvasm @@ -1,32 +1,58 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 16 +; Bound: 30 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" %tint_pointsize %gl_Position + OpEntryPoint Vertex %main "main" %tint_pointsize %tint_symbol_1 OpName %tint_pointsize "tint_pointsize" OpName %gl_Position "gl_Position" + OpName %tint_symbol_1 "tint_symbol_1" + OpName %main_1 "main_1" + OpName %main_out "main_out" + OpMemberName %main_out 0 "gl_Position" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %main "main" OpDecorate %tint_pointsize BuiltIn PointSize - OpDecorate %gl_Position BuiltIn Position + OpDecorate %tint_symbol_1 BuiltIn Position + OpMemberDecorate %main_out 0 Offset 0 %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float +%_ptr_Private_v4float = OpTypePointer Private %v4float %8 = OpConstantNull %v4float -%gl_Position = OpVariable %_ptr_Output_v4float Output %8 +%gl_Position = OpVariable %_ptr_Private_v4float Private %8 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %9 = OpTypeFunction %void - %float_1 = OpConstant %float 1 + %11 = OpTypeFunction %void %float_0 = OpConstant %float 0 - %15 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 - %main = OpFunction %void None %9 - %12 = OpLabel - OpStore %tint_pointsize %float_1 - OpStore %gl_Position %15 + %16 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 + %main_out = OpTypeStruct %v4float + %17 = OpTypeFunction %void %main_out + %float_1 = OpConstant %float 1 + %main_1 = OpFunction %void None %11 + %14 = OpLabel + OpStore %gl_Position %16 + OpReturn + OpFunctionEnd +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %main_out + %21 = OpLabel + %22 = OpCompositeExtract %v4float %tint_symbol 0 + OpStore %tint_symbol_1 %22 + OpReturn + OpFunctionEnd + %main = OpFunction %void None %11 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %main_1 + %28 = OpLoad %v4float %gl_Position + %29 = OpCompositeConstruct %main_out %28 + %27 = OpFunctionCall %void %tint_symbol_2 %29 OpReturn OpFunctionEnd diff --git a/test/samples/simple_vertex.spvasm.expected.wgsl b/test/samples/simple_vertex.spvasm.expected.wgsl index 75c87cdc89..45b705fab8 100644 --- a/test/samples/simple_vertex.spvasm.expected.wgsl +++ b/test/samples/simple_vertex.spvasm.expected.wgsl @@ -1,7 +1,17 @@ -[[builtin(position)]] var gl_Position : vec4; +var gl_Position : vec4; -[[stage(vertex)]] -fn main() { +fn main_1() { gl_Position = vec4(0.0, 0.0, 0.0, 0.0); return; } + +struct main_out { + [[builtin(position)]] + gl_Position : vec4; +}; + +[[stage(vertex)]] +fn main() -> main_out { + main_1(); + return main_out(gl_Position); +}