skia2/tests/sksl/shared/StructsInFunctions.asm.frag

295 lines
9.3 KiB
GLSL
Raw Normal View History

OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %_entrypoint_v "_entrypoint" %sk_FragColor %sk_Clockwise
OpExecutionMode %_entrypoint_v OriginUpperLeft
OpName %sk_FragColor "sk_FragColor"
OpName %sk_Clockwise "sk_Clockwise"
Reland "Add support for top-level uniforms in SPIR-V." This reverts commit 0de76f72cd5ee7cfe33be3945e4a5651fee1331d. Reason for revert: fixes ASAN use-after-scope-end issue Original change's description: > Revert "Add support for top-level uniforms in SPIR-V." > > This reverts commit acba30420ce27b3464fd04fac90e822ffd0245d8. > > Reason for revert: ASAN breakage on tree for > Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-(Debug|Release)-All-ASAN > > Address 0x009af69fda78 is located in stack of thread T0 at offset 1272 in frame > #0 0x7ff75c069ddf in _asan_wrap_RtlReAllocateHeap+0x44014f (c:\b\s\w\ir\build\nanobench.exe+0x1413a9ddf) > This frame has 35 object(s): > [32, 104) 'body' (line 3363) > [144, 152) 'main' (line 3365) > [176, 184) 'ref.tmp' (line 3366) > [208, 240) '__begin1' (line 3366) > [272, 304) '__end1' (line 3366) > [336, 344) 'ref.tmp27' (line 3370) > [368, 384) 'ref.tmp31' (line 3371) > [400, 416) 'interfaceVars' (line 3382) > [432, 440) 'ref.tmp48' (line 3383) > [464, 496) '__begin151' (line 3383) > [528, 560) '__end154' (line 3383) > [592, 596) 'id' (line 3386) > [608, 624) 'tmp' (line 3393) > [640, 648) 'ref.tmp114' (line 3398) > [672, 704) '__begin1117' (line 3398) > [736, 768) '__end1120' (line 3398) > [800, 1008) 'uniformBuffer' (line 3405) > [1072, 1280) 'ref.tmp159' (line 3407) <== Memory access at offset 1272 is inside this variable > [1344, 1360) 'agg.tmp' > [1376, 1576) 'adapter' (line 3411) > [1648, 1848) 'ref.tmp179' (line 3413) > [1920, 1928) 'ref.tmp191' (line 3415) > [1952, 1960) 'ref.tmp210' (line 3421) > [1984, 2016) '__begin1213' (line 3421) > [2048, 2080) '__end1216' (line 3421) > [2112, 2120) '__begin1242' (line 3427) > [2144, 2152) '__end1247' (line 3427) > [2176, 2192) 'entry256' (line 3427) > [2208, 2224) 'tmp298' (line 3433) > [2240, 2256) 'agg.tmp307' > [2272, 2280) '__begin1365' (line 3457) > [2304, 2312) 'ref.tmp415' (line 3469) > [2336, 2368) '__begin1418' (line 3469) > [2400, 2432) '__end1421' (line 3469) > [2464, 2480) 'agg.tmp436' > > Original change's description: > > Add support for top-level uniforms in SPIR-V. > > > > Previously, a uniform not wrapped in an interface block would report a > > SPIR-V error: > > > > "Variables identified with the Uniform storage class are > > used to access transparent buffer backed resources. Such variables must > > be typed as OpTypeStruct, or an array of this type..." > > > > Now, the SPIR-V code generator automatically detects such global > > variables and synthesizes a struct named _UniformBuffer to hold them. > > When these variables are accessed, an OpAccessChain instruction is added > > to grab the variable out of the struct. > > > > Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66 > > Bug: skia:11225 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: Ib72e33dbd662a245c20bc9d45d1397454c9588a3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11225 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362057 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> > Auto-Submit: John Stiles <johnstiles@google.com> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com Bug: skia:11225 Change-Id: I10501c30a701301f6487ea154047ad1c1d0e8c70 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362076 Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 15:08:50 +00:00
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "colorRed"
OpMemberName %_UniformBuffer 1 "colorGreen"
OpName %_entrypoint_v "_entrypoint_v"
OpName %S "S"
OpMemberName %S 0 "x"
OpMemberName %S 1 "y"
OpName %returns_a_struct_S "returns_a_struct_S"
OpName %s "s"
OpName %accepts_a_struct_fS "accepts_a_struct_fS"
OpName %modifies_a_struct_vS "modifies_a_struct_vS"
OpName %main "main"
OpName %s_0 "s"
OpName %x "x"
OpName %expected "expected"
OpName %Nested "Nested"
OpMemberName %Nested 0 "a"
OpMemberName %Nested 1 "b"
OpName %n1 "n1"
OpName %n2 "n2"
OpName %n3 "n3"
OpName %valid "valid"
OpDecorate %sk_FragColor RelaxedPrecision
OpDecorate %sk_FragColor Location 0
OpDecorate %sk_FragColor Index 0
OpDecorate %sk_Clockwise BuiltIn FrontFacing
Reland "Add support for top-level uniforms in SPIR-V." This reverts commit 0de76f72cd5ee7cfe33be3945e4a5651fee1331d. Reason for revert: fixes ASAN use-after-scope-end issue Original change's description: > Revert "Add support for top-level uniforms in SPIR-V." > > This reverts commit acba30420ce27b3464fd04fac90e822ffd0245d8. > > Reason for revert: ASAN breakage on tree for > Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-(Debug|Release)-All-ASAN > > Address 0x009af69fda78 is located in stack of thread T0 at offset 1272 in frame > #0 0x7ff75c069ddf in _asan_wrap_RtlReAllocateHeap+0x44014f (c:\b\s\w\ir\build\nanobench.exe+0x1413a9ddf) > This frame has 35 object(s): > [32, 104) 'body' (line 3363) > [144, 152) 'main' (line 3365) > [176, 184) 'ref.tmp' (line 3366) > [208, 240) '__begin1' (line 3366) > [272, 304) '__end1' (line 3366) > [336, 344) 'ref.tmp27' (line 3370) > [368, 384) 'ref.tmp31' (line 3371) > [400, 416) 'interfaceVars' (line 3382) > [432, 440) 'ref.tmp48' (line 3383) > [464, 496) '__begin151' (line 3383) > [528, 560) '__end154' (line 3383) > [592, 596) 'id' (line 3386) > [608, 624) 'tmp' (line 3393) > [640, 648) 'ref.tmp114' (line 3398) > [672, 704) '__begin1117' (line 3398) > [736, 768) '__end1120' (line 3398) > [800, 1008) 'uniformBuffer' (line 3405) > [1072, 1280) 'ref.tmp159' (line 3407) <== Memory access at offset 1272 is inside this variable > [1344, 1360) 'agg.tmp' > [1376, 1576) 'adapter' (line 3411) > [1648, 1848) 'ref.tmp179' (line 3413) > [1920, 1928) 'ref.tmp191' (line 3415) > [1952, 1960) 'ref.tmp210' (line 3421) > [1984, 2016) '__begin1213' (line 3421) > [2048, 2080) '__end1216' (line 3421) > [2112, 2120) '__begin1242' (line 3427) > [2144, 2152) '__end1247' (line 3427) > [2176, 2192) 'entry256' (line 3427) > [2208, 2224) 'tmp298' (line 3433) > [2240, 2256) 'agg.tmp307' > [2272, 2280) '__begin1365' (line 3457) > [2304, 2312) 'ref.tmp415' (line 3469) > [2336, 2368) '__begin1418' (line 3469) > [2400, 2432) '__end1421' (line 3469) > [2464, 2480) 'agg.tmp436' > > Original change's description: > > Add support for top-level uniforms in SPIR-V. > > > > Previously, a uniform not wrapped in an interface block would report a > > SPIR-V error: > > > > "Variables identified with the Uniform storage class are > > used to access transparent buffer backed resources. Such variables must > > be typed as OpTypeStruct, or an array of this type..." > > > > Now, the SPIR-V code generator automatically detects such global > > variables and synthesizes a struct named _UniformBuffer to hold them. > > When these variables are accessed, an OpAccessChain instruction is added > > to grab the variable out of the struct. > > > > Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66 > > Bug: skia:11225 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: Ib72e33dbd662a245c20bc9d45d1397454c9588a3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11225 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362057 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> > Auto-Submit: John Stiles <johnstiles@google.com> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com Bug: skia:11225 Change-Id: I10501c30a701301f6487ea154047ad1c1d0e8c70 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362076 Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 15:08:50 +00:00
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
OpMemberDecorate %_UniformBuffer 1 Offset 16
OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
OpDecorate %_UniformBuffer Block
OpDecorate %13 Binding 0
OpDecorate %13 DescriptorSet 0
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %S 1 Offset 4
OpDecorate %35 RelaxedPrecision
OpDecorate %59 RelaxedPrecision
OpMemberDecorate %Nested 0 Offset 0
OpMemberDecorate %Nested 0 RelaxedPrecision
OpMemberDecorate %Nested 1 Offset 16
OpMemberDecorate %Nested 1 RelaxedPrecision
OpDecorate %76 RelaxedPrecision
OpDecorate %78 RelaxedPrecision
OpDecorate %102 RelaxedPrecision
OpDecorate %103 RelaxedPrecision
OpDecorate %114 RelaxedPrecision
OpDecorate %126 RelaxedPrecision
OpDecorate %127 RelaxedPrecision
OpDecorate %150 RelaxedPrecision
OpDecorate %151 RelaxedPrecision
OpDecorate %172 RelaxedPrecision
OpDecorate %180 RelaxedPrecision
OpDecorate %182 RelaxedPrecision
OpDecorate %183 RelaxedPrecision
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%sk_FragColor = OpVariable %_ptr_Output_v4float Output
%bool = OpTypeBool
%_ptr_Input_bool = OpTypePointer Input %bool
%sk_Clockwise = OpVariable %_ptr_Input_bool Input
Reland "Add support for top-level uniforms in SPIR-V." This reverts commit 0de76f72cd5ee7cfe33be3945e4a5651fee1331d. Reason for revert: fixes ASAN use-after-scope-end issue Original change's description: > Revert "Add support for top-level uniforms in SPIR-V." > > This reverts commit acba30420ce27b3464fd04fac90e822ffd0245d8. > > Reason for revert: ASAN breakage on tree for > Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-(Debug|Release)-All-ASAN > > Address 0x009af69fda78 is located in stack of thread T0 at offset 1272 in frame > #0 0x7ff75c069ddf in _asan_wrap_RtlReAllocateHeap+0x44014f (c:\b\s\w\ir\build\nanobench.exe+0x1413a9ddf) > This frame has 35 object(s): > [32, 104) 'body' (line 3363) > [144, 152) 'main' (line 3365) > [176, 184) 'ref.tmp' (line 3366) > [208, 240) '__begin1' (line 3366) > [272, 304) '__end1' (line 3366) > [336, 344) 'ref.tmp27' (line 3370) > [368, 384) 'ref.tmp31' (line 3371) > [400, 416) 'interfaceVars' (line 3382) > [432, 440) 'ref.tmp48' (line 3383) > [464, 496) '__begin151' (line 3383) > [528, 560) '__end154' (line 3383) > [592, 596) 'id' (line 3386) > [608, 624) 'tmp' (line 3393) > [640, 648) 'ref.tmp114' (line 3398) > [672, 704) '__begin1117' (line 3398) > [736, 768) '__end1120' (line 3398) > [800, 1008) 'uniformBuffer' (line 3405) > [1072, 1280) 'ref.tmp159' (line 3407) <== Memory access at offset 1272 is inside this variable > [1344, 1360) 'agg.tmp' > [1376, 1576) 'adapter' (line 3411) > [1648, 1848) 'ref.tmp179' (line 3413) > [1920, 1928) 'ref.tmp191' (line 3415) > [1952, 1960) 'ref.tmp210' (line 3421) > [1984, 2016) '__begin1213' (line 3421) > [2048, 2080) '__end1216' (line 3421) > [2112, 2120) '__begin1242' (line 3427) > [2144, 2152) '__end1247' (line 3427) > [2176, 2192) 'entry256' (line 3427) > [2208, 2224) 'tmp298' (line 3433) > [2240, 2256) 'agg.tmp307' > [2272, 2280) '__begin1365' (line 3457) > [2304, 2312) 'ref.tmp415' (line 3469) > [2336, 2368) '__begin1418' (line 3469) > [2400, 2432) '__end1421' (line 3469) > [2464, 2480) 'agg.tmp436' > > Original change's description: > > Add support for top-level uniforms in SPIR-V. > > > > Previously, a uniform not wrapped in an interface block would report a > > SPIR-V error: > > > > "Variables identified with the Uniform storage class are > > used to access transparent buffer backed resources. Such variables must > > be typed as OpTypeStruct, or an array of this type..." > > > > Now, the SPIR-V code generator automatically detects such global > > variables and synthesizes a struct named _UniformBuffer to hold them. > > When these variables are accessed, an OpAccessChain instruction is added > > to grab the variable out of the struct. > > > > Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66 > > Bug: skia:11225 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: Ib72e33dbd662a245c20bc9d45d1397454c9588a3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11225 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362057 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> > Auto-Submit: John Stiles <johnstiles@google.com> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com Bug: skia:11225 Change-Id: I10501c30a701301f6487ea154047ad1c1d0e8c70 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362076 Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 15:08:50 +00:00
%_UniformBuffer = OpTypeStruct %v4float %v4float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%13 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%void = OpTypeVoid
%18 = OpTypeFunction %void
%int = OpTypeInt 32 1
%S = OpTypeStruct %float %int
%23 = OpTypeFunction %S
%_ptr_Function_S = OpTypePointer Function %S
%float_1 = OpConstant %float 1
%int_0 = OpConstant %int 0
%_ptr_Function_float = OpTypePointer Function %float
%int_2 = OpConstant %int 2
%int_1 = OpConstant %int 1
%_ptr_Function_int = OpTypePointer Function %int
%36 = OpTypeFunction %float %_ptr_Function_S
%45 = OpTypeFunction %void %_ptr_Function_S
%54 = OpTypeFunction %v4float
%float_2 = OpConstant %float 2
%int_3 = OpConstant %int 3
%Nested = OpTypeStruct %S %S
%_ptr_Function_Nested = OpTypePointer Function %Nested
%_ptr_Function_bool = OpTypePointer Function %bool
%false = OpConstantFalse %bool
%float_3 = OpConstant %float 3
%_ptr_Function_v4float = OpTypePointer Function %v4float
Reland "Add support for top-level uniforms in SPIR-V." This reverts commit 0de76f72cd5ee7cfe33be3945e4a5651fee1331d. Reason for revert: fixes ASAN use-after-scope-end issue Original change's description: > Revert "Add support for top-level uniforms in SPIR-V." > > This reverts commit acba30420ce27b3464fd04fac90e822ffd0245d8. > > Reason for revert: ASAN breakage on tree for > Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-(Debug|Release)-All-ASAN > > Address 0x009af69fda78 is located in stack of thread T0 at offset 1272 in frame > #0 0x7ff75c069ddf in _asan_wrap_RtlReAllocateHeap+0x44014f (c:\b\s\w\ir\build\nanobench.exe+0x1413a9ddf) > This frame has 35 object(s): > [32, 104) 'body' (line 3363) > [144, 152) 'main' (line 3365) > [176, 184) 'ref.tmp' (line 3366) > [208, 240) '__begin1' (line 3366) > [272, 304) '__end1' (line 3366) > [336, 344) 'ref.tmp27' (line 3370) > [368, 384) 'ref.tmp31' (line 3371) > [400, 416) 'interfaceVars' (line 3382) > [432, 440) 'ref.tmp48' (line 3383) > [464, 496) '__begin151' (line 3383) > [528, 560) '__end154' (line 3383) > [592, 596) 'id' (line 3386) > [608, 624) 'tmp' (line 3393) > [640, 648) 'ref.tmp114' (line 3398) > [672, 704) '__begin1117' (line 3398) > [736, 768) '__end1120' (line 3398) > [800, 1008) 'uniformBuffer' (line 3405) > [1072, 1280) 'ref.tmp159' (line 3407) <== Memory access at offset 1272 is inside this variable > [1344, 1360) 'agg.tmp' > [1376, 1576) 'adapter' (line 3411) > [1648, 1848) 'ref.tmp179' (line 3413) > [1920, 1928) 'ref.tmp191' (line 3415) > [1952, 1960) 'ref.tmp210' (line 3421) > [1984, 2016) '__begin1213' (line 3421) > [2048, 2080) '__end1216' (line 3421) > [2112, 2120) '__begin1242' (line 3427) > [2144, 2152) '__end1247' (line 3427) > [2176, 2192) 'entry256' (line 3427) > [2208, 2224) 'tmp298' (line 3433) > [2240, 2256) 'agg.tmp307' > [2272, 2280) '__begin1365' (line 3457) > [2304, 2312) 'ref.tmp415' (line 3469) > [2336, 2368) '__begin1418' (line 3469) > [2400, 2432) '__end1421' (line 3469) > [2464, 2480) 'agg.tmp436' > > Original change's description: > > Add support for top-level uniforms in SPIR-V. > > > > Previously, a uniform not wrapped in an interface block would report a > > SPIR-V error: > > > > "Variables identified with the Uniform storage class are > > used to access transparent buffer backed resources. Such variables must > > be typed as OpTypeStruct, or an array of this type..." > > > > Now, the SPIR-V code generator automatically detects such global > > variables and synthesizes a struct named _UniformBuffer to hold them. > > When these variables are accessed, an OpAccessChain instruction is added > > to grab the variable out of the struct. > > > > Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66 > > Bug: skia:11225 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: Ib72e33dbd662a245c20bc9d45d1397454c9588a3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11225 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362057 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> > Auto-Submit: John Stiles <johnstiles@google.com> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com Bug: skia:11225 Change-Id: I10501c30a701301f6487ea154047ad1c1d0e8c70 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362076 Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 15:08:50 +00:00
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%_entrypoint_v = OpFunction %void None %18
%19 = OpLabel
%20 = OpFunctionCall %v4float %main
OpStore %sk_FragColor %20
OpReturn
OpFunctionEnd
%returns_a_struct_S = OpFunction %S None %23
%24 = OpLabel
%s = OpVariable %_ptr_Function_S Function
%29 = OpAccessChain %_ptr_Function_float %s %int_0
OpStore %29 %float_1
%33 = OpAccessChain %_ptr_Function_int %s %int_1
OpStore %33 %int_2
%35 = OpLoad %S %s
OpReturnValue %35
OpFunctionEnd
%accepts_a_struct_fS = OpFunction %float None %36
%37 = OpFunctionParameter %_ptr_Function_S
%38 = OpLabel
%39 = OpAccessChain %_ptr_Function_float %37 %int_0
%40 = OpLoad %float %39
%41 = OpAccessChain %_ptr_Function_int %37 %int_1
%42 = OpLoad %int %41
%43 = OpConvertSToF %float %42
%44 = OpFAdd %float %40 %43
OpReturnValue %44
OpFunctionEnd
%modifies_a_struct_vS = OpFunction %void None %45
%46 = OpFunctionParameter %_ptr_Function_S
%47 = OpLabel
%48 = OpAccessChain %_ptr_Function_float %46 %int_0
%49 = OpLoad %float %48
%50 = OpFAdd %float %49 %float_1
OpStore %48 %50
%51 = OpAccessChain %_ptr_Function_int %46 %int_1
%52 = OpLoad %int %51
%53 = OpIAdd %int %52 %int_1
OpStore %51 %53
OpReturn
OpFunctionEnd
%main = OpFunction %v4float None %54
%55 = OpLabel
%s_0 = OpVariable %_ptr_Function_S Function
%x = OpVariable %_ptr_Function_float Function
%60 = OpVariable %_ptr_Function_S Function
%expected = OpVariable %_ptr_Function_S Function
%n1 = OpVariable %_ptr_Function_Nested Function
%n2 = OpVariable %_ptr_Function_Nested Function
%n3 = OpVariable %_ptr_Function_Nested Function
%79 = OpVariable %_ptr_Function_S Function
%valid = OpVariable %_ptr_Function_bool Function
%173 = OpVariable %_ptr_Function_v4float Function
%57 = OpFunctionCall %S %returns_a_struct_S
OpStore %s_0 %57
%59 = OpLoad %S %s_0
OpStore %60 %59
%61 = OpFunctionCall %float %accepts_a_struct_fS %60
OpStore %x %61
%62 = OpFunctionCall %void %modifies_a_struct_vS %s_0
%65 = OpAccessChain %_ptr_Function_float %expected %int_0
OpStore %65 %float_2
%67 = OpAccessChain %_ptr_Function_int %expected %int_1
OpStore %67 %int_3
%73 = OpFunctionCall %S %returns_a_struct_S
%74 = OpAccessChain %_ptr_Function_S %n1 %int_1
OpStore %74 %73
%75 = OpAccessChain %_ptr_Function_S %n1 %int_0
OpStore %75 %73
%76 = OpLoad %Nested %n1
OpStore %n2 %76
OpStore %n3 %76
%77 = OpAccessChain %_ptr_Function_S %n3 %int_1
%78 = OpLoad %S %77
OpStore %79 %78
%80 = OpFunctionCall %void %modifies_a_struct_vS %79
%81 = OpLoad %S %79
OpStore %77 %81
%85 = OpLoad %float %x
%87 = OpFOrdEqual %bool %85 %float_3
OpSelectionMerge %89 None
OpBranchConditional %87 %88 %89
%88 = OpLabel
%90 = OpAccessChain %_ptr_Function_float %s_0 %int_0
%91 = OpLoad %float %90
%92 = OpFOrdEqual %bool %91 %float_2
OpBranch %89
%89 = OpLabel
%93 = OpPhi %bool %false %55 %92 %88
OpSelectionMerge %95 None
OpBranchConditional %93 %94 %95
%94 = OpLabel
%96 = OpAccessChain %_ptr_Function_int %s_0 %int_1
%97 = OpLoad %int %96
%98 = OpIEqual %bool %97 %int_3
OpBranch %95
%95 = OpLabel
%99 = OpPhi %bool %false %89 %98 %94
OpSelectionMerge %101 None
OpBranchConditional %99 %100 %101
%100 = OpLabel
%102 = OpLoad %S %s_0
%103 = OpLoad %S %expected
%104 = OpCompositeExtract %float %102 0
%105 = OpCompositeExtract %float %103 0
%106 = OpFOrdEqual %bool %104 %105
%107 = OpCompositeExtract %int %102 1
%108 = OpCompositeExtract %int %103 1
%109 = OpIEqual %bool %107 %108
%110 = OpLogicalAnd %bool %109 %106
OpBranch %101
%101 = OpLabel
%111 = OpPhi %bool %false %95 %110 %100
OpSelectionMerge %113 None
OpBranchConditional %111 %112 %113
%112 = OpLabel
%114 = OpLoad %S %s_0
%115 = OpFunctionCall %S %returns_a_struct_S
%116 = OpCompositeExtract %float %114 0
%117 = OpCompositeExtract %float %115 0
%118 = OpFOrdNotEqual %bool %116 %117
%119 = OpCompositeExtract %int %114 1
%120 = OpCompositeExtract %int %115 1
%121 = OpINotEqual %bool %119 %120
%122 = OpLogicalOr %bool %121 %118
OpBranch %113
%113 = OpLabel
%123 = OpPhi %bool %false %101 %122 %112
OpSelectionMerge %125 None
OpBranchConditional %123 %124 %125
%124 = OpLabel
%126 = OpLoad %Nested %n1
%127 = OpLoad %Nested %n2
%128 = OpCompositeExtract %S %126 0
%129 = OpCompositeExtract %S %127 0
%130 = OpCompositeExtract %float %128 0
%131 = OpCompositeExtract %float %129 0
%132 = OpFOrdEqual %bool %130 %131
%133 = OpCompositeExtract %int %128 1
%134 = OpCompositeExtract %int %129 1
%135 = OpIEqual %bool %133 %134
%136 = OpLogicalAnd %bool %135 %132
%137 = OpCompositeExtract %S %126 1
%138 = OpCompositeExtract %S %127 1
%139 = OpCompositeExtract %float %137 0
%140 = OpCompositeExtract %float %138 0
%141 = OpFOrdEqual %bool %139 %140
%142 = OpCompositeExtract %int %137 1
%143 = OpCompositeExtract %int %138 1
%144 = OpIEqual %bool %142 %143
%145 = OpLogicalAnd %bool %144 %141
%146 = OpLogicalAnd %bool %145 %136
OpBranch %125
%125 = OpLabel
%147 = OpPhi %bool %false %113 %146 %124
OpSelectionMerge %149 None
OpBranchConditional %147 %148 %149
%148 = OpLabel
%150 = OpLoad %Nested %n1
%151 = OpLoad %Nested %n3
%152 = OpCompositeExtract %S %150 0
%153 = OpCompositeExtract %S %151 0
%154 = OpCompositeExtract %float %152 0
%155 = OpCompositeExtract %float %153 0
%156 = OpFOrdNotEqual %bool %154 %155
%157 = OpCompositeExtract %int %152 1
%158 = OpCompositeExtract %int %153 1
%159 = OpINotEqual %bool %157 %158
%160 = OpLogicalOr %bool %159 %156
%161 = OpCompositeExtract %S %150 1
%162 = OpCompositeExtract %S %151 1
%163 = OpCompositeExtract %float %161 0
%164 = OpCompositeExtract %float %162 0
%165 = OpFOrdNotEqual %bool %163 %164
%166 = OpCompositeExtract %int %161 1
%167 = OpCompositeExtract %int %162 1
%168 = OpINotEqual %bool %166 %167
%169 = OpLogicalOr %bool %168 %165
%170 = OpLogicalOr %bool %169 %160
OpBranch %149
%149 = OpLabel
%171 = OpPhi %bool %false %125 %170 %148
OpStore %valid %171
%172 = OpLoad %bool %valid
OpSelectionMerge %177 None
OpBranchConditional %172 %175 %176
%175 = OpLabel
%178 = OpAccessChain %_ptr_Uniform_v4float %13 %int_1
%180 = OpLoad %v4float %178
OpStore %173 %180
OpBranch %177
%176 = OpLabel
%181 = OpAccessChain %_ptr_Uniform_v4float %13 %int_0
%182 = OpLoad %v4float %181
OpStore %173 %182
OpBranch %177
%177 = OpLabel
%183 = OpLoad %v4float %173
OpReturnValue %183
OpFunctionEnd