xref: /aosp_15_r20/external/skia/tests/sksl/shared/TernaryTrueFalseOptimization.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 %ok "ok"
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 %34 RelaxedPrecision
24               OpDecorate %35 RelaxedPrecision
25               OpDecorate %42 RelaxedPrecision
26               OpDecorate %43 RelaxedPrecision
27               OpDecorate %49 RelaxedPrecision
28               OpDecorate %50 RelaxedPrecision
29               OpDecorate %53 RelaxedPrecision
30               OpDecorate %54 RelaxedPrecision
31               OpDecorate %62 RelaxedPrecision
32               OpDecorate %63 RelaxedPrecision
33               OpDecorate %65 RelaxedPrecision
34               OpDecorate %66 RelaxedPrecision
35               OpDecorate %73 RelaxedPrecision
36               OpDecorate %74 RelaxedPrecision
37               OpDecorate %76 RelaxedPrecision
38               OpDecorate %77 RelaxedPrecision
39               OpDecorate %83 RelaxedPrecision
40               OpDecorate %84 RelaxedPrecision
41               OpDecorate %86 RelaxedPrecision
42               OpDecorate %87 RelaxedPrecision
43               OpDecorate %94 RelaxedPrecision
44               OpDecorate %95 RelaxedPrecision
45               OpDecorate %97 RelaxedPrecision
46               OpDecorate %98 RelaxedPrecision
47               OpDecorate %104 RelaxedPrecision
48               OpDecorate %105 RelaxedPrecision
49               OpDecorate %107 RelaxedPrecision
50               OpDecorate %108 RelaxedPrecision
51               OpDecorate %118 RelaxedPrecision
52               OpDecorate %120 RelaxedPrecision
53               OpDecorate %121 RelaxedPrecision
54      %float = OpTypeFloat 32
55    %v4float = OpTypeVector %float 4
56%_ptr_Output_v4float = OpTypePointer Output %v4float
57%sk_FragColor = OpVariable %_ptr_Output_v4float Output
58%_UniformBuffer = OpTypeStruct %v4float %v4float
59%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
60          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
61       %void = OpTypeVoid
62         %12 = OpTypeFunction %void
63    %float_0 = OpConstant %float 0
64    %v2float = OpTypeVector %float 2
65         %16 = OpConstantComposite %v2float %float_0 %float_0
66%_ptr_Function_v2float = OpTypePointer Function %v2float
67         %20 = OpTypeFunction %v4float %_ptr_Function_v2float
68       %bool = OpTypeBool
69%_ptr_Function_bool = OpTypePointer Function %bool
70       %true = OpConstantTrue %bool
71      %false = OpConstantFalse %bool
72%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
73        %int = OpTypeInt 32 1
74      %int_0 = OpConstant %int 0
75    %float_1 = OpConstant %float 1
76      %int_1 = OpConstant %int 1
77     %v2bool = OpTypeVector %bool 2
78%_ptr_Function_v4float = OpTypePointer Function %v4float
79%_entrypoint_v = OpFunction %void None %12
80         %13 = OpLabel
81         %17 = OpVariable %_ptr_Function_v2float Function
82               OpStore %17 %16
83         %19 = OpFunctionCall %v4float %main %17
84               OpStore %sk_FragColor %19
85               OpReturn
86               OpFunctionEnd
87       %main = OpFunction %v4float None %20
88         %21 = OpFunctionParameter %_ptr_Function_v2float
89         %22 = OpLabel
90         %ok = OpVariable %_ptr_Function_bool Function
91        %112 = OpVariable %_ptr_Function_v4float Function
92               OpStore %ok %true
93               OpSelectionMerge %29 None
94               OpBranchConditional %true %28 %29
95         %28 = OpLabel
96         %30 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
97         %34 = OpLoad %v4float %30
98         %35 = OpCompositeExtract %float %34 1
99         %37 = OpFOrdEqual %bool %35 %float_1
100               OpBranch %29
101         %29 = OpLabel
102         %38 = OpPhi %bool %false %22 %37 %28
103               OpStore %ok %38
104               OpSelectionMerge %40 None
105               OpBranchConditional %38 %39 %40
106         %39 = OpLabel
107         %41 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
108         %42 = OpLoad %v4float %41
109         %43 = OpCompositeExtract %float %42 0
110         %44 = OpFUnordNotEqual %bool %43 %float_1
111               OpBranch %40
112         %40 = OpLabel
113         %45 = OpPhi %bool %false %29 %44 %39
114               OpStore %ok %45
115               OpSelectionMerge %47 None
116               OpBranchConditional %45 %46 %47
117         %46 = OpLabel
118         %48 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
119         %49 = OpLoad %v4float %48
120         %50 = OpVectorShuffle %v2float %49 %49 1 0
121         %51 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
122         %53 = OpLoad %v4float %51
123         %54 = OpVectorShuffle %v2float %53 %53 0 1
124         %55 = OpFOrdEqual %v2bool %50 %54
125         %57 = OpAll %bool %55
126               OpBranch %47
127         %47 = OpLabel
128         %58 = OpPhi %bool %false %40 %57 %46
129               OpStore %ok %58
130               OpSelectionMerge %60 None
131               OpBranchConditional %58 %59 %60
132         %59 = OpLabel
133         %61 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
134         %62 = OpLoad %v4float %61
135         %63 = OpVectorShuffle %v2float %62 %62 1 0
136         %64 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
137         %65 = OpLoad %v4float %64
138         %66 = OpVectorShuffle %v2float %65 %65 0 1
139         %67 = OpFOrdEqual %v2bool %63 %66
140         %68 = OpAll %bool %67
141               OpBranch %60
142         %60 = OpLabel
143         %69 = OpPhi %bool %false %47 %68 %59
144               OpStore %ok %69
145               OpSelectionMerge %71 None
146               OpBranchConditional %69 %70 %71
147         %70 = OpLabel
148         %72 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
149         %73 = OpLoad %v4float %72
150         %74 = OpVectorShuffle %v2float %73 %73 1 0
151         %75 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
152         %76 = OpLoad %v4float %75
153         %77 = OpVectorShuffle %v2float %76 %76 0 1
154         %78 = OpFOrdEqual %v2bool %74 %77
155         %79 = OpAll %bool %78
156               OpSelectionMerge %81 None
157               OpBranchConditional %79 %81 %80
158         %80 = OpLabel
159         %82 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
160         %83 = OpLoad %v4float %82
161         %84 = OpCompositeExtract %float %83 3
162         %85 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
163         %86 = OpLoad %v4float %85
164         %87 = OpCompositeExtract %float %86 3
165         %88 = OpFUnordNotEqual %bool %84 %87
166               OpBranch %81
167         %81 = OpLabel
168         %89 = OpPhi %bool %true %70 %88 %80
169               OpBranch %71
170         %71 = OpLabel
171         %90 = OpPhi %bool %false %60 %89 %81
172               OpStore %ok %90
173               OpSelectionMerge %92 None
174               OpBranchConditional %90 %91 %92
175         %91 = OpLabel
176         %93 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
177         %94 = OpLoad %v4float %93
178         %95 = OpVectorShuffle %v2float %94 %94 1 0
179         %96 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
180         %97 = OpLoad %v4float %96
181         %98 = OpVectorShuffle %v2float %97 %97 0 1
182         %99 = OpFUnordNotEqual %v2bool %95 %98
183        %100 = OpAny %bool %99
184               OpSelectionMerge %102 None
185               OpBranchConditional %100 %101 %102
186        %101 = OpLabel
187        %103 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
188        %104 = OpLoad %v4float %103
189        %105 = OpCompositeExtract %float %104 3
190        %106 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
191        %107 = OpLoad %v4float %106
192        %108 = OpCompositeExtract %float %107 3
193        %109 = OpFOrdEqual %bool %105 %108
194               OpBranch %102
195        %102 = OpLabel
196        %110 = OpPhi %bool %false %91 %109 %101
197               OpBranch %92
198         %92 = OpLabel
199        %111 = OpPhi %bool %false %71 %110 %102
200               OpStore %ok %111
201               OpSelectionMerge %116 None
202               OpBranchConditional %111 %114 %115
203        %114 = OpLabel
204        %117 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
205        %118 = OpLoad %v4float %117
206               OpStore %112 %118
207               OpBranch %116
208        %115 = OpLabel
209        %119 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
210        %120 = OpLoad %v4float %119
211               OpStore %112 %120
212               OpBranch %116
213        %116 = OpLabel
214        %121 = OpLoad %v4float %112
215               OpReturnValue %121
216               OpFunctionEnd
217