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