xref: /aosp_15_r20/external/skia/tests/sksl/shared/SwizzleByConstantIndex.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 "testInputs"
9               OpMemberName %_UniformBuffer 1 "colorGreen"
10               OpMemberName %_UniformBuffer 2 "colorRed"
11               OpName %_entrypoint_v "_entrypoint_v"
12               OpName %main "main"
13               OpName %_0_v "_0_v"
14               OpName %_1_x "_1_x"
15               OpName %_2_y "_2_y"
16               OpName %_3_z "_3_z"
17               OpName %_4_w "_4_w"
18               OpName %a "a"
19               OpName %_9_x "_9_x"
20               OpName %_10_y "_10_y"
21               OpName %_11_z "_11_z"
22               OpName %_12_w "_12_w"
23               OpName %b "b"
24               OpName %c "c"
25               OpDecorate %sk_FragColor RelaxedPrecision
26               OpDecorate %sk_FragColor Location 0
27               OpDecorate %sk_FragColor Index 0
28               OpMemberDecorate %_UniformBuffer 0 Offset 0
29               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
30               OpMemberDecorate %_UniformBuffer 1 Offset 16
31               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
32               OpMemberDecorate %_UniformBuffer 2 Offset 32
33               OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision
34               OpDecorate %_UniformBuffer Block
35               OpDecorate %7 Binding 0
36               OpDecorate %7 DescriptorSet 0
37               OpDecorate %_0_v RelaxedPrecision
38               OpDecorate %29 RelaxedPrecision
39               OpDecorate %_1_x RelaxedPrecision
40               OpDecorate %32 RelaxedPrecision
41               OpDecorate %_2_y RelaxedPrecision
42               OpDecorate %34 RelaxedPrecision
43               OpDecorate %_3_z RelaxedPrecision
44               OpDecorate %36 RelaxedPrecision
45               OpDecorate %_4_w RelaxedPrecision
46               OpDecorate %38 RelaxedPrecision
47               OpDecorate %a RelaxedPrecision
48               OpDecorate %40 RelaxedPrecision
49               OpDecorate %_9_x RelaxedPrecision
50               OpDecorate %43 RelaxedPrecision
51               OpDecorate %44 RelaxedPrecision
52               OpDecorate %_10_y RelaxedPrecision
53               OpDecorate %47 RelaxedPrecision
54               OpDecorate %48 RelaxedPrecision
55               OpDecorate %_11_z RelaxedPrecision
56               OpDecorate %51 RelaxedPrecision
57               OpDecorate %52 RelaxedPrecision
58               OpDecorate %_12_w RelaxedPrecision
59               OpDecorate %55 RelaxedPrecision
60               OpDecorate %56 RelaxedPrecision
61               OpDecorate %b RelaxedPrecision
62               OpDecorate %58 RelaxedPrecision
63               OpDecorate %c RelaxedPrecision
64               OpDecorate %88 RelaxedPrecision
65               OpDecorate %91 RelaxedPrecision
66               OpDecorate %92 RelaxedPrecision
67      %float = OpTypeFloat 32
68    %v4float = OpTypeVector %float 4
69%_ptr_Output_v4float = OpTypePointer Output %v4float
70%sk_FragColor = OpVariable %_ptr_Output_v4float Output
71%_UniformBuffer = OpTypeStruct %v4float %v4float %v4float
72%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
73          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
74       %void = OpTypeVoid
75         %12 = OpTypeFunction %void
76    %float_0 = OpConstant %float 0
77    %v2float = OpTypeVector %float 2
78         %16 = OpConstantComposite %v2float %float_0 %float_0
79%_ptr_Function_v2float = OpTypePointer Function %v2float
80         %20 = OpTypeFunction %v4float %_ptr_Function_v2float
81%_ptr_Function_v4float = OpTypePointer Function %v4float
82%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
83        %int = OpTypeInt 32 1
84      %int_0 = OpConstant %int 0
85%_ptr_Function_float = OpTypePointer Function %float
86    %float_1 = OpConstant %float 1
87    %float_2 = OpConstant %float 2
88    %float_3 = OpConstant %float 3
89         %63 = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3
90       %bool = OpTypeBool
91      %false = OpConstantFalse %bool
92%float_n1_25 = OpConstant %float -1.25
93 %float_0_75 = OpConstant %float 0.75
94 %float_2_25 = OpConstant %float 2.25
95         %69 = OpConstantComposite %v4float %float_n1_25 %float_0 %float_0_75 %float_2_25
96     %v4bool = OpTypeVector %bool 4
97       %true = OpConstantTrue %bool
98      %int_1 = OpConstant %int 1
99      %int_2 = OpConstant %int 2
100%_entrypoint_v = OpFunction %void None %12
101         %13 = OpLabel
102         %17 = OpVariable %_ptr_Function_v2float Function
103               OpStore %17 %16
104         %19 = OpFunctionCall %v4float %main %17
105               OpStore %sk_FragColor %19
106               OpReturn
107               OpFunctionEnd
108       %main = OpFunction %v4float None %20
109         %21 = OpFunctionParameter %_ptr_Function_v2float
110         %22 = OpLabel
111       %_0_v = OpVariable %_ptr_Function_v4float Function
112       %_1_x = OpVariable %_ptr_Function_float Function
113       %_2_y = OpVariable %_ptr_Function_float Function
114       %_3_z = OpVariable %_ptr_Function_float Function
115       %_4_w = OpVariable %_ptr_Function_float Function
116          %a = OpVariable %_ptr_Function_v4float Function
117       %_9_x = OpVariable %_ptr_Function_float Function
118      %_10_y = OpVariable %_ptr_Function_float Function
119      %_11_z = OpVariable %_ptr_Function_float Function
120      %_12_w = OpVariable %_ptr_Function_float Function
121          %b = OpVariable %_ptr_Function_v4float Function
122          %c = OpVariable %_ptr_Function_v4float Function
123         %82 = OpVariable %_ptr_Function_v4float Function
124         %25 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
125         %29 = OpLoad %v4float %25
126               OpStore %_0_v %29
127         %32 = OpCompositeExtract %float %29 0
128               OpStore %_1_x %32
129         %34 = OpCompositeExtract %float %29 1
130               OpStore %_2_y %34
131         %36 = OpCompositeExtract %float %29 2
132               OpStore %_3_z %36
133         %38 = OpCompositeExtract %float %29 3
134               OpStore %_4_w %38
135         %40 = OpCompositeConstruct %v4float %32 %34 %36 %38
136               OpStore %a %40
137         %42 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
138         %43 = OpLoad %v4float %42
139         %44 = OpCompositeExtract %float %43 0
140               OpStore %_9_x %44
141         %46 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
142         %47 = OpLoad %v4float %46
143         %48 = OpCompositeExtract %float %47 1
144               OpStore %_10_y %48
145         %50 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
146         %51 = OpLoad %v4float %50
147         %52 = OpCompositeExtract %float %51 2
148               OpStore %_11_z %52
149         %54 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
150         %55 = OpLoad %v4float %54
151         %56 = OpCompositeExtract %float %55 3
152               OpStore %_12_w %56
153         %58 = OpCompositeConstruct %v4float %44 %48 %52 %56
154               OpStore %b %58
155               OpStore %c %63
156         %70 = OpFOrdEqual %v4bool %40 %69
157         %72 = OpAll %bool %70
158               OpSelectionMerge %74 None
159               OpBranchConditional %72 %73 %74
160         %73 = OpLabel
161         %75 = OpFOrdEqual %v4bool %58 %69
162         %76 = OpAll %bool %75
163               OpBranch %74
164         %74 = OpLabel
165         %77 = OpPhi %bool %false %22 %76 %73
166               OpSelectionMerge %79 None
167               OpBranchConditional %77 %78 %79
168         %78 = OpLabel
169               OpBranch %79
170         %79 = OpLabel
171         %81 = OpPhi %bool %false %74 %true %78
172               OpSelectionMerge %85 None
173               OpBranchConditional %81 %83 %84
174         %83 = OpLabel
175         %86 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
176         %88 = OpLoad %v4float %86
177               OpStore %82 %88
178               OpBranch %85
179         %84 = OpLabel
180         %89 = OpAccessChain %_ptr_Uniform_v4float %7 %int_2
181         %91 = OpLoad %v4float %89
182               OpStore %82 %91
183               OpBranch %85
184         %85 = OpLabel
185         %92 = OpLoad %v4float %82
186               OpReturnValue %92
187               OpFunctionEnd
188