xref: /aosp_15_r20/external/skia/tests/sksl/shared/SwizzleAsLValue.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 %scalar "scalar"
13               OpName %array "array"
14               OpDecorate %sk_FragColor RelaxedPrecision
15               OpDecorate %sk_FragColor Location 0
16               OpDecorate %sk_FragColor Index 0
17               OpMemberDecorate %_UniformBuffer 0 Offset 0
18               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
19               OpMemberDecorate %_UniformBuffer 1 Offset 16
20               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
21               OpDecorate %_UniformBuffer Block
22               OpDecorate %7 Binding 0
23               OpDecorate %7 DescriptorSet 0
24               OpDecorate %_arr_v4float_int_1 ArrayStride 16
25               OpDecorate %33 RelaxedPrecision
26               OpDecorate %77 RelaxedPrecision
27               OpDecorate %132 RelaxedPrecision
28               OpDecorate %134 RelaxedPrecision
29               OpDecorate %135 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        %int = OpTypeInt 32 1
46      %int_1 = OpConstant %int 1
47%_arr_v4float_int_1 = OpTypeArray %v4float %int_1
48%_ptr_Function__arr_v4float_int_1 = OpTypePointer Function %_arr_v4float_int_1
49%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
50      %int_0 = OpConstant %int 0
51  %float_0_5 = OpConstant %float 0.5
52    %float_2 = OpConstant %float 2
53%_ptr_Function_float = OpTypePointer Function %float
54      %int_3 = OpConstant %int 3
55    %float_4 = OpConstant %float 4
56    %v3float = OpTypeVector %float 3
57         %47 = OpConstantComposite %v3float %float_0_5 %float_0 %float_0
58         %48 = OpConstantComposite %v3float %float_0 %float_0_5 %float_0
59         %49 = OpConstantComposite %v3float %float_0 %float_0 %float_0_5
60%mat3v3float = OpTypeMatrix %v3float 3
61         %51 = OpConstantComposite %mat3v3float %47 %48 %49
62 %float_0_25 = OpConstant %float 0.25
63 %float_0_75 = OpConstant %float 0.75
64         %59 = OpConstantComposite %v4float %float_0_25 %float_0 %float_0 %float_0_75
65    %float_1 = OpConstant %float 1
66       %bool = OpTypeBool
67      %false = OpConstantFalse %bool
68        %116 = OpConstantComposite %v4float %float_1 %float_1 %float_0_25 %float_1
69     %v4bool = OpTypeVector %bool 4
70%_entrypoint_v = OpFunction %void None %12
71         %13 = OpLabel
72         %17 = OpVariable %_ptr_Function_v2float Function
73               OpStore %17 %16
74         %19 = OpFunctionCall %v4float %main %17
75               OpStore %sk_FragColor %19
76               OpReturn
77               OpFunctionEnd
78       %main = OpFunction %v4float None %20
79         %21 = OpFunctionParameter %_ptr_Function_v2float
80         %22 = OpLabel
81     %scalar = OpVariable %_ptr_Function_v4float Function
82      %array = OpVariable %_ptr_Function__arr_v4float_int_1 Function
83         %69 = OpVariable %_ptr_Function_float Function
84        %105 = OpVariable %_ptr_Function_float Function
85        %127 = OpVariable %_ptr_Function_v4float Function
86         %30 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
87         %33 = OpLoad %v4float %30
88         %35 = OpVectorTimesScalar %v4float %33 %float_0_5
89               OpStore %scalar %35
90         %37 = OpAccessChain %_ptr_Function_float %scalar %int_3
91               OpStore %37 %float_2
92         %40 = OpAccessChain %_ptr_Function_float %scalar %int_1
93         %41 = OpLoad %float %40
94         %43 = OpFMul %float %41 %float_4
95               OpStore %40 %43
96         %44 = OpLoad %v4float %scalar
97         %45 = OpVectorShuffle %v3float %44 %44 1 2 3
98         %52 = OpVectorTimesMatrix %v3float %45 %51
99         %53 = OpLoad %v4float %scalar
100         %54 = OpVectorShuffle %v4float %53 %52 0 4 5 6
101               OpStore %scalar %54
102         %55 = OpLoad %v4float %scalar
103         %56 = OpVectorShuffle %v4float %55 %55 2 1 3 0
104         %60 = OpFAdd %v4float %56 %59
105         %61 = OpLoad %v4float %scalar
106         %62 = OpVectorShuffle %v4float %61 %60 7 5 4 6
107               OpStore %scalar %62
108         %63 = OpAccessChain %_ptr_Function_float %scalar %int_0
109         %64 = OpLoad %float %63
110         %65 = OpCompositeExtract %float %62 3
111         %67 = OpFOrdLessThanEqual %bool %65 %float_1
112               OpSelectionMerge %72 None
113               OpBranchConditional %67 %70 %71
114         %70 = OpLabel
115         %73 = OpCompositeExtract %float %62 2
116               OpStore %69 %73
117               OpBranch %72
118         %71 = OpLabel
119               OpStore %69 %float_0
120               OpBranch %72
121         %72 = OpLabel
122         %74 = OpLoad %float %69
123         %75 = OpFAdd %float %64 %74
124               OpStore %63 %75
125         %76 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
126         %77 = OpLoad %v4float %76
127         %78 = OpVectorTimesScalar %v4float %77 %float_0_5
128         %79 = OpAccessChain %_ptr_Function_v4float %array %int_0
129               OpStore %79 %78
130         %80 = OpAccessChain %_ptr_Function_v4float %array %int_0
131         %81 = OpAccessChain %_ptr_Function_float %80 %int_3
132               OpStore %81 %float_2
133         %82 = OpAccessChain %_ptr_Function_v4float %array %int_0
134         %83 = OpAccessChain %_ptr_Function_float %82 %int_1
135         %84 = OpLoad %float %83
136         %85 = OpFMul %float %84 %float_4
137               OpStore %83 %85
138         %86 = OpAccessChain %_ptr_Function_v4float %array %int_0
139         %87 = OpLoad %v4float %86
140         %88 = OpVectorShuffle %v3float %87 %87 1 2 3
141         %89 = OpVectorTimesMatrix %v3float %88 %51
142         %90 = OpLoad %v4float %86
143         %91 = OpVectorShuffle %v4float %90 %89 0 4 5 6
144               OpStore %86 %91
145         %92 = OpAccessChain %_ptr_Function_v4float %array %int_0
146         %93 = OpLoad %v4float %92
147         %94 = OpVectorShuffle %v4float %93 %93 2 1 3 0
148         %95 = OpFAdd %v4float %94 %59
149         %96 = OpLoad %v4float %92
150         %97 = OpVectorShuffle %v4float %96 %95 7 5 4 6
151               OpStore %92 %97
152         %98 = OpAccessChain %_ptr_Function_v4float %array %int_0
153         %99 = OpAccessChain %_ptr_Function_float %98 %int_0
154        %100 = OpLoad %float %99
155        %101 = OpAccessChain %_ptr_Function_v4float %array %int_0
156        %102 = OpLoad %v4float %101
157        %103 = OpCompositeExtract %float %102 3
158        %104 = OpFOrdLessThanEqual %bool %103 %float_1
159               OpSelectionMerge %108 None
160               OpBranchConditional %104 %106 %107
161        %106 = OpLabel
162        %109 = OpAccessChain %_ptr_Function_v4float %array %int_0
163        %110 = OpLoad %v4float %109
164        %111 = OpCompositeExtract %float %110 2
165               OpStore %105 %111
166               OpBranch %108
167        %107 = OpLabel
168               OpStore %105 %float_0
169               OpBranch %108
170        %108 = OpLabel
171        %112 = OpLoad %float %105
172        %113 = OpFAdd %float %100 %112
173               OpStore %99 %113
174        %115 = OpLoad %v4float %scalar
175        %117 = OpFOrdEqual %v4bool %115 %116
176        %119 = OpAll %bool %117
177               OpSelectionMerge %121 None
178               OpBranchConditional %119 %120 %121
179        %120 = OpLabel
180        %122 = OpAccessChain %_ptr_Function_v4float %array %int_0
181        %123 = OpLoad %v4float %122
182        %124 = OpFOrdEqual %v4bool %123 %116
183        %125 = OpAll %bool %124
184               OpBranch %121
185        %121 = OpLabel
186        %126 = OpPhi %bool %false %108 %125 %120
187               OpSelectionMerge %130 None
188               OpBranchConditional %126 %128 %129
189        %128 = OpLabel
190        %131 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
191        %132 = OpLoad %v4float %131
192               OpStore %127 %132
193               OpBranch %130
194        %129 = OpLabel
195        %133 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
196        %134 = OpLoad %v4float %133
197               OpStore %127 %134
198               OpBranch %130
199        %130 = OpLabel
200        %135 = OpLoad %v4float %127
201               OpReturnValue %135
202               OpFunctionEnd
203