xref: /aosp_15_r20/external/skia/tests/sksl/shared/Switch.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Fragment %_entrypoint_v "_entrypoint" %sk_FragColor
5               OpExecutionMode %_entrypoint_v OriginUpperLeft
6               OpName %sk_FragColor "sk_FragColor"
7               OpName %_UniformBuffer "_UniformBuffer"
8               OpMemberName %_UniformBuffer 0 "colorGreen"
9               OpMemberName %_UniformBuffer 1 "colorRed"
10               OpName %_entrypoint_v "_entrypoint_v"
11               OpName %main "main"
12               OpName %color "color"
13               OpDecorate %sk_FragColor RelaxedPrecision
14               OpDecorate %sk_FragColor Location 0
15               OpDecorate %sk_FragColor Index 0
16               OpMemberDecorate %_UniformBuffer 0 Offset 0
17               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
18               OpMemberDecorate %_UniformBuffer 1 Offset 16
19               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
20               OpDecorate %_UniformBuffer Block
21               OpDecorate %7 Binding 0
22               OpDecorate %7 DescriptorSet 0
23               OpDecorate %color RelaxedPrecision
24               OpDecorate %29 RelaxedPrecision
25               OpDecorate %30 RelaxedPrecision
26               OpDecorate %38 RelaxedPrecision
27               OpDecorate %40 RelaxedPrecision
28               OpDecorate %42 RelaxedPrecision
29               OpDecorate %43 RelaxedPrecision
30      %float = OpTypeFloat 32
31    %v4float = OpTypeVector %float 4
32%_ptr_Output_v4float = OpTypePointer Output %v4float
33%sk_FragColor = OpVariable %_ptr_Output_v4float Output
34%_UniformBuffer = OpTypeStruct %v4float %v4float
35%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
36          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
37       %void = OpTypeVoid
38         %12 = OpTypeFunction %void
39    %float_0 = OpConstant %float 0
40    %v2float = OpTypeVector %float 2
41         %16 = OpConstantComposite %v2float %float_0 %float_0
42%_ptr_Function_v2float = OpTypePointer Function %v2float
43         %20 = OpTypeFunction %v4float %_ptr_Function_v2float
44%_ptr_Function_v4float = OpTypePointer Function %v4float
45%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
46        %int = OpTypeInt 32 1
47      %int_0 = OpConstant %int 0
48      %int_1 = OpConstant %int 1
49%_entrypoint_v = OpFunction %void None %12
50         %13 = OpLabel
51         %17 = OpVariable %_ptr_Function_v2float Function
52               OpStore %17 %16
53         %19 = OpFunctionCall %v4float %main %17
54               OpStore %sk_FragColor %19
55               OpReturn
56               OpFunctionEnd
57       %main = OpFunction %v4float None %20
58         %21 = OpFunctionParameter %_ptr_Function_v2float
59         %22 = OpLabel
60      %color = OpVariable %_ptr_Function_v4float Function
61         %25 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
62         %29 = OpLoad %v4float %25
63         %30 = OpCompositeExtract %float %29 1
64         %31 = OpConvertFToS %int %30
65               OpSelectionMerge %32 None
66               OpSwitch %31 %35 0 %33 1 %34
67         %33 = OpLabel
68         %36 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
69         %38 = OpLoad %v4float %36
70               OpStore %color %38
71               OpBranch %32
72         %34 = OpLabel
73         %39 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
74         %40 = OpLoad %v4float %39
75               OpStore %color %40
76               OpBranch %32
77         %35 = OpLabel
78         %41 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
79         %42 = OpLoad %v4float %41
80               OpStore %color %42
81               OpBranch %32
82         %32 = OpLabel
83         %43 = OpLoad %v4float %color
84               OpReturnValue %43
85               OpFunctionEnd
86