xref: /aosp_15_r20/external/skia/tests/sksl/shared/StaticSwitchWithConditionalBreak.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Fragment %main "main" %sk_FragColor
5               OpExecutionMode %main OriginUpperLeft
6               OpName %sk_FragColor "sk_FragColor"
7               OpName %_UniformBuffer "_UniformBuffer"
8               OpMemberName %_UniformBuffer 0 "unknownInput"
9               OpName %main "main"
10               OpName %value "value"
11               OpDecorate %sk_FragColor RelaxedPrecision
12               OpDecorate %sk_FragColor Location 0
13               OpDecorate %sk_FragColor Index 0
14               OpMemberDecorate %_UniformBuffer 0 Offset 0
15               OpDecorate %_UniformBuffer Block
16               OpDecorate %7 Binding 0
17               OpDecorate %7 DescriptorSet 0
18               OpDecorate %value RelaxedPrecision
19               OpDecorate %30 RelaxedPrecision
20               OpDecorate %31 RelaxedPrecision
21      %float = OpTypeFloat 32
22    %v4float = OpTypeVector %float 4
23%_ptr_Output_v4float = OpTypePointer Output %v4float
24%sk_FragColor = OpVariable %_ptr_Output_v4float Output
25%_UniformBuffer = OpTypeStruct %float
26%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
27          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
28       %void = OpTypeVoid
29         %11 = OpTypeFunction %void
30%_ptr_Function_float = OpTypePointer Function %float
31    %float_0 = OpConstant %float 0
32        %int = OpTypeInt 32 1
33      %int_0 = OpConstant %int 0
34%_ptr_Uniform_float = OpTypePointer Uniform %float
35    %float_2 = OpConstant %float 2
36       %bool = OpTypeBool
37    %float_1 = OpConstant %float 1
38       %main = OpFunction %void None %11
39         %12 = OpLabel
40      %value = OpVariable %_ptr_Function_float Function
41               OpStore %value %float_0
42               OpSelectionMerge %18 None
43               OpSwitch %int_0 %18 0 %19 1 %20
44         %19 = OpLabel
45               OpStore %value %float_0
46         %21 = OpAccessChain %_ptr_Uniform_float %7 %int_0
47         %23 = OpLoad %float %21
48         %25 = OpFOrdEqual %bool %23 %float_2
49               OpSelectionMerge %28 None
50               OpBranchConditional %25 %27 %28
51         %27 = OpLabel
52               OpBranch %18
53         %28 = OpLabel
54               OpBranch %20
55         %20 = OpLabel
56               OpStore %value %float_1
57               OpBranch %18
58         %18 = OpLabel
59         %30 = OpLoad %float %value
60         %31 = OpCompositeConstruct %v4float %30 %30 %30 %30
61               OpStore %sk_FragColor %31
62               OpReturn
63               OpFunctionEnd
64