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