4 "DP4 o[HPOS].x, c[0], v[OPOS];\n"
5 "DP4 o[HPOS].y, c[1], v[OPOS];\n"
6 "DP4 o[HPOS].z, c[2], v[OPOS];\n"
7 "DP4 o[HPOS].w, c[3], v[OPOS];\n"
8 "MOV o[TEX0].xy, v[TEX0];\n"
9 // "ADD o[TEX1], v[TEX0].xyxy, c[9];\n"
12 const char *a_arbfp1_test
=
14 "OPTION ARB_precision_hint_fastest;\n"
15 "TEX result.color, fragment.texcoord[1].zwzw, texture[0], 2D;\n"
18 const char *a_arbfp1
=
20 "OPTION ARB_precision_hint_fastest;\n"
21 /*"# cgc version 3.1.0013, build date Apr 18 2012\n"
22 "# command line args: -profile arbfp1 -O3 -fastmath -fastprecision\n"
23 "# source file: fxaa_pp.cg\n"
24 "#vendor NVIDIA Corporation\n"
28 "#semantic fxaa_pp.fxaaQualityRcpFrame\n"
29 "#semantic fxaa_pp.fxaaQualitySubpix\n"
30 "#semantic fxaa_pp.fxaaQualityEdgeThreshold\n"
31 "#semantic fxaa_pp.fxaaQualityEdgeThresholdMin\n"
32 "#semantic fxaa_pp.nlTex0 : TEX0\n"
33 "#var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1\n"
34 "#var float2 fxaaQualityRcpFrame : : c[0] : 2 : 1\n"
35 "#var float fxaaQualitySubpix : : c[1] : 3 : 1\n"
36 "#var float fxaaQualityEdgeThreshold : : c[2] : 4 : 1\n"
37 "#var float fxaaQualityEdgeThresholdMin : : c[3] : 5 : 1\n"
38 "#var sampler2D nlTex0 : TEX0 : texunit 0 : 6 : 1\n"
39 "#var float4 oCol : $vout.COLOR : COL : 7 : 1\n"
40 "#const c[4] = 0 -1 1 -2\n"
41 "#const c[5] = 2 0.5 0.25 1.5\n"
42 "#const c[6] = 4 12 0.083333336 3\n"*/
43 "PARAM c[7] = { program.env[0..3],\n"
44 " { 0, -1, 1, -2 },\n"
45 " { 2, 0.5, 0.25, 1.5 },\n"
46 " { 4, 12, 0.083333336, 3 } };\n"
58 "MAD R2.zw, R3.xyyz, c[0].xyxy, fragment.texcoord[0].xyxy;\n"
59 "MAD R0.xy, R3, c[0], fragment.texcoord[0];\n"
60 "MAD R1.xy, R3.zyzw, c[0], fragment.texcoord[0];\n"
61 "TEX R5.y, R1, texture[0], 2D;\n"
62 "MAD R1.xy, R3.zxzw, c[0], fragment.texcoord[0];\n"
63 "ADD R0.zw, fragment.texcoord[0].xyxy, -c[0].xyxy;\n"
64 "TEX R4.y, R0.zwzw, texture[0], 2D;\n"
65 "TEX R6.y, R2.zwzw, texture[0], 2D;\n"
66 "TEX R8, fragment.texcoord[0], texture[0], 2D;\n"
67 "TEX R1.y, R1, texture[0], 2D;\n"
68 "TEX R0.y, R0, texture[0], 2D;\n"
69 "ADD R0.z, R4.y, R5.y;\n"
70 "MAD R1.z, R0.y, c[4].w, R0;\n"
71 "MAD R0.zw, R3.xyyx, c[0].xyxy, fragment.texcoord[0].xyxy;\n"
72 "TEX R2.y, R0.zwzw, texture[0], 2D;\n"
73 "ADD R0.x, R2.y, R1.y;\n"
75 "ADD R1.zw, fragment.texcoord[0].xyxy, c[0].xyxy;\n"
76 "TEX R7.y, R1.zwzw, texture[0], 2D;\n"
77 "MAD R0.z, R8.y, c[4].w, R0.x;\n"
79 "MAD R2.x, R0.z, c[5], R0.w;\n"
80 "MAD R0.zw, R3.xyxz, c[0].xyxy, fragment.texcoord[0].xyxy;\n"
81 "TEX R3.y, R0.zwzw, texture[0], 2D;\n"
82 "ADD R0.z, R0.y, R3.y;\n"
83 "ADD R1.x, R6.y, R7.y;\n"
84 "MAD R0.w, R3.y, c[4], R1.x;\n"
85 "MAD R1.x, R8.y, c[4].w, R0.z;\n"
87 "ADD R2.x, R0.w, R2;\n"
88 "ADD R2.w, R4.y, R6.y;\n"
89 "ADD R0.w, R5.y, R7.y;\n"
91 "MAD R1.x, R1.y, c[4].w, R0.w;\n"
93 "MAD R1.x, R2.y, c[4].w, R2.w;\n"
94 "MAD R1.z, R1, c[5].x, R1.w;\n"
96 "ADD R1.x, R1, R1.z;\n"
98 "MAX R1.x, R3.y, R8.y;\n"
99 "MAX R1.z, R1.y, R1.x;\n"
100 "MAX R1.x, R0.y, R2.y;\n"
101 "MAX R1.x, R1, R1.z;\n"
102 "MIN R1.z, R3.y, R8.y;\n"
103 "MIN R1.w, R1.y, R1.z;\n"
104 "MIN R1.z, R0.y, R2.y;\n"
105 "MIN R1.z, R1, R1.w;\n"
106 "MUL R2.x, R1, c[2];\n"
107 "ADD R3.z, R1.x, -R1;\n"
109 "MAX R1.w, R2.x, c[3].x;\n"
110 "ADD R2.z, R3, -R1.w;\n"
111 "CMP R2.x, R2.z, c[4], c[4].z;\n"
112 "CMP R1.x, -R3.w, c[4], c[4].z;\n"
113 "MUL R3.w, R2.x, R1.x;\n"
114 "CMP R1.z, -R3.w, R1.y, R3.y;\n"
115 "ADD R1.y, -R8, R1.z;\n"
116 "CMP R1.w, -R3, R2.y, R0.y;\n"
117 "ADD R0.y, -R8, R1.w;\n"
118 "MUL R4.x, R2, R4;\n"
119 "CMP R3.y, -R3.w, c[0], R3.x;\n"
122 "SGE R0.y, R4.z, R4.w;\n"
123 "MUL R1.y, R2.x, R0;\n"
125 "CMP R4.y, -R0, c[4].x, c[4].z;\n"
127 "CMP R0.y, -R0, c[4].x, c[4].z;\n"
128 "MUL R1.x, R2, R0.y;\n"
129 "CMP R2.y, -R4.x, c[0], c[0].x;\n"
130 "CMP R2.y, -R1, -R2, R2;\n"
131 "MAD R1.y, R2, c[5], fragment.texcoord[0];\n"
132 "CMP R5.z, -R4.x, R1.y, fragment.texcoord[0].y;\n"
133 "ADD R5.y, R5.z, -R3;\n"
134 "MAD R0.y, R2, c[5], fragment.texcoord[0].x;\n"
135 "CMP R3.x, -R1, c[0], R3;\n"
136 "CMP R6.x, -R3.w, R0.y, fragment.texcoord[0];\n"
137 "ADD R5.w, R5.z, R3.y;\n"
138 "ADD R1.x, R6, -R3;\n"
140 "TEX R0.y, R1, texture[0], 2D;\n"
141 "MUL R1.y, R2.x, R4;\n"
142 "ADD R0.x, R0.z, R0;\n"
143 "ADD R0.w, R2, R0;\n"
144 "MAD R0.z, R0.x, c[5].x, R0.w;\n"
145 "ADD R1.w, R8.y, R1;\n"
146 "ADD R1.z, R8.y, R1;\n"
147 "CMP R4.y, -R1, R1.z, R1.w;\n"
148 "ADD R1.z, R6.x, R3.x;\n"
149 "MAD R5.x, -R4.y, c[5].y, R0.y;\n"
151 "TEX R0.y, R1.zwzw, texture[0], 2D;\n"
152 "MAX R1.w, R4.z, R4;\n"
153 "MAD R1.y, -R4, c[5], R0;\n"
154 "MUL R4.z, R1.w, c[5];\n"
156 "SGE R1.w, R0.y, R4.z;\n"
158 "SGE R0.y, R6, R4.z;\n"
160 "CMP R6.y, -R1.w, c[4].x, c[4].z;\n"
162 "CMP R5.z, -R0.y, c[4].x, c[4];\n"
163 "ADD_SAT R0.y, R5.z, R6;\n"
164 "MUL R4.w, R2.x, R0.y;\n"
165 "MUL R0.y, R2.x, R6;\n"
166 "MAD R1.w, R3.y, c[5], R5;\n"
167 "CMP R6.x, -R0.y, R1.w, R5.w;\n"
168 "MAD R6.z, R3.x, c[5].w, R1;\n"
169 "CMP R1.z, -R0.y, R6, R1;\n"
171 "TEX R0.y, R1.zwzw, texture[0], 2D;\n"
172 "MUL R1.w, R4, R6.y;\n"
173 "CMP R6.y, -R1.w, R0, R1;\n"
174 "MUL R0.y, R2.x, R5.z;\n"
175 "MAD R1.y, -R3, c[5].w, R5;\n"
176 "CMP R5.w, -R0.y, R1.y, R5.y;\n"
177 "MAD R6.z, -R3.x, c[5].w, R1.x;\n"
178 "CMP R1.x, -R0.y, R6.z, R1;\n"
180 "TEX R0.y, R1, texture[0], 2D;\n"
181 "MUL R5.y, R4.w, R5.z;\n"
182 "CMP R0.y, -R5, R0, R5.x;\n"
183 "MAD R5.x, -R4.y, c[5].y, R0.y;\n"
184 "CMP R5.z, -R5.y, R5.x, R0.y;\n"
185 "MAD R1.y, -R4, c[5], R6;\n"
186 "CMP R1.y, -R1.w, R1, R6;\n"
188 "SGE R1.w, R1, R4.z;\n"
190 "SGE R0.y, R0, R4.z;\n"
192 "CMP R6.y, -R1.w, c[4].x, c[4].z;\n"
194 "CMP R5.y, -R0, c[4].x, c[4].z;\n"
195 "ADD_SAT R0.y, R5, R6;\n"
196 "MUL R5.x, R4.w, R0.y;\n"
197 "MUL R0.y, R4.w, R6;\n"
198 "MAD R1.w, R3.y, c[5].x, R6.x;\n"
199 "CMP R6.x, -R0.y, R1.w, R6;\n"
200 "MAD R6.z, R3.x, c[5].x, R1;\n"
201 "CMP R1.z, -R0.y, R6, R1;\n"
203 "TEX R0.y, R1.zwzw, texture[0], 2D;\n"
204 "MUL R1.w, R5.x, R6.y;\n"
205 "CMP R6.y, -R1.w, R0, R1;\n"
206 "MUL R0.y, R4.w, R5;\n"
207 "MAD R1.y, -R3, c[5].x, R5.w;\n"
208 "CMP R4.w, -R0.y, R1.y, R5;\n"
209 "MAD R6.z, -R3.x, c[5].x, R1.x;\n"
210 "CMP R1.x, -R0.y, R6.z, R1;\n"
212 "TEX R0.y, R1, texture[0], 2D;\n"
213 "MUL R5.y, R5.x, R5;\n"
214 "CMP R0.y, -R5, R0, R5.z;\n"
215 "MAD R5.z, -R4.y, c[5].y, R0.y;\n"
216 "CMP R5.w, -R5.y, R5.z, R0.y;\n"
217 "MAD R1.y, -R4, c[5], R6;\n"
218 "CMP R1.y, -R1.w, R1, R6;\n"
220 "SGE R1.w, R1, R4.z;\n"
222 "CMP R6.y, -R1.w, c[4].x, c[4].z;\n"
224 "SGE R0.y, R0, R4.z;\n"
226 "CMP R5.y, -R0, c[4].x, c[4].z;\n"
227 "ADD_SAT R0.y, R5, R6;\n"
228 "MUL R5.z, R5.x, R0.y;\n"
229 "MUL R0.y, R5.x, R6;\n"
230 "MAD R1.w, R3.y, c[6].x, R6.x;\n"
231 "CMP R6.x, -R0.y, R1.w, R6;\n"
232 "MAD R6.z, R3.x, c[6].x, R1;\n"
233 "CMP R1.z, -R0.y, R6, R1;\n"
235 "TEX R0.y, R1.zwzw, texture[0], 2D;\n"
236 "MUL R1.w, R5.z, R6.y;\n"
237 "CMP R6.y, -R1.w, R0, R1;\n"
238 "MUL R0.y, R5.x, R5;\n"
239 "MAD R1.y, -R3, c[6].x, R4.w;\n"
240 "CMP R4.w, -R0.y, R1.y, R4;\n"
241 "MAD R5.x, -R3, c[6], R1;\n"
242 "CMP R1.x, -R0.y, R5, R1;\n"
244 "TEX R0.y, R1, texture[0], 2D;\n"
245 "MUL R1.y, R5.z, R5;\n"
246 "CMP R5.x, -R1.y, R0.y, R5.w;\n"
247 "MAD R5.y, -R4, c[5], R5.x;\n"
248 "CMP R1.y, -R1, R5, R5.x;\n"
249 "MAD R0.y, -R4, c[5], R6;\n"
250 "CMP R0.y, -R1.w, R0, R6;\n"
253 "SGE R1.w, R1, R4.z;\n"
254 "SGE R5.x, R5, R4.z;\n"
257 "CMP R4.z, -R4, c[4].x, c[4];\n"
258 "CMP R1.w, -R1, c[4].x, c[4].z;\n"
259 "MUL R4.z, R5, R4;\n"
260 "MAD R5.y, R3.x, c[6], R1.z;\n"
261 "CMP R5.y, -R4.z, R5, R1.z;\n"
262 "MAD R5.x, R3.y, c[6].y, R6;\n"
263 "CMP R1.z, -R4, R5.x, R6.x;\n"
264 "MUL R1.w, R5.z, R1;\n"
265 "ADD R4.z, -fragment.texcoord[0].x, R5.y;\n"
266 "ADD R1.z, -fragment.texcoord[0].y, R1;\n"
267 "CMP R1.z, -R3.w, R1, R4;\n"
268 "MAD R4.z, -R3.x, c[6].y, R1.x;\n"
269 "MAD R3.x, -R3.y, c[6].y, R4.w;\n"
270 "CMP R3.y, -R1.w, R4.z, R1.x;\n"
271 "CMP R1.x, -R1.w, R3, R4.w;\n"
272 "ADD R1.w, fragment.texcoord[0].x, -R3.y;\n"
273 "ADD R1.x, fragment.texcoord[0].y, -R1;\n"
274 "CMP R1.x, -R3.w, R1, R1.w;\n"
275 "SLT R1.w, R1.x, R1.z;\n"
276 "ADD R3.x, R1, R1.z;\n"
278 "MIN R1.x, R1, R1.z;\n"
279 "CMP R1.w, -R1, c[4].x, c[4].z;\n"
280 "MUL R1.z, R2.x, R1.w;\n"
282 "MAD R1.x, R1, -R3, c[5].y;\n"
283 "MUL R1.w, R4.y, c[5].y;\n"
284 "SLT R3.x, R1.y, c[4];\n"
285 "SLT R1.y, R8, R1.w;\n"
286 "SLT R0.y, R0, c[4].x;\n"
287 "ADD R0.y, R0, -R1;\n"
288 "ADD R1.y, -R1, R3.x;\n"
291 "CMP R0.y, -R0, c[4].z, c[4].x;\n"
292 "CMP R1.y, -R1, c[4].z, c[4].x;\n"
293 "CMP R0.x, -R1.z, R0.y, R1.y;\n"
294 "MAD R0.y, R0.z, c[6].z, -R8;\n"
296 "CMP R0.x, -R0, c[4], c[4].z;\n"
297 "MUL R0.x, R2, R0;\n"
298 "CMP R0.x, -R0, c[4], R1;\n"
301 "MUL_SAT R0.y, R0, R0.z;\n"
302 "MUL R0.z, R0.y, c[4].w;\n"
303 "ADD R0.z, R0, c[6].w;\n"
304 "MUL R0.y, R0, R0;\n"
305 "MUL R0.y, R0.z, R0;\n"
306 "MUL R0.y, R0, R0;\n"
307 "MUL R0.y, R0, c[1].x;\n"
308 "MAX R0.x, R0, R0.y;\n"
309 "MAD R0.y, R0.x, R2, fragment.texcoord[0];\n"
310 "MAD R0.z, R0.x, R2.y, fragment.texcoord[0].x;\n"
311 "CMP R0.x, -R3.w, R0.z, fragment.texcoord[0];\n"
312 "CMP R0.y, -R4.x, R0, fragment.texcoord[0];\n"
313 "TEX R0.xyz, R0, texture[0], 2D;\n"
314 "CMP R1, R2.z, R8, R9;\n"
316 "CMP result.color, -R2.x, R0, R1;\n"
318 /*"# 260 instructions, 10 R-regs\n"
321 const char *a_arbfp1_ps3
=
323 "OPTION ARB_precision_hint_fastest;\n"
324 //# cgc version 3.1.0013, build date Apr 18 2012
325 //# command line args: -profile arbfp1 -O3 -fastmath -fastprecision
326 //# source file: fxaa_fp.cg
327 //#vendor NVIDIA Corporation
331 //#semantic fxaa_fp.fxaaConsoleRcpFrameOpt
332 //#semantic fxaa_fp.fxaaConsoleRcpFrameOpt2
333 //#semantic fxaa_fp.nlTex0 : TEX0
334 //#var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1
335 //#var float4 fxaaConsolePosPos : $vin.TEXCOORD1 : TEX1 : 1 : 1
336 //#var float4 fxaaConsoleRcpFrameOpt : : c[0] : 2 : 1
337 //#var float4 fxaaConsoleRcpFrameOpt2 : : c[1] : 3 : 1
338 //#var sampler2D nlTex0 : TEX0 : texunit 0 : 4 : 1
339 //#var float4 oCol : $vout.COLOR : COL : 5 : 1
340 //#const c[2] = 0.125 0 -2 2
341 //#const c[3] = 0.001953125 0.5
342 "PARAM c[4] = { program.env[0..1],\n"
343 " { 0.125, 0, -2, 2 },\n"
344 " { 0.001953125, 0.5 } };\n"
351 "TEX R1.w, fragment.texcoord[1].zyzw, texture[0], 2D;\n"
352 "ADD R0.x, R1.w, c[3];\n"
353 "TEX R0.w, fragment.texcoord[1].xwzw, texture[0], 2D;\n"
354 "TEX R1.w, fragment.texcoord[1], texture[0], 2D;\n"
355 "ADD R0.y, -R0.x, R0.w;\n"
356 "ADD R0.z, R1.w, R0.y;\n"
357 "TEX R2.w, fragment.texcoord[1].zwzw, texture[0], 2D;\n"
358 "ADD R0.y, -R1.w, R0;\n"
359 "ADD R1.x, R2.w, R0.y;\n"
360 "ADD R1.y, R0.z, -R2.w;\n"
361 "MUL R2.xy, R1, R1;\n"
362 "ADD R0.y, R2.x, R2;\n"
364 "MUL R2.xy, R0.y, R1;\n"
365 "MAD R3.xy, R2, c[0].zwzw, fragment.texcoord[0];\n"
368 "MIN R0.y, R0, R0.z;\n"
370 "MUL R1.xy, R0.y, R2;\n"
371 "MUL R1.xy, R1, c[2].x;\n"
372 "MIN R1.xy, R1, c[2].w;\n"
373 "TEX R4, R3, texture[0], 2D;\n"
374 "MAD R2.xy, -R2, c[0].zwzw, fragment.texcoord[0];\n"
375 "TEX R3, R2, texture[0], 2D;\n"
377 "MAX R1.xy, R1, c[2].z;\n"
378 "MAD R2.xy, R1, c[1].zwzw, fragment.texcoord[0];\n"
379 "MUL R5, R3, c[3].y;\n"
380 "MAD R1.xy, -R1, c[1].zwzw, fragment.texcoord[0];\n"
381 "MIN R0.z, R0.x, R2.w;\n"
382 "MIN R0.y, R0.w, R1.w;\n"
383 "MIN R0.y, R0, R0.z;\n"
384 "MAX R0.z, R0.x, R2.w;\n"
385 "MAX R0.x, R0.w, R1.w;\n"
386 "MAX R0.x, R0, R0.z;\n"
387 "TEX R4, R2, texture[0], 2D;\n"
388 "TEX R3, R1, texture[0], 2D;\n"
390 "MAD R3, R3, c[3].y, R5;\n"
391 "MUL R3, R3, c[3].y;\n"
392 "SLT R0.z, R0.x, R3.w;\n"
393 "SLT R0.x, R3.w, R0.y;\n"
394 "ADD_SAT R0.x, R0, R0.z;\n"
395 "CMP result.color, -R0.x, R5, R3;\n"
397 //# 45 instructions, 6 R-regs
399 const char *a_arbfp1_earlyexit
=
401 "OPTION ARB_precision_hint_fastest;\n"
402 //"# cgc version 3.1.0013, build date Apr 18 2012\n"
403 //"# command line args: -profile arbfp1\n"
404 //"# source file: fxaa_fp.cg\n"
405 //"#vendor NVIDIA Corporation\n"
406 //"#version 3.1.0.13\n"
407 //"#profile arbfp1\n"
408 //"#program fxaa_fp\n"
409 //"#semantic fxaa_fp.fxaaConsoleRcpFrameOpt\n"
410 //"#semantic fxaa_fp.fxaaConsoleRcpFrameOpt2\n"
411 //"#semantic fxaa_fp.nlTex0 : TEX0\n"
412 //"#var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1\n"
413 //"#var float4 fxaaConsolePosPos : $vin.TEXCOORD1 : TEX1 : 1 : 1\n"
414 //"#var float4 fxaaConsoleRcpFrameOpt : : c[0] : 2 : 1\n"
415 //"#var float4 fxaaConsoleRcpFrameOpt2 : : c[1] : 3 : 1\n"
416 //"#var sampler2D nlTex0 : TEX0 : texunit 0 : 4 : 1\n"
417 //"#var float4 oCol : $vout.COLOR : COL : 5 : 1\n"
418 //"#const c[2] = 0.125 0 8 0.001953125\n"
419 //"#const c[3] = -2 2 0.5\n"
420 "PARAM c[4] = { program.env[0..1],\n"
421 " { 0.125, 0, 8, 0.001953125 },\n"
422 " { -2, 2, 0.5 } };\n"
429 "TEX R0.w, fragment.texcoord[1].zyzw, texture[0], 2D;\n"
430 "ADD R0.x, R0.w, c[2].w;\n"
431 "TEX R1.w, fragment.texcoord[1].xwzw, texture[0], 2D;\n"
432 "TEX R0.w, fragment.texcoord[1], texture[0], 2D;\n"
433 "ADD R0.y, R1.w, -R0.x;\n"
434 "ADD R0.z, R0.w, R0.y;\n"
435 "TEX R2.w, fragment.texcoord[1].zwzw, texture[0], 2D;\n"
436 "ADD R0.y, -R0.w, R0;\n"
437 "ADD R1.z, -R2.w, R0;\n"
438 "ADD R1.x, R2.w, R0.y;\n"
440 "DP3 R0.y, R1, R1;\n"
442 "MUL R2.xy, R0.y, R1.xzzw;\n"
443 "MAD R3.xy, R2, c[0].zwzw, fragment.texcoord[0];\n"
446 "MIN R0.y, R0, R0.z;\n"
448 "MUL R1.xy, R0.y, R2;\n"
449 "MUL R1.xy, R1, c[2].x;\n"
450 "MIN R1.xy, R1, c[3].y;\n"
451 "MIN R0.y, R0.w, R1.w;\n"
452 "TEX R4, R3, texture[0], 2D;\n"
453 "MAD R2.xy, -R2, c[0].zwzw, fragment.texcoord[0];\n"
454 "TEX R3, R2, texture[0], 2D;\n"
456 "MAX R1.xy, R1, c[3].x;\n"
457 "MAD R2.xy, R1, c[1].zwzw, fragment.texcoord[0];\n"
458 "MAD R1.xy, -R1, c[1].zwzw, fragment.texcoord[0];\n"
459 "MUL R5, R3, c[3].z;\n"
460 "TEX R4, R2, texture[0], 2D;\n"
461 "TEX R3, R1, texture[0], 2D;\n"
462 "MIN R0.z, R0.x, R2.w;\n"
463 "MIN R1.x, R0.y, R0.z;\n"
464 "MAX R0.y, R0.x, R2.w;\n"
465 "MAX R0.x, R0.w, R1.w;\n"
466 "MAX R2.x, R0, R0.y;\n"
468 "MAD R3, R3, c[3].z, R5;\n"
469 "MUL R3, R3, c[3].z;\n"
470 "SLT R1.z, R2.x, R3.w;\n"
471 "SLT R1.y, R3.w, R1.x;\n"
472 "TEX R0, fragment.texcoord[0], texture[0], 2D;\n"
473 "ADD_SAT R1.y, R1, R1.z;\n"
474 "MIN R1.z, R0.w, R1.x;\n"
475 "MAX R1.x, R2, R0.w;\n"
476 "ADD R2.y, R1.x, -R1.z;\n"
477 "CMP R1, -R1.y, R5, R3;\n"
478 "MAD R2.x, R2.y, c[2].z, -R2;\n"
479 "CMP result.color, R2.x, R0, R1;\n"
481 //"# 51 instructions, 6 R-regs\n"
483 const char *a_ps_2_0_test_t0
=
491 const char *a_ps_2_0_test_avg
=
494 "def c0, 0.25000000, 0, 0, 0\n"
496 "mov r0.xy, t1.xwzw\n"
497 "mov r1.xy, t1.zyzw\n"
501 "mov r0.xy, t1.zwzw\n"
509 const char *a_ps_2_0
=
511 /*"// cgc version 3.1.0013, build date Apr 18 2012\n"
512 "// command line args: -profile ps_2_x -O3 -fastmath -fastprecision\n"
513 "// source file: fxaa_pp.cg\n"
514 "//vendor NVIDIA Corporation\n"
515 "//version 3.1.0.13\n"
517 "//program fxaa_pp\n"
518 "//semantic fxaa_pp.fxaaQualityRcpFrame\n"
519 "//semantic fxaa_pp.fxaaQualitySubpix\n"
520 "//semantic fxaa_pp.fxaaQualityEdgeThreshold\n"
521 "//semantic fxaa_pp.fxaaQualityEdgeThresholdMin\n"
522 "//semantic fxaa_pp.nlTex0 : TEX0\n"
523 "//var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1\n"
524 "//var float2 fxaaQualityRcpFrame : : c[0] : 2 : 1\n"
525 "//var float fxaaQualitySubpix : : c[1] : 3 : 1\n"
526 "//var float fxaaQualityEdgeThreshold : : c[2] : 4 : 1\n"
527 "//var float fxaaQualityEdgeThresholdMin : : c[3] : 5 : 1\n"
528 "//var sampler2D nlTex0 : TEX0 : texunit 0 : 6 : 1\n"
529 "//var float4 oCol : $vout.COLOR : COL : 7 : 1\n"
530 "//const c[4] = 0 -1 1 -2\n"
531 "//const c[5] = 2 0.5 0.25 1.5\n"
532 "//const c[6] = 4 12 0.083333336\n"
533 "//const c[7] = -2 3\n"*/
535 "def c4, 0.00000000, -1.00000000, 1.00000000, -2.00000000\n"
536 "def c5, 2.00000000, 0.50000000, 0.25000000, 1.50000000\n"
537 "def c6, 4.00000000, 12.00000000, 0.08333334, 0\n"
538 "def c7, -2.00000000, 3.00000000, 0, 0\n"
540 "mov r0.zw, c0.xyxy\n"
541 "mad r3.xy, c4.zxzw, r0.zwzw, t0\n"
545 "mad r0.xy, c4.yxzw, r0, t0\n"
548 "mad r0.xy, c4, r0, t0\n"
550 "add r0.xy, t0, -c0\n"
553 "mad r3.xy, c4.zyzw, r3, t0\n"
555 "add r7.x, r8.y, r7.y\n"
556 "mad r0.z, r1.y, c4.w, r7.x\n"
557 "add r0.x, r5.y, r3.y\n"
558 "mad r0.w, r9.y, c4, r0.x\n"
560 "mad r0.xy, c4.xzzw, r0, t0\n"
562 "add r5.x, r9.y, r6.y\n"
565 "mad r3.x, r0.z, c5, r0.w\n"
566 "mov r0.zw, c0.xyxy\n"
567 "mad r4.xy, c4.yzzw, r0.zwzw, t0\n"
569 "add r0.xy, t0, c0\n"
571 "add r4.x, r5.y, r4.y\n"
573 "add r0.x, r4.y, r0.y\n"
574 "mad r0.x, r6.y, c4.w, r0\n"
576 "add r0.w, r0.x, r3.x\n"
577 "mad r0.x, r8.y, c4.w, r4\n"
578 "mad r0.z, r7.y, c4.w, r5.y\n"
579 "mad r0.y, r1, c4.w, r5.x\n"
582 "mad r0.y, r0, c5.x, r0.z\n"
584 "add r0.x, r0, r0.y\n"
585 "add r0.x, r0, -r0.w\n"
586 "cmp r3.y, r0.x, c4.z, c4.x\n"
588 "max r0.z, r7.y, r0.y\n"
590 "max r0.y, r0, r0.z\n"
591 "min r0.z, r6.y, r1.y\n"
592 "min r0.w, r7.y, r0.z\n"
593 "min r0.z, r9.y, r8.y\n"
594 "min r0.z, r0, r0.w\n"
595 "mul r3.x, r0.y, c2\n"
596 "abs_pp r0.x, r3.y\n"
597 "add r4.y, r0, -r0.z\n"
598 "max r0.w, r3.x, c3.x\n"
599 "add r4.z, r4.y, -r0.w\n"
600 "cmp_pp r4.w, r4.z, c4.z, c4.x\n"
601 "mul_pp r5.w, r4, r3.y\n"
602 "cmp_pp r0.y, -r0.x, c4.z, c4.x\n"
603 "mul_pp r5.z, r4.w, r0.y\n"
604 "cmp_pp r3.x, -r0, c4, c4.z\n"
605 "cmp r6.w, -r5.z, r6.y, r7.y\n"
606 "cmp r7.w, -r5.z, r9.y, r8.y\n"
607 "add r0.z, -r1.y, r6.w\n"
608 "add r0.y, -r1, r7.w\n"
611 "add r0.y, r7, -r9.z\n"
612 "cmp r0.y, r0, c4.z, c4.x\n"
613 "max r7.y, r7, r9.z\n"
614 "mul_pp r0.z, r4.w, r0.y\n"
615 "cmp r0.w, -r5, c0.x, c0.y\n"
616 "cmp r6.x, -r0.z, r0.w, -r0.w\n"
618 "cmp r6.y, -r5.z, c4.x, r0.z\n"
619 "mad r0.w, r6.x, c5.y, t0.y\n"
620 "cmp r0.z, -r5.w, t0.y, r0.w\n"
621 "add r8.z, r0, r6.y\n"
622 "add r7.z, r0, -r6.y\n"
625 "mad r0.w, r6.x, c5.y, t0.x\n"
627 "mul_pp r3.x, r4.w, r3\n"
628 "cmp r6.z, -r3.x, c4.x, r0.x\n"
629 "cmp r0.x, -r5.z, t0, r0.w\n"
630 "add r9.x, r0, -r6.z\n"
632 "add r8.x, r0, r6.z\n"
633 "abs_pp r3.x, r0.y\n"
635 "cmp_pp r0.x, -r3, c4.z, c4\n"
636 "add r0.w, r1.y, r6\n"
637 "add r0.z, r1.y, r7.w\n"
638 "mul_pp r0.x, r4.w, r0\n"
639 "cmp r6.w, -r0.x, r0.z, r0\n"
640 "mad r7.w, -r6, c5.y, r0.y\n"
641 "mad r8.w, -r6, c5.y, r3.y\n"
644 "mad r0.x, -r7.y, c5.z, r0\n"
645 "mad r0.y, -r7, c5.z, r0\n"
646 "cmp r0.x, r0, c4.z, c4\n"
648 "cmp_pp r9.z, -r0.x, c4, c4.x\n"
649 "cmp r0.y, r0, c4.z, c4.x\n"
651 "cmp_pp r9.w, -r0.y, c4.z, c4.x\n"
652 "mul_pp r0.x, r4.w, r9.z\n"
653 "mad r0.y, -r6, c5.w, r7.z\n"
654 "cmp r7.z, -r0.x, r7, r0.y\n"
655 "mad r0.z, -r6, c5.w, r9.x\n"
656 "cmp r9.x, -r0, r9, r0.z\n"
659 "add_pp_sat r3.z, r9, r9.w\n"
660 "mul_pp r0.x, r4.w, r9.w\n"
661 "mad r0.y, r6, c5.w, r8.z\n"
662 "cmp r3.x, -r0, r8.z, r0.y\n"
663 "mad r0.z, r6, c5.w, r8.x\n"
664 "mul_pp r8.z, r4.w, r3\n"
665 "cmp r8.x, -r0, r8, r0.z\n"
668 "mul_pp r0.w, r8.z, r9\n"
669 "cmp r3.z, -r0.w, r7.w, r0.y\n"
670 "mul_pp r0.x, r8.z, r9.z\n"
671 "cmp r0.y, -r0.x, r8.w, r3\n"
672 "mad r0.z, -r6.w, c5.y, r0.y\n"
673 "cmp r8.w, -r0.x, r0.y, r0.z\n"
674 "mad r3.y, -r6.w, c5, r3.z\n"
675 "cmp r9.w, -r0, r3.z, r3.y\n"
678 "mad r0.y, -r7, c5.z, r0\n"
679 "mad r0.x, -r7.y, c5.z, r0\n"
680 "cmp r0.y, r0, c4.z, c4.x\n"
682 "cmp_pp r10.x, -r0.y, c4.z, c4\n"
683 "cmp r0.x, r0, c4.z, c4\n"
685 "cmp_pp r9.z, -r0.x, c4, c4.x\n"
686 "mul_pp r0.x, r8.z, r10\n"
687 "mad r0.y, r6, c5.x, r3.x\n"
688 "cmp r7.w, -r0.x, r3.x, r0.y\n"
689 "mad r0.z, r6, c5.x, r8.x\n"
690 "cmp r8.x, -r0, r8, r0.z\n"
693 "mul_pp r0.w, r8.z, r9.z\n"
694 "mad r3.x, -r6.z, c5, r9\n"
695 "mad r0.x, -r6.y, c5, r7.z\n"
696 "cmp r0.x, -r0.w, r7.z, r0\n"
697 "add_pp_sat r0.z, r9, r10.x\n"
698 "mul_pp r7.z, r8, r0\n"
699 "cmp r9.x, -r0.w, r9, r3\n"
702 "mul_pp r0.z, r7, r9\n"
703 "cmp r0.w, -r0.z, r8, r3.y\n"
704 "mul_pp r3.x, r7.z, r10\n"
705 "cmp r3.y, -r3.x, r9.w, r0\n"
706 "mad r0.y, -r6.w, c5, r0.w\n"
707 "cmp r8.z, -r0, r0.w, r0.y\n"
708 "mad r3.z, -r6.w, c5.y, r3.y\n"
709 "cmp r9.z, -r3.x, r3.y, r3\n"
712 "mad r0.y, -r7, c5.z, r0\n"
713 "mad r0.z, -r7.y, c5, r0\n"
714 "cmp r0.y, r0, c4.z, c4.x\n"
716 "cmp_pp r8.w, -r0.y, c4.z, c4.x\n"
717 "cmp r0.z, r0, c4, c4.x\n"
719 "cmp_pp r9.w, -r0.z, c4.z, c4.x\n"
720 "mul_pp r0.y, r7.z, r8.w\n"
721 "mad r0.z, -r6.y, c6.x, r0.x\n"
722 "cmp r10.x, -r0.y, r0, r0.z\n"
723 "mad r0.w, -r6.z, c6.x, r9.x\n"
724 "cmp r9.x, -r0.y, r9, r0.w\n"
727 "mul_pp r0.x, r7.z, r9.w\n"
728 "mad r0.z, r6, c6.x, r8.x\n"
729 "mad r0.y, r6, c6.x, r7.w\n"
730 "cmp r3.x, -r0, r7.w, r0.y\n"
731 "cmp r8.x, -r0, r8, r0.z\n"
734 "add_pp_sat r3.z, r8.w, r9.w\n"
735 "mul_pp r0.x, r7.z, r3.z\n"
736 "mul_pp r3.z, r0.x, r9.w\n"
737 "cmp r0.y, -r3.z, r9.z, r0\n"
738 "mul_pp r0.z, r0.x, r8.w\n"
739 "cmp r0.w, -r0.z, r8.z, r3.y\n"
740 "mad r3.w, -r6, c5.y, r0.y\n"
741 "cmp r0.y, -r3.z, r0, r3.w\n"
742 "mad r3.y, -r6.w, c5, r0.w\n"
743 "cmp r0.z, -r0, r0.w, r3.y\n"
746 "mad r3.y, -r7, c5.z, r3\n"
747 "mad r0.w, -r7.y, c5.z, r0\n"
748 "cmp r3.y, r3, c4.z, c4.x\n"
750 "cmp r0.w, r0, c4.z, c4.x\n"
751 "cmp_pp r3.z, -r3.y, c4, c4.x\n"
753 "cmp_pp r3.y, -r0.w, c4.z, c4.x\n"
754 "mul_pp r0.w, r0.x, r3.z\n"
755 "mul_pp r0.x, r0, r3.y\n"
756 "mad r3.w, r6.y, c6.y, r3.x\n"
757 "cmp r3.x, -r0.w, r3, r3.w\n"
758 "mad r3.z, r6, c6.y, r8.x\n"
759 "cmp r0.w, -r0, r8.x, r3.z\n"
760 "mad r3.y, -r6, c6, r10.x\n"
761 "cmp r3.y, -r0.x, r10.x, r3\n"
762 "add r3.x, -t0.y, r3\n"
763 "add r0.w, -t0.x, r0\n"
764 "cmp r0.w, -r5.z, r0, r3.x\n"
765 "mad r3.x, -r6.z, c6.y, r9\n"
766 "cmp r0.x, -r0, r9, r3\n"
767 "add r3.x, t0.y, -r3.y\n"
768 "add r0.x, t0, -r0\n"
769 "cmp r0.x, -r5.z, r0, r3\n"
770 "add r3.x, r0, -r0.w\n"
771 "add r3.y, r0.x, r0.w\n"
772 "cmp r3.x, r3, c4, c4.z\n"
774 "min r0.x, r0, r0.w\n"
775 "cmp_pp r3.x, -r3, c4.z, c4\n"
776 "mul_pp r0.w, r4, r3.x\n"
778 "mad r0.x, r0, -r3.y, c5.y\n"
779 "cmp r3.y, r0, c4.x, c4.z\n"
780 "mad r3.x, -r6.w, c5.y, r1.y\n"
781 "cmp r3.x, r3, c4, c4.z\n"
782 "cmp r0.y, r0.z, c4.x, c4.z\n"
783 "add_pp r0.z, -r3.x, r3.y\n"
784 "add_pp r0.y, r0, -r3.x\n"
787 "cmp_pp r0.z, -r0, c4.x, c4\n"
788 "cmp_pp r0.y, -r0, c4.x, c4.z\n"
789 "cmp_pp r0.y, -r0.w, r0, r0.z\n"
791 "cmp_pp r0.y, -r0, c4.z, c4.x\n"
792 "mul_pp r0.y, r4.w, r0\n"
794 "cmp r0.x, -r0.y, r0, c4\n"
795 "add r3.y, r4.x, r5\n"
797 "mad r3.x, r3, c5, r3.y\n"
798 "mad r0.z, r3.x, c6, -r1.y\n"
800 "mul_sat r0.z, r0, r0.w\n"
801 "mul r0.w, r0.z, r0.z\n"
802 "mad r0.z, r0, c7.x, c7.y\n"
803 "mul r0.z, r0, r0.w\n"
805 "mul r0.z, r0, c1.x\n"
806 "max r0.x, r0, r0.z\n"
807 "mad r0.y, r0.x, r6.x, t0\n"
808 "mad r0.z, r0.x, r6.x, t0.x\n"
809 "cmp r0.x, -r5.z, t0, r0.z\n"
810 "cmp r0.y, -r5.w, t0, r0\n"
813 "cmp r1, r4.z, r2, r1\n"
814 "cmp r0, -r4.w, r1, r0\n"
817 const char *a_ps_2_0_ps3
=
819 // cgc version 3.1.0013, build date Apr 18 2012
820 // command line args: -profile ps_2_0 -O3 -fastmath -fastprecision
821 // source file: fxaa_pp.cg
822 //vendor NVIDIA Corporation
826 //semantic fxaa_pp.fxaaConsoleRcpFrameOpt
827 //semantic fxaa_pp.fxaaConsoleRcpFrameOpt2
828 //semantic fxaa_pp.nlTex0 : TEX0
829 //var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1
830 //var float4 fxaaConsolePosPos : $vin.TEXCOORD1 : TEX1 : 1 : 1
831 //var float4 fxaaConsoleRcpFrameOpt : : c[0] : 2 : 1
832 //var float4 fxaaConsoleRcpFrameOpt2 : : c[1] : 3 : 1
833 //var sampler2D nlTex0 : TEX0 : texunit 0 : 4 : 1
834 //var float4 oCol : $vout.COLOR : COL : 5 : 1
835 //const c[2] = 0.001953125 0.125 2 -2
836 //const c[3] = 0.5 0 1
838 "def c2, 0.00195313, 0.12500000, 2.00000000, -2.00000000\n"
839 "def c3, 0.50000000, 0.00000000, 1.00000000, 0\n"
853 "add r0.x, r1.w, c2\n"
854 "add r2.x, -r0, r0.w\n"
855 "add r1.x, r5.w, r2\n"
856 "add r2.z, r1.x, -r6.w\n"
857 "add r2.x, -r5.w, r2\n"
858 "add r2.x, r6.w, r2\n"
864 "mul r1.xy, r3, r1\n"
865 "add r1.x, r1, r1.y\n"
867 "mul r4.xy, r1.x, r2\n"
872 "mul r1.xy, r1.x, r4\n"
873 "mul r1.xy, r1, c2.y\n"
874 "min r1.xy, r1, c2.z\n"
875 "max r2.xy, r1, c2.w\n"
878 "mad r3.xy, r2, r1, t0\n"
881 "mad r5.xy, -r2, r1, t0\n"
884 "mad r2.xy, -r4, r1, t0\n"
887 "mad r1.xy, r4, r1, t0\n"
895 "max r3.x, r0, r6.w\n"
896 "mad r1, r1, c3.x, r2\n"
898 "max r1.x, r0.w, r5.w\n"
900 "add r1.x, -r4.w, r1\n"
901 "min r3.x, r0.w, r5.w\n"
902 "min r0.x, r0, r6.w\n"
904 "add r0.x, r4.w, -r0\n"
905 "cmp r1.x, r1, c3.y, c3.z\n"
906 "cmp r0.x, r0, c3.y, c3.z\n"
907 "add_pp_sat r0.x, r0, r1\n"
908 "cmp r0, -r0.x, r4, r2\n"
911 const char *a_ps_2_0_earlyexit
=
913 // cgc version 3.1.0013, build date Apr 18 2012
914 // command line args: -profile ps_2_x
915 // source file: fxaa_fp.cg
916 //vendor NVIDIA Corporation
920 //semantic fxaa_fp.fxaaConsoleRcpFrameOpt
921 //semantic fxaa_fp.fxaaConsoleRcpFrameOpt2
922 //semantic fxaa_fp.nlTex0 : TEX0
923 //var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1
924 //var float4 fxaaConsolePosPos : $vin.TEXCOORD1 : TEX1 : 1 : 1
925 //var float4 fxaaConsoleRcpFrameOpt : : c[0] : 2 : 1
926 //var float4 fxaaConsoleRcpFrameOpt2 : : c[1] : 3 : 1
927 //var sampler2D nlTex0 : TEX0 : texunit 0 : 4 : 1
928 //var float4 oCol : $vout.COLOR : COL : 5 : 1
929 //const c[2] = 0.001953125 0 0.125 2
930 //const c[3] = -2 0.5 0 1
933 "def c2, 0.00195313, 0.00000000, 0.12500000, 2.00000000\n"
934 "def c3, -2.00000000, 0.50000000, 0.00000000, 1.00000000\n"
935 "def c4, 8.00000000, 0, 0, 0\n"
938 "mov r0.xy, t1.zyzw\n"
940 "mov r0.xy, t1.xwzw\n"
943 "add r4.x, r0.w, c2\n"
944 "mov r0.xy, t1.zwzw\n"
946 "add r0.w, r4, -r4.x\n"
947 "add r0.x, r5.w, r0.w\n"
948 "add r0.z, -r3.w, r0.x\n"
949 "add r0.x, -r5.w, r0.w\n"
950 "add r0.x, r3.w, r0\n"
954 "mul r0.zw, r0.y, r0.xyxz\n"
955 "mad r1.xy, -r0.zwzw, c0.zwzw, t0\n"
959 "min r0.x, r0, r0.y\n"
961 "mul r0.xy, r0.x, r0.zwzw\n"
962 "mul r0.xy, r0, c2.z\n"
963 "min r2.xy, r0, c2.w\n"
964 "mad r0.xy, r0.zwzw, c0.zwzw, t0\n"
967 "max r1.xy, r2, c3.x\n"
969 "mad r0.xy, r1, c1.zwzw, t0\n"
970 "mad r1.xy, -r1, c1.zwzw, t0\n"
974 "mad r0, r0, c3.y, r2\n"
976 "min r0.y, r4.x, r3.w\n"
977 "min r0.x, r5.w, r4.w\n"
978 "min r3.y, r0.x, r0\n"
979 "add r0.x, -r3.y, r1.w\n"
980 "max r0.z, r4.x, r3.w\n"
981 "max r0.y, r5.w, r4.w\n"
982 "max r3.x, r0.y, r0.z\n"
983 "cmp r3.z, r0.x, c3, c3.w\n"
984 "add r3.w, r3.x, -r1\n"
985 "cmp r3.w, r3, c3.z, c3\n"
986 "add_pp_sat r3.z, r3, r3.w\n"
988 "min r3.w, r0, r3.y\n"
989 "max r3.y, r3.x, r0.w\n"
990 "cmp r1, -r3.z, r1, r2\n"
991 "add r3.y, r3, -r3.w\n"
992 "mad r2.x, r3.y, c4, -r3\n"
993 "cmp r0, r2.x, r1, r0\n"