xref: /aosp_15_r20/external/skia/tests/sksl/shared/OutParamsDoubleSwizzle.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 %swizzle_lvalue_h2hhh2h "swizzle_lvalue_h2hhh2h"
12               OpName %func_vh4 "func_vh4"
13               OpName %t "t"
14               OpName %main "main"
15               OpName %result "result"
16               OpDecorate %sk_FragColor RelaxedPrecision
17               OpDecorate %sk_FragColor Location 0
18               OpDecorate %sk_FragColor Index 0
19               OpMemberDecorate %_UniformBuffer 0 Offset 0
20               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
21               OpMemberDecorate %_UniformBuffer 1 Offset 16
22               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
23               OpDecorate %_UniformBuffer Block
24               OpDecorate %9 Binding 0
25               OpDecorate %9 DescriptorSet 0
26               OpDecorate %29 RelaxedPrecision
27               OpDecorate %30 RelaxedPrecision
28               OpDecorate %31 RelaxedPrecision
29               OpDecorate %32 RelaxedPrecision
30               OpDecorate %33 RelaxedPrecision
31               OpDecorate %34 RelaxedPrecision
32               OpDecorate %35 RelaxedPrecision
33               OpDecorate %36 RelaxedPrecision
34               OpDecorate %t RelaxedPrecision
35               OpDecorate %46 RelaxedPrecision
36               OpDecorate %47 RelaxedPrecision
37               OpDecorate %48 RelaxedPrecision
38               OpDecorate %52 RelaxedPrecision
39               OpDecorate %53 RelaxedPrecision
40               OpDecorate %54 RelaxedPrecision
41               OpDecorate %55 RelaxedPrecision
42               OpDecorate %56 RelaxedPrecision
43               OpDecorate %result RelaxedPrecision
44               OpDecorate %63 RelaxedPrecision
45               OpDecorate %65 RelaxedPrecision
46               OpDecorate %79 RelaxedPrecision
47               OpDecorate %82 RelaxedPrecision
48               OpDecorate %83 RelaxedPrecision
49      %float = OpTypeFloat 32
50    %v4float = OpTypeVector %float 4
51%_ptr_Output_v4float = OpTypePointer Output %v4float
52%sk_FragColor = OpVariable %_ptr_Output_v4float Output
53%_UniformBuffer = OpTypeStruct %v4float %v4float
54%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
55          %9 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
56       %void = OpTypeVoid
57         %14 = OpTypeFunction %void
58    %float_0 = OpConstant %float 0
59    %v2float = OpTypeVector %float 2
60         %18 = OpConstantComposite %v2float %float_0 %float_0
61%_ptr_Function_v2float = OpTypePointer Function %v2float
62%_ptr_Function_float = OpTypePointer Function %float
63         %23 = OpTypeFunction %v2float %_ptr_Function_float %_ptr_Function_float %_ptr_Function_v2float %_ptr_Function_float
64%_ptr_Function_v4float = OpTypePointer Function %v4float
65         %38 = OpTypeFunction %void %_ptr_Function_v4float
66    %float_1 = OpConstant %float 1
67    %float_2 = OpConstant %float 2
68    %float_5 = OpConstant %float 5
69         %57 = OpTypeFunction %v4float %_ptr_Function_v2float
70    %float_3 = OpConstant %float 3
71         %62 = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3
72         %66 = OpConstantComposite %v4float %float_2 %float_3 %float_0 %float_5
73       %bool = OpTypeBool
74     %v4bool = OpTypeVector %bool 4
75%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
76        %int = OpTypeInt 32 1
77      %int_0 = OpConstant %int 0
78      %int_1 = OpConstant %int 1
79%_entrypoint_v = OpFunction %void None %14
80         %15 = OpLabel
81         %19 = OpVariable %_ptr_Function_v2float Function
82               OpStore %19 %18
83         %21 = OpFunctionCall %v4float %main %19
84               OpStore %sk_FragColor %21
85               OpReturn
86               OpFunctionEnd
87%swizzle_lvalue_h2hhh2h = OpFunction %v2float None %23
88         %24 = OpFunctionParameter %_ptr_Function_float
89         %25 = OpFunctionParameter %_ptr_Function_float
90         %26 = OpFunctionParameter %_ptr_Function_v2float
91         %27 = OpFunctionParameter %_ptr_Function_float
92         %28 = OpLabel
93         %29 = OpLoad %v2float %26
94         %30 = OpLoad %v2float %26
95         %31 = OpVectorShuffle %v2float %30 %29 3 2
96               OpStore %26 %31
97         %32 = OpLoad %float %24
98         %33 = OpLoad %float %25
99         %34 = OpFAdd %float %32 %33
100         %35 = OpLoad %float %27
101         %36 = OpCompositeConstruct %v2float %34 %35
102               OpReturnValue %36
103               OpFunctionEnd
104   %func_vh4 = OpFunction %void None %38
105         %39 = OpFunctionParameter %_ptr_Function_v4float
106         %40 = OpLabel
107          %t = OpVariable %_ptr_Function_v2float Function
108         %43 = OpVariable %_ptr_Function_float Function
109         %45 = OpVariable %_ptr_Function_float Function
110         %48 = OpVariable %_ptr_Function_v2float Function
111         %50 = OpVariable %_ptr_Function_float Function
112               OpStore %43 %float_1
113               OpStore %45 %float_2
114         %46 = OpLoad %v4float %39
115         %47 = OpVectorShuffle %v2float %46 %46 0 2
116               OpStore %48 %47
117               OpStore %50 %float_5
118         %51 = OpFunctionCall %v2float %swizzle_lvalue_h2hhh2h %43 %45 %48 %50
119         %52 = OpLoad %v2float %48
120         %53 = OpLoad %v4float %39
121         %54 = OpVectorShuffle %v4float %53 %52 4 1 5 3
122               OpStore %39 %54
123               OpStore %t %51
124         %55 = OpLoad %v4float %39
125         %56 = OpVectorShuffle %v4float %55 %51 0 4 2 5
126               OpStore %39 %56
127               OpReturn
128               OpFunctionEnd
129       %main = OpFunction %v4float None %57
130         %58 = OpFunctionParameter %_ptr_Function_v2float
131         %59 = OpLabel
132     %result = OpVariable %_ptr_Function_v4float Function
133         %63 = OpVariable %_ptr_Function_v4float Function
134         %71 = OpVariable %_ptr_Function_v4float Function
135               OpStore %result %62
136               OpStore %63 %62
137         %64 = OpFunctionCall %void %func_vh4 %63
138         %65 = OpLoad %v4float %63
139               OpStore %result %65
140         %67 = OpFOrdEqual %v4bool %65 %66
141         %70 = OpAll %bool %67
142               OpSelectionMerge %74 None
143               OpBranchConditional %70 %72 %73
144         %72 = OpLabel
145         %75 = OpAccessChain %_ptr_Uniform_v4float %9 %int_0
146         %79 = OpLoad %v4float %75
147               OpStore %71 %79
148               OpBranch %74
149         %73 = OpLabel
150         %80 = OpAccessChain %_ptr_Uniform_v4float %9 %int_1
151         %82 = OpLoad %v4float %80
152               OpStore %71 %82
153               OpBranch %74
154         %74 = OpLabel
155         %83 = OpLoad %v4float %71
156               OpReturnValue %83
157               OpFunctionEnd
158