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