blob: 1df0e98a411f83352fb16d9ecbc93db9d32e431b [file] [log] [blame]
Corbin Simpsonc686e172009-12-20 15:00:40 -08001TGSI
2====
3
4TGSI, Tungsten Graphics Shader Instructions, is an intermediate language
5for describing shaders. Since Gallium is inherently shaderful, shaders are
6an important part of the API. TGSI is the only intermediate representation
7used by all drivers.
Keith Whitwella62aaa72009-12-21 23:25:15 +00008
Corbin Simpsone8ed3b92009-12-21 19:12:55 -08009From GL_NV_vertex_program
Keith Whitwella62aaa72009-12-21 23:25:15 +000010-------------------------
11
12
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080013ARL - Address Register Load
14
15.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +000016
17 dst.x = floor(src.x)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080018
Keith Whitwella62aaa72009-12-21 23:25:15 +000019 dst.y = floor(src.y)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080020
Keith Whitwella62aaa72009-12-21 23:25:15 +000021 dst.z = floor(src.z)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080022
Keith Whitwella62aaa72009-12-21 23:25:15 +000023 dst.w = floor(src.w)
24
25
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080026MOV - Move
27
28.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +000029
30 dst.x = src.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080031
Keith Whitwella62aaa72009-12-21 23:25:15 +000032 dst.y = src.y
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080033
Keith Whitwella62aaa72009-12-21 23:25:15 +000034 dst.z = src.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080035
Keith Whitwella62aaa72009-12-21 23:25:15 +000036 dst.w = src.w
37
38
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080039LIT - Light Coefficients
40
41.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +000042
43 dst.x = 1.0
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080044
Keith Whitwella62aaa72009-12-21 23:25:15 +000045 dst.y = max(src.x, 0.0)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080046
Keith Whitwella62aaa72009-12-21 23:25:15 +000047 dst.z = (src.x > 0.0) ? pow(max(src.y, 0.0), clamp(src.w, -128.0, 128.0)) : 0.0
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080048
Keith Whitwella62aaa72009-12-21 23:25:15 +000049 dst.w = 1.0
50
51
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080052RCP - Reciprocal
53
54.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +000055
56 dst.x = 1.0 / src.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080057
Keith Whitwella62aaa72009-12-21 23:25:15 +000058 dst.y = 1.0 / src.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080059
Keith Whitwella62aaa72009-12-21 23:25:15 +000060 dst.z = 1.0 / src.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080061
Keith Whitwella62aaa72009-12-21 23:25:15 +000062 dst.w = 1.0 / src.x
63
64
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080065RSQ - Reciprocal Square Root
66
67.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +000068
69 dst.x = 1.0 / sqrt(abs(src.x))
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080070
Keith Whitwella62aaa72009-12-21 23:25:15 +000071 dst.y = 1.0 / sqrt(abs(src.x))
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080072
Keith Whitwella62aaa72009-12-21 23:25:15 +000073 dst.z = 1.0 / sqrt(abs(src.x))
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080074
Keith Whitwella62aaa72009-12-21 23:25:15 +000075 dst.w = 1.0 / sqrt(abs(src.x))
76
77
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080078EXP - Approximate Exponential Base 2
79
80.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +000081
82 dst.x = pow(2.0, floor(src.x))
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080083
Keith Whitwella62aaa72009-12-21 23:25:15 +000084 dst.y = src.x - floor(src.x)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080085
Keith Whitwella62aaa72009-12-21 23:25:15 +000086 dst.z = pow(2.0, src.x)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080087
Keith Whitwella62aaa72009-12-21 23:25:15 +000088 dst.w = 1.0
89
90
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080091LOG - Approximate Logarithm Base 2
92
93.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +000094
95 dst.x = floor(lg2(abs(src.x)))
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080096
Keith Whitwella62aaa72009-12-21 23:25:15 +000097 dst.y = abs(src.x) / pow(2.0, floor(lg2(abs(src.x))))
Corbin Simpsone8ed3b92009-12-21 19:12:55 -080098
Keith Whitwella62aaa72009-12-21 23:25:15 +000099 dst.z = lg2(abs(src.x))
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800100
Keith Whitwella62aaa72009-12-21 23:25:15 +0000101 dst.w = 1.0
102
103
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800104MUL - Multiply
105
106.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000107
108 dst.x = src0.x * src1.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800109
Keith Whitwella62aaa72009-12-21 23:25:15 +0000110 dst.y = src0.y * src1.y
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800111
Keith Whitwella62aaa72009-12-21 23:25:15 +0000112 dst.z = src0.z * src1.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800113
Keith Whitwella62aaa72009-12-21 23:25:15 +0000114 dst.w = src0.w * src1.w
115
116
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800117ADD - Add
118
119.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000120
121 dst.x = src0.x + src1.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800122
Keith Whitwella62aaa72009-12-21 23:25:15 +0000123 dst.y = src0.y + src1.y
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800124
Keith Whitwella62aaa72009-12-21 23:25:15 +0000125 dst.z = src0.z + src1.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800126
Keith Whitwella62aaa72009-12-21 23:25:15 +0000127 dst.w = src0.w + src1.w
128
129
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800130DP3 - 3-component Dot Product
131
132.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000133
134 dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800135
Keith Whitwella62aaa72009-12-21 23:25:15 +0000136 dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800137
Keith Whitwella62aaa72009-12-21 23:25:15 +0000138 dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800139
Keith Whitwella62aaa72009-12-21 23:25:15 +0000140 dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z
141
142
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800143DP4 - 4-component Dot Product
144
145.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000146
147 dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800148
Keith Whitwella62aaa72009-12-21 23:25:15 +0000149 dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800150
Keith Whitwella62aaa72009-12-21 23:25:15 +0000151 dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800152
Keith Whitwella62aaa72009-12-21 23:25:15 +0000153 dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w
154
155
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800156DST - Distance Vector
157
158.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000159
160 dst.x = 1.0
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800161
Keith Whitwella62aaa72009-12-21 23:25:15 +0000162 dst.y = src0.y * src1.y
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800163
Keith Whitwella62aaa72009-12-21 23:25:15 +0000164 dst.z = src0.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800165
Keith Whitwella62aaa72009-12-21 23:25:15 +0000166 dst.w = src1.w
167
168
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800169MIN - Minimum
170
171.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000172
173 dst.x = min(src0.x, src1.x)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800174
Keith Whitwella62aaa72009-12-21 23:25:15 +0000175 dst.y = min(src0.y, src1.y)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800176
Keith Whitwella62aaa72009-12-21 23:25:15 +0000177 dst.z = min(src0.z, src1.z)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800178
Keith Whitwella62aaa72009-12-21 23:25:15 +0000179 dst.w = min(src0.w, src1.w)
180
181
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800182MAX - Maximum
183
184.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000185
186 dst.x = max(src0.x, src1.x)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800187
Keith Whitwella62aaa72009-12-21 23:25:15 +0000188 dst.y = max(src0.y, src1.y)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800189
Keith Whitwella62aaa72009-12-21 23:25:15 +0000190 dst.z = max(src0.z, src1.z)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800191
Keith Whitwella62aaa72009-12-21 23:25:15 +0000192 dst.w = max(src0.w, src1.w)
193
194
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800195SLT - Set On Less Than
196
197.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000198
199 dst.x = (src0.x < src1.x) ? 1.0 : 0.0
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800200
Keith Whitwella62aaa72009-12-21 23:25:15 +0000201 dst.y = (src0.y < src1.y) ? 1.0 : 0.0
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800202
Keith Whitwella62aaa72009-12-21 23:25:15 +0000203 dst.z = (src0.z < src1.z) ? 1.0 : 0.0
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800204
Keith Whitwella62aaa72009-12-21 23:25:15 +0000205 dst.w = (src0.w < src1.w) ? 1.0 : 0.0
206
207
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800208SGE - Set On Greater Equal Than
209
210.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000211
212 dst.x = (src0.x >= src1.x) ? 1.0 : 0.0
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800213
Keith Whitwella62aaa72009-12-21 23:25:15 +0000214 dst.y = (src0.y >= src1.y) ? 1.0 : 0.0
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800215
Keith Whitwella62aaa72009-12-21 23:25:15 +0000216 dst.z = (src0.z >= src1.z) ? 1.0 : 0.0
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800217
Keith Whitwella62aaa72009-12-21 23:25:15 +0000218 dst.w = (src0.w >= src1.w) ? 1.0 : 0.0
219
220
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800221MAD - Multiply And Add
222
223.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000224
225 dst.x = src0.x * src1.x + src2.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800226
Keith Whitwella62aaa72009-12-21 23:25:15 +0000227 dst.y = src0.y * src1.y + src2.y
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800228
Keith Whitwella62aaa72009-12-21 23:25:15 +0000229 dst.z = src0.z * src1.z + src2.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800230
Keith Whitwella62aaa72009-12-21 23:25:15 +0000231 dst.w = src0.w * src1.w + src2.w
232
233
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800234SUB - Subtract
235
236.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000237
238 dst.x = src0.x - src1.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800239
Keith Whitwella62aaa72009-12-21 23:25:15 +0000240 dst.y = src0.y - src1.y
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800241
Keith Whitwella62aaa72009-12-21 23:25:15 +0000242 dst.z = src0.z - src1.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800243
Keith Whitwella62aaa72009-12-21 23:25:15 +0000244 dst.w = src0.w - src1.w
245
246
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800247LRP - Linear Interpolate
248
249.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000250
251 dst.x = src0.x * (src1.x - src2.x) + src2.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800252
Keith Whitwella62aaa72009-12-21 23:25:15 +0000253 dst.y = src0.y * (src1.y - src2.y) + src2.y
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800254
Keith Whitwella62aaa72009-12-21 23:25:15 +0000255 dst.z = src0.z * (src1.z - src2.z) + src2.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800256
Keith Whitwella62aaa72009-12-21 23:25:15 +0000257 dst.w = src0.w * (src1.w - src2.w) + src2.w
258
259
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800260CND - Condition
261
262.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000263
264 dst.x = (src2.x > 0.5) ? src0.x : src1.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800265
Keith Whitwella62aaa72009-12-21 23:25:15 +0000266 dst.y = (src2.y > 0.5) ? src0.y : src1.y
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800267
Keith Whitwella62aaa72009-12-21 23:25:15 +0000268 dst.z = (src2.z > 0.5) ? src0.z : src1.z
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800269
Keith Whitwella62aaa72009-12-21 23:25:15 +0000270 dst.w = (src2.w > 0.5) ? src0.w : src1.w
271
272
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800273DP2A - 2-component Dot Product And Add
274
275.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000276
277 dst.x = src0.x * src1.x + src0.y * src1.y + src2.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800278
Keith Whitwella62aaa72009-12-21 23:25:15 +0000279 dst.y = src0.x * src1.x + src0.y * src1.y + src2.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800280
Keith Whitwella62aaa72009-12-21 23:25:15 +0000281 dst.z = src0.x * src1.x + src0.y * src1.y + src2.x
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800282
Keith Whitwella62aaa72009-12-21 23:25:15 +0000283 dst.w = src0.x * src1.x + src0.y * src1.y + src2.x
284
285
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800286FRAC - Fraction
287
288.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000289
290 dst.x = src.x - floor(src.x)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800291
Keith Whitwella62aaa72009-12-21 23:25:15 +0000292 dst.y = src.y - floor(src.y)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800293
Keith Whitwella62aaa72009-12-21 23:25:15 +0000294 dst.z = src.z - floor(src.z)
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800295
Keith Whitwella62aaa72009-12-21 23:25:15 +0000296 dst.w = src.w - floor(src.w)
297
298
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800299CLAMP - Clamp
300
301.. math::
Keith Whitwella62aaa72009-12-21 23:25:15 +0000302
303 dst.x = clamp(src0.x, src1.x, src2.x)
304 dst.y = clamp(src0.y, src1.y, src2.y)
305 dst.z = clamp(src0.z, src1.z, src2.z)
306 dst.w = clamp(src0.w, src1.w, src2.w)
307
308
Keith Whitwell14eacb02009-12-21 23:38:29 +00003091.3.8 FLR - Floor
Keith Whitwella62aaa72009-12-21 23:25:15 +0000310
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800311.. math::
312
Keith Whitwella62aaa72009-12-21 23:25:15 +0000313 dst.x = floor(src.x)
314 dst.y = floor(src.y)
315 dst.z = floor(src.z)
316 dst.w = floor(src.w)
317
318
3191.3.9 ROUND - Round
320
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800321.. math::
322
Keith Whitwella62aaa72009-12-21 23:25:15 +0000323 dst.x = round(src.x)
324 dst.y = round(src.y)
325 dst.z = round(src.z)
326 dst.w = round(src.w)
327
328
Keith Whitwell14eacb02009-12-21 23:38:29 +00003291.3.10 EX2 - Exponential Base 2
Keith Whitwella62aaa72009-12-21 23:25:15 +0000330
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800331.. math::
332
Keith Whitwella62aaa72009-12-21 23:25:15 +0000333 dst.x = pow(2.0, src.x)
334 dst.y = pow(2.0, src.x)
335 dst.z = pow(2.0, src.x)
336 dst.w = pow(2.0, src.x)
337
338
Keith Whitwell14eacb02009-12-21 23:38:29 +00003391.3.11 LG2 - Logarithm Base 2
Keith Whitwella62aaa72009-12-21 23:25:15 +0000340
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800341.. math::
342
Keith Whitwella62aaa72009-12-21 23:25:15 +0000343 dst.x = lg2(src.x)
344 dst.y = lg2(src.x)
345 dst.z = lg2(src.x)
346 dst.w = lg2(src.x)
347
348
Keith Whitwell14eacb02009-12-21 23:38:29 +00003491.3.12 POW - Power
Keith Whitwella62aaa72009-12-21 23:25:15 +0000350
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800351.. math::
352
Keith Whitwella62aaa72009-12-21 23:25:15 +0000353 dst.x = pow(src0.x, src1.x)
354 dst.y = pow(src0.x, src1.x)
355 dst.z = pow(src0.x, src1.x)
356 dst.w = pow(src0.x, src1.x)
357
Keith Whitwell14eacb02009-12-21 23:38:29 +00003581.3.15 XPD - Cross Product
Keith Whitwella62aaa72009-12-21 23:25:15 +0000359
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800360.. math::
361
Keith Whitwella62aaa72009-12-21 23:25:15 +0000362 dst.x = src0.y * src1.z - src1.y * src0.z
363 dst.y = src0.z * src1.x - src1.z * src0.x
364 dst.z = src0.x * src1.y - src1.x * src0.y
365 dst.w = 1.0
366
367
Keith Whitwella62aaa72009-12-21 23:25:15 +00003681.4.1 ABS - Absolute
369
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800370.. math::
371
Keith Whitwella62aaa72009-12-21 23:25:15 +0000372 dst.x = abs(src.x)
373 dst.y = abs(src.y)
374 dst.z = abs(src.z)
375 dst.w = abs(src.w)
376
377
3781.4.2 RCC - Reciprocal Clamped
379
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800380.. math::
381
Keith Whitwella62aaa72009-12-21 23:25:15 +0000382 dst.x = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020)
383 dst.y = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020)
384 dst.z = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020)
385 dst.w = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020)
386
387
3881.4.3 DPH - Homogeneous Dot Product
389
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800390.. math::
391
Keith Whitwella62aaa72009-12-21 23:25:15 +0000392 dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w
393 dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w
394 dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w
395 dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w
396
397
Keith Whitwella62aaa72009-12-21 23:25:15 +00003981.5.1 COS - Cosine
399
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800400.. math::
401
Keith Whitwella62aaa72009-12-21 23:25:15 +0000402 dst.x = cos(src.x)
403 dst.y = cos(src.x)
404 dst.z = cos(src.x)
405 dst.w = cos(src.w)
406
407
4081.5.2 DDX - Derivative Relative To X
409
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800410.. math::
411
Keith Whitwella62aaa72009-12-21 23:25:15 +0000412 dst.x = partialx(src.x)
413 dst.y = partialx(src.y)
414 dst.z = partialx(src.z)
415 dst.w = partialx(src.w)
416
417
4181.5.3 DDY - Derivative Relative To Y
419
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800420.. math::
421
Keith Whitwella62aaa72009-12-21 23:25:15 +0000422 dst.x = partialy(src.x)
423 dst.y = partialy(src.y)
424 dst.z = partialy(src.z)
425 dst.w = partialy(src.w)
426
427
Keith Whitwella62aaa72009-12-21 23:25:15 +00004281.5.7 KILP - Predicated Discard
429
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800430.. math::
431
Keith Whitwella62aaa72009-12-21 23:25:15 +0000432 discard
433
434
Keith Whitwella62aaa72009-12-21 23:25:15 +00004351.5.10 PK2H - Pack Two 16-bit Floats
436
437 TBD
438
439
4401.5.11 PK2US - Pack Two Unsigned 16-bit Scalars
441
442 TBD
443
444
4451.5.12 PK4B - Pack Four Signed 8-bit Scalars
446
447 TBD
448
449
4501.5.13 PK4UB - Pack Four Unsigned 8-bit Scalars
451
452 TBD
453
454
Keith Whitwella62aaa72009-12-21 23:25:15 +00004551.5.15 RFL - Reflection Vector
456
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800457.. math::
458
Keith Whitwella62aaa72009-12-21 23:25:15 +0000459 dst.x = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.x - src1.x
460 dst.y = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.y - src1.y
461 dst.z = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.z - src1.z
462 dst.w = 1.0
463
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800464Considered for removal.
Keith Whitwell14eacb02009-12-21 23:38:29 +0000465
Keith Whitwella62aaa72009-12-21 23:25:15 +0000466
4671.5.16 SEQ - Set On Equal
468
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800469.. math::
470
Keith Whitwella62aaa72009-12-21 23:25:15 +0000471 dst.x = (src0.x == src1.x) ? 1.0 : 0.0
472 dst.y = (src0.y == src1.y) ? 1.0 : 0.0
473 dst.z = (src0.z == src1.z) ? 1.0 : 0.0
474 dst.w = (src0.w == src1.w) ? 1.0 : 0.0
475
476
4771.5.17 SFL - Set On False
478
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800479.. math::
480
Keith Whitwella62aaa72009-12-21 23:25:15 +0000481 dst.x = 0.0
482 dst.y = 0.0
483 dst.z = 0.0
484 dst.w = 0.0
485
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800486Considered for removal.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000487
4881.5.18 SGT - Set On Greater Than
489
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800490.. math::
491
Keith Whitwella62aaa72009-12-21 23:25:15 +0000492 dst.x = (src0.x > src1.x) ? 1.0 : 0.0
493 dst.y = (src0.y > src1.y) ? 1.0 : 0.0
494 dst.z = (src0.z > src1.z) ? 1.0 : 0.0
495 dst.w = (src0.w > src1.w) ? 1.0 : 0.0
496
497
4981.5.19 SIN - Sine
499
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800500.. math::
501
Keith Whitwella62aaa72009-12-21 23:25:15 +0000502 dst.x = sin(src.x)
503 dst.y = sin(src.x)
504 dst.z = sin(src.x)
505 dst.w = sin(src.w)
506
507
5081.5.20 SLE - Set On Less Equal Than
509
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800510.. math::
511
Keith Whitwella62aaa72009-12-21 23:25:15 +0000512 dst.x = (src0.x <= src1.x) ? 1.0 : 0.0
513 dst.y = (src0.y <= src1.y) ? 1.0 : 0.0
514 dst.z = (src0.z <= src1.z) ? 1.0 : 0.0
515 dst.w = (src0.w <= src1.w) ? 1.0 : 0.0
516
517
5181.5.21 SNE - Set On Not Equal
519
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800520.. math::
521
Keith Whitwella62aaa72009-12-21 23:25:15 +0000522 dst.x = (src0.x != src1.x) ? 1.0 : 0.0
523 dst.y = (src0.y != src1.y) ? 1.0 : 0.0
524 dst.z = (src0.z != src1.z) ? 1.0 : 0.0
525 dst.w = (src0.w != src1.w) ? 1.0 : 0.0
526
527
5281.5.22 STR - Set On True
529
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800530.. math::
531
Keith Whitwella62aaa72009-12-21 23:25:15 +0000532 dst.x = 1.0
533 dst.y = 1.0
534 dst.z = 1.0
535 dst.w = 1.0
536
537
5381.5.23 TEX - Texture Lookup
539
540 TBD
541
542
5431.5.24 TXD - Texture Lookup with Derivatives
544
545 TBD
546
547
5481.5.25 TXP - Projective Texture Lookup
549
550 TBD
551
552
5531.5.26 UP2H - Unpack Two 16-Bit Floats
554
555 TBD
556
Keith Whitwell14eacb02009-12-21 23:38:29 +0000557 Considered for removal.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000558
5591.5.27 UP2US - Unpack Two Unsigned 16-Bit Scalars
560
561 TBD
562
Keith Whitwell14eacb02009-12-21 23:38:29 +0000563 Considered for removal.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000564
5651.5.28 UP4B - Unpack Four Signed 8-Bit Values
566
567 TBD
568
Keith Whitwell14eacb02009-12-21 23:38:29 +0000569 Considered for removal.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000570
5711.5.29 UP4UB - Unpack Four Unsigned 8-Bit Scalars
572
573 TBD
574
Keith Whitwell14eacb02009-12-21 23:38:29 +0000575 Considered for removal.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000576
5771.5.30 X2D - 2D Coordinate Transformation
578
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800579.. math::
580
Keith Whitwella62aaa72009-12-21 23:25:15 +0000581 dst.x = src0.x + src1.x * src2.x + src1.y * src2.y
582 dst.y = src0.y + src1.x * src2.z + src1.y * src2.w
583 dst.z = src0.x + src1.x * src2.x + src1.y * src2.y
584 dst.w = src0.y + src1.x * src2.z + src1.y * src2.w
585
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800586Considered for removal.
Keith Whitwell14eacb02009-12-21 23:38:29 +0000587
Keith Whitwella62aaa72009-12-21 23:25:15 +0000588
5891.6 GL_NV_vertex_program2
590--------------------------
591
592
5931.6.1 ARA - Address Register Add
594
595 TBD
596
Keith Whitwell14eacb02009-12-21 23:38:29 +0000597 Considered for removal.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000598
5991.6.2 ARR - Address Register Load With Round
600
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800601.. math::
602
Keith Whitwella62aaa72009-12-21 23:25:15 +0000603 dst.x = round(src.x)
604 dst.y = round(src.y)
605 dst.z = round(src.z)
606 dst.w = round(src.w)
607
608
6091.6.3 BRA - Branch
610
611 pc = target
612
Keith Whitwell14eacb02009-12-21 23:38:29 +0000613 Considered for removal.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000614
6151.6.4 CAL - Subroutine Call
616
617 push(pc)
618 pc = target
619
620
6211.6.5 RET - Subroutine Call Return
622
623 pc = pop()
624
Keith Whitwell14eacb02009-12-21 23:38:29 +0000625 Potential restrictions:
626 * Only occurs at end of function.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000627
6281.6.6 SSG - Set Sign
629
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800630.. math::
631
Keith Whitwella62aaa72009-12-21 23:25:15 +0000632 dst.x = (src.x > 0.0) ? 1.0 : (src.x < 0.0) ? -1.0 : 0.0
633 dst.y = (src.y > 0.0) ? 1.0 : (src.y < 0.0) ? -1.0 : 0.0
634 dst.z = (src.z > 0.0) ? 1.0 : (src.z < 0.0) ? -1.0 : 0.0
635 dst.w = (src.w > 0.0) ? 1.0 : (src.w < 0.0) ? -1.0 : 0.0
636
637
Keith Whitwella62aaa72009-12-21 23:25:15 +00006381.8.1 CMP - Compare
639
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800640.. math::
641
Keith Whitwella62aaa72009-12-21 23:25:15 +0000642 dst.x = (src0.x < 0.0) ? src1.x : src2.x
643 dst.y = (src0.y < 0.0) ? src1.y : src2.y
644 dst.z = (src0.z < 0.0) ? src1.z : src2.z
645 dst.w = (src0.w < 0.0) ? src1.w : src2.w
646
647
6481.8.2 KIL - Conditional Discard
649
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800650.. math::
651
Keith Whitwella62aaa72009-12-21 23:25:15 +0000652 if (src.x < 0.0 || src.y < 0.0 || src.z < 0.0 || src.w < 0.0)
653 discard
654 endif
655
656
6571.8.3 SCS - Sine Cosine
658
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800659.. math::
660
Keith Whitwella62aaa72009-12-21 23:25:15 +0000661 dst.x = cos(src.x)
662 dst.y = sin(src.x)
663 dst.z = 0.0
664 dst.y = 1.0
665
666
6671.8.4 TXB - Texture Lookup With Bias
668
669 TBD
670
671
Keith Whitwella62aaa72009-12-21 23:25:15 +00006721.9.1 NRM - 3-component Vector Normalise
673
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800674.. math::
675
Keith Whitwella62aaa72009-12-21 23:25:15 +0000676 dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z)
677 dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z)
678 dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z)
679 dst.w = 1.0
680
681
6821.9.2 DIV - Divide
683
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800684.. math::
685
Keith Whitwella62aaa72009-12-21 23:25:15 +0000686 dst.x = src0.x / src1.x
687 dst.y = src0.y / src1.y
688 dst.z = src0.z / src1.z
689 dst.w = src0.w / src1.w
690
691
6921.9.3 DP2 - 2-component Dot Product
693
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800694.. math::
695
Keith Whitwella62aaa72009-12-21 23:25:15 +0000696 dst.x = src0.x * src1.x + src0.y * src1.y
697 dst.y = src0.x * src1.x + src0.y * src1.y
698 dst.z = src0.x * src1.x + src0.y * src1.y
699 dst.w = src0.x * src1.x + src0.y * src1.y
700
701
Keith Whitwella62aaa72009-12-21 23:25:15 +00007021.9.5 TXL - Texture Lookup With LOD
703
704 TBD
705
706
7071.9.6 BRK - Break
708
709 TBD
710
711
7121.9.7 IF - If
713
714 TBD
715
716
7171.9.8 BGNFOR - Begin a For-Loop
718
719 dst.x = floor(src.x)
720 dst.y = floor(src.y)
721 dst.z = floor(src.z)
722
723 if (dst.y <= 0)
724 pc = [matching ENDFOR] + 1
725 endif
726
727 Note: The destination must be a loop register.
728 The source must be a constant register.
729
Keith Whitwell14eacb02009-12-21 23:38:29 +0000730 Considered for cleanup / removal.
731
Keith Whitwella62aaa72009-12-21 23:25:15 +0000732
7331.9.9 REP - Repeat
734
735 TBD
736
737
7381.9.10 ELSE - Else
739
740 TBD
741
742
7431.9.11 ENDIF - End If
744
745 TBD
746
747
7481.9.12 ENDFOR - End a For-Loop
749
750 dst.x = dst.x + dst.z
751 dst.y = dst.y - 1.0
752
753 if (dst.y > 0)
754 pc = [matching BGNFOR instruction] + 1
755 endif
756
757 Note: The destination must be a loop register.
758
Keith Whitwell14eacb02009-12-21 23:38:29 +0000759 Considered for cleanup / removal.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000760
7611.9.13 ENDREP - End Repeat
762
763 TBD
764
765
Keith Whitwella62aaa72009-12-21 23:25:15 +00007661.10.1 PUSHA - Push Address Register On Stack
767
768 push(src.x)
769 push(src.y)
770 push(src.z)
771 push(src.w)
772
Keith Whitwell14eacb02009-12-21 23:38:29 +0000773 Considered for cleanup / removal.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000774
7751.10.2 POPA - Pop Address Register From Stack
776
777 dst.w = pop()
778 dst.z = pop()
779 dst.y = pop()
780 dst.x = pop()
781
Keith Whitwell14eacb02009-12-21 23:38:29 +0000782 Considered for cleanup / removal.
783
Keith Whitwella62aaa72009-12-21 23:25:15 +0000784
7851.11 GL_NV_gpu_program4
786------------------------
787
Keith Whitwell14eacb02009-12-21 23:38:29 +0000788Support for these opcodes indicated by a special pipe capability bit (TBD).
Keith Whitwella62aaa72009-12-21 23:25:15 +0000789
7901.11.1 CEIL - Ceiling
791
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800792.. math::
793
Keith Whitwella62aaa72009-12-21 23:25:15 +0000794 dst.x = ceil(src.x)
795 dst.y = ceil(src.y)
796 dst.z = ceil(src.z)
797 dst.w = ceil(src.w)
798
799
8001.11.2 I2F - Integer To Float
801
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800802.. math::
803
Keith Whitwella62aaa72009-12-21 23:25:15 +0000804 dst.x = (float) src.x
805 dst.y = (float) src.y
806 dst.z = (float) src.z
807 dst.w = (float) src.w
808
809
8101.11.3 NOT - Bitwise Not
811
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800812.. math::
813
Keith Whitwella62aaa72009-12-21 23:25:15 +0000814 dst.x = ~src.x
815 dst.y = ~src.y
816 dst.z = ~src.z
817 dst.w = ~src.w
818
819
8201.11.4 TRUNC - Truncate
821
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800822.. math::
823
Keith Whitwella62aaa72009-12-21 23:25:15 +0000824 dst.x = trunc(src.x)
825 dst.y = trunc(src.y)
826 dst.z = trunc(src.z)
827 dst.w = trunc(src.w)
828
829
8301.11.5 SHL - Shift Left
831
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800832.. math::
833
Keith Whitwella62aaa72009-12-21 23:25:15 +0000834 dst.x = src0.x << src1.x
835 dst.y = src0.y << src1.x
836 dst.z = src0.z << src1.x
837 dst.w = src0.w << src1.x
838
839
8401.11.6 SHR - Shift Right
841
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800842.. math::
843
Keith Whitwella62aaa72009-12-21 23:25:15 +0000844 dst.x = src0.x >> src1.x
845 dst.y = src0.y >> src1.x
846 dst.z = src0.z >> src1.x
847 dst.w = src0.w >> src1.x
848
849
8501.11.7 AND - Bitwise And
851
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800852.. math::
853
Keith Whitwella62aaa72009-12-21 23:25:15 +0000854 dst.x = src0.x & src1.x
855 dst.y = src0.y & src1.y
856 dst.z = src0.z & src1.z
857 dst.w = src0.w & src1.w
858
859
8601.11.8 OR - Bitwise Or
861
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800862.. math::
863
Keith Whitwella62aaa72009-12-21 23:25:15 +0000864 dst.x = src0.x | src1.x
865 dst.y = src0.y | src1.y
866 dst.z = src0.z | src1.z
867 dst.w = src0.w | src1.w
868
869
8701.11.9 MOD - Modulus
871
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800872.. math::
873
Keith Whitwella62aaa72009-12-21 23:25:15 +0000874 dst.x = src0.x % src1.x
875 dst.y = src0.y % src1.y
876 dst.z = src0.z % src1.z
877 dst.w = src0.w % src1.w
878
879
8801.11.10 XOR - Bitwise Xor
881
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800882.. math::
883
Keith Whitwella62aaa72009-12-21 23:25:15 +0000884 dst.x = src0.x ^ src1.x
885 dst.y = src0.y ^ src1.y
886 dst.z = src0.z ^ src1.z
887 dst.w = src0.w ^ src1.w
888
889
8901.11.11 SAD - Sum Of Absolute Differences
891
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800892.. math::
893
Keith Whitwella62aaa72009-12-21 23:25:15 +0000894 dst.x = abs(src0.x - src1.x) + src2.x
895 dst.y = abs(src0.y - src1.y) + src2.y
896 dst.z = abs(src0.z - src1.z) + src2.z
897 dst.w = abs(src0.w - src1.w) + src2.w
898
899
9001.11.12 TXF - Texel Fetch
901
902 TBD
903
904
9051.11.13 TXQ - Texture Size Query
906
907 TBD
908
909
9101.11.14 CONT - Continue
911
912 TBD
913
914
9151.12 GL_NV_geometry_program4
916-----------------------------
917
918
9191.12.1 EMIT - Emit
920
921 TBD
922
923
9241.12.2 ENDPRIM - End Primitive
925
926 TBD
927
928
9291.13 GLSL
930----------
931
932
9331.13.1 BGNLOOP - Begin a Loop
934
935 TBD
936
937
9381.13.2 BGNSUB - Begin Subroutine
939
940 TBD
941
942
9431.13.3 ENDLOOP - End a Loop
944
945 TBD
946
947
9481.13.4 ENDSUB - End Subroutine
949
950 TBD
951
952
Keith Whitwella62aaa72009-12-21 23:25:15 +0000953
9541.13.10 NOP - No Operation
955
956 Do nothing.
957
958
Keith Whitwella62aaa72009-12-21 23:25:15 +0000959
9601.16.7 NRM4 - 4-component Vector Normalise
961
Corbin Simpsone8ed3b92009-12-21 19:12:55 -0800962.. math::
963
Keith Whitwella62aaa72009-12-21 23:25:15 +0000964 dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w)
965 dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w)
966 dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w)
967 dst.w = src.w / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w)
968
969
Keith Whitwella62aaa72009-12-21 23:25:15 +00009701.17 ps_2_x
971------------
972
973
Keith Whitwella62aaa72009-12-21 23:25:15 +00009741.17.2 CALLNZ - Subroutine Call If Not Zero
975
976 TBD
977
978
9791.17.3 IFC - If
980
981 TBD
982
983
Keith Whitwella62aaa72009-12-21 23:25:15 +00009841.17.5 BREAKC - Break Conditional
985
986 TBD
987
988
Keith Whitwella62aaa72009-12-21 23:25:15 +00009892 Explanation of symbols used
990==============================
991
992
9932.1 Functions
994--------------
995
996
997 abs(x) Absolute value of x.
Keith Whitwella62aaa72009-12-21 23:25:15 +0000998 (x < 0.0) ? -x : x
999
1000 ceil(x) Ceiling of x.
1001
1002 clamp(x,y,z) Clamp x between y and z.
1003 (x < y) ? y : (x > z) ? z : x
1004
1005 cos(x) Cosine of x.
1006
1007 floor(x) Floor of x.
1008
1009 lg2(x) Logarithm base 2 of x.
1010
1011 max(x,y) Maximum of x and y.
1012 (x > y) ? x : y
1013
1014 min(x,y) Minimum of x and y.
1015 (x < y) ? x : y
1016
1017 partialx(x) Derivative of x relative to fragment's X.
1018
1019 partialy(x) Derivative of x relative to fragment's Y.
1020
1021 pop() Pop from stack.
1022
1023 pow(x,y) Raise x to power of y.
1024
1025 push(x) Push x on stack.
1026
1027 round(x) Round x.
1028
1029 sin(x) Sine of x.
1030
1031 sqrt(x) Square root of x.
1032
1033 trunc(x) Truncate x.
1034
1035
10362.2 Keywords
1037-------------
1038
1039
1040 discard Discard fragment.
1041
1042 dst First destination register.
1043
1044 dst0 First destination register.
1045
1046 pc Program counter.
1047
1048 src First source register.
1049
1050 src0 First source register.
1051
1052 src1 Second source register.
1053
1054 src2 Third source register.
1055
1056 target Label of target instruction.
1057
1058
10593 Other tokens
1060===============
1061
1062
10633.1 Declaration Semantic
1064-------------------------
1065
1066
1067 Follows Declaration token if Semantic bit is set.
1068
1069 Since its purpose is to link a shader with other stages of the pipeline,
1070 it is valid to follow only those Declaration tokens that declare a register
1071 either in INPUT or OUTPUT file.
1072
1073 SemanticName field contains the semantic name of the register being declared.
1074 There is no default value.
1075
1076 SemanticIndex is an optional subscript that can be used to distinguish
1077 different register declarations with the same semantic name. The default value
1078 is 0.
1079
1080 The meanings of the individual semantic names are explained in the following
1081 sections.
1082
1083
10843.1.1 FACE
1085
1086 Valid only in a fragment shader INPUT declaration.
1087
1088 FACE.x is negative when the primitive is back facing. FACE.x is positive
1089 when the primitive is front facing.