Corbin Simpson | c686e17 | 2009-12-20 15:00:40 -0800 | [diff] [blame] | 1 | TGSI |
| 2 | ==== |
| 3 | |
| 4 | TGSI, Tungsten Graphics Shader Instructions, is an intermediate language |
| 5 | for describing shaders. Since Gallium is inherently shaderful, shaders are |
| 6 | an important part of the API. TGSI is the only intermediate representation |
| 7 | used by all drivers. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 8 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 9 | From GL_NV_vertex_program |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 10 | ------------------------- |
| 11 | |
| 12 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 13 | ARL - Address Register Load |
| 14 | |
| 15 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 16 | |
| 17 | dst.x = floor(src.x) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 18 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 19 | dst.y = floor(src.y) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 20 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 21 | dst.z = floor(src.z) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 22 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 23 | dst.w = floor(src.w) |
| 24 | |
| 25 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 26 | MOV - Move |
| 27 | |
| 28 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 29 | |
| 30 | dst.x = src.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 31 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 32 | dst.y = src.y |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 33 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 34 | dst.z = src.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 35 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 36 | dst.w = src.w |
| 37 | |
| 38 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 39 | LIT - Light Coefficients |
| 40 | |
| 41 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 42 | |
| 43 | dst.x = 1.0 |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 44 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 45 | dst.y = max(src.x, 0.0) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 46 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 47 | dst.z = (src.x > 0.0) ? pow(max(src.y, 0.0), clamp(src.w, -128.0, 128.0)) : 0.0 |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 48 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 49 | dst.w = 1.0 |
| 50 | |
| 51 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 52 | RCP - Reciprocal |
| 53 | |
| 54 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 55 | |
| 56 | dst.x = 1.0 / src.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 57 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 58 | dst.y = 1.0 / src.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 59 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 60 | dst.z = 1.0 / src.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 61 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 62 | dst.w = 1.0 / src.x |
| 63 | |
| 64 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 65 | RSQ - Reciprocal Square Root |
| 66 | |
| 67 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 68 | |
| 69 | dst.x = 1.0 / sqrt(abs(src.x)) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 70 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 71 | dst.y = 1.0 / sqrt(abs(src.x)) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 72 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 73 | dst.z = 1.0 / sqrt(abs(src.x)) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 74 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 75 | dst.w = 1.0 / sqrt(abs(src.x)) |
| 76 | |
| 77 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 78 | EXP - Approximate Exponential Base 2 |
| 79 | |
| 80 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 81 | |
| 82 | dst.x = pow(2.0, floor(src.x)) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 83 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 84 | dst.y = src.x - floor(src.x) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 85 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 86 | dst.z = pow(2.0, src.x) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 87 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 88 | dst.w = 1.0 |
| 89 | |
| 90 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 91 | LOG - Approximate Logarithm Base 2 |
| 92 | |
| 93 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 94 | |
| 95 | dst.x = floor(lg2(abs(src.x))) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 96 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 97 | dst.y = abs(src.x) / pow(2.0, floor(lg2(abs(src.x)))) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 98 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 99 | dst.z = lg2(abs(src.x)) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 100 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 101 | dst.w = 1.0 |
| 102 | |
| 103 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 104 | MUL - Multiply |
| 105 | |
| 106 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 107 | |
| 108 | dst.x = src0.x * src1.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 109 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 110 | dst.y = src0.y * src1.y |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 111 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 112 | dst.z = src0.z * src1.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 113 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 114 | dst.w = src0.w * src1.w |
| 115 | |
| 116 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 117 | ADD - Add |
| 118 | |
| 119 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 120 | |
| 121 | dst.x = src0.x + src1.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 122 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 123 | dst.y = src0.y + src1.y |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 124 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 125 | dst.z = src0.z + src1.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 126 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 127 | dst.w = src0.w + src1.w |
| 128 | |
| 129 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 130 | DP3 - 3-component Dot Product |
| 131 | |
| 132 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 133 | |
| 134 | dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 135 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 136 | dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 137 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 138 | dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 139 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 140 | dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z |
| 141 | |
| 142 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 143 | DP4 - 4-component Dot Product |
| 144 | |
| 145 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 146 | |
| 147 | dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 148 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 149 | dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 150 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 151 | dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 152 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 153 | dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w |
| 154 | |
| 155 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 156 | DST - Distance Vector |
| 157 | |
| 158 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 159 | |
| 160 | dst.x = 1.0 |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 161 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 162 | dst.y = src0.y * src1.y |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 163 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 164 | dst.z = src0.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 165 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 166 | dst.w = src1.w |
| 167 | |
| 168 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 169 | MIN - Minimum |
| 170 | |
| 171 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 172 | |
| 173 | dst.x = min(src0.x, src1.x) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 174 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 175 | dst.y = min(src0.y, src1.y) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 176 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 177 | dst.z = min(src0.z, src1.z) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 178 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 179 | dst.w = min(src0.w, src1.w) |
| 180 | |
| 181 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 182 | MAX - Maximum |
| 183 | |
| 184 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 185 | |
| 186 | dst.x = max(src0.x, src1.x) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 187 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 188 | dst.y = max(src0.y, src1.y) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 189 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 190 | dst.z = max(src0.z, src1.z) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 191 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 192 | dst.w = max(src0.w, src1.w) |
| 193 | |
| 194 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 195 | SLT - Set On Less Than |
| 196 | |
| 197 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 198 | |
| 199 | dst.x = (src0.x < src1.x) ? 1.0 : 0.0 |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 200 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 201 | dst.y = (src0.y < src1.y) ? 1.0 : 0.0 |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 202 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 203 | dst.z = (src0.z < src1.z) ? 1.0 : 0.0 |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 204 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 205 | dst.w = (src0.w < src1.w) ? 1.0 : 0.0 |
| 206 | |
| 207 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 208 | SGE - Set On Greater Equal Than |
| 209 | |
| 210 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 211 | |
| 212 | dst.x = (src0.x >= src1.x) ? 1.0 : 0.0 |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 213 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 214 | dst.y = (src0.y >= src1.y) ? 1.0 : 0.0 |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 215 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 216 | dst.z = (src0.z >= src1.z) ? 1.0 : 0.0 |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 217 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 218 | dst.w = (src0.w >= src1.w) ? 1.0 : 0.0 |
| 219 | |
| 220 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 221 | MAD - Multiply And Add |
| 222 | |
| 223 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 224 | |
| 225 | dst.x = src0.x * src1.x + src2.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 226 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 227 | dst.y = src0.y * src1.y + src2.y |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 228 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 229 | dst.z = src0.z * src1.z + src2.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 230 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 231 | dst.w = src0.w * src1.w + src2.w |
| 232 | |
| 233 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 234 | SUB - Subtract |
| 235 | |
| 236 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 237 | |
| 238 | dst.x = src0.x - src1.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 239 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 240 | dst.y = src0.y - src1.y |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 241 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 242 | dst.z = src0.z - src1.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 243 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 244 | dst.w = src0.w - src1.w |
| 245 | |
| 246 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 247 | LRP - Linear Interpolate |
| 248 | |
| 249 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 250 | |
| 251 | dst.x = src0.x * (src1.x - src2.x) + src2.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 252 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 253 | dst.y = src0.y * (src1.y - src2.y) + src2.y |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 254 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 255 | dst.z = src0.z * (src1.z - src2.z) + src2.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 256 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 257 | dst.w = src0.w * (src1.w - src2.w) + src2.w |
| 258 | |
| 259 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 260 | CND - Condition |
| 261 | |
| 262 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 263 | |
| 264 | dst.x = (src2.x > 0.5) ? src0.x : src1.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 265 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 266 | dst.y = (src2.y > 0.5) ? src0.y : src1.y |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 267 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 268 | dst.z = (src2.z > 0.5) ? src0.z : src1.z |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 269 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 270 | dst.w = (src2.w > 0.5) ? src0.w : src1.w |
| 271 | |
| 272 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 273 | DP2A - 2-component Dot Product And Add |
| 274 | |
| 275 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 276 | |
| 277 | dst.x = src0.x * src1.x + src0.y * src1.y + src2.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 278 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 279 | dst.y = src0.x * src1.x + src0.y * src1.y + src2.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 280 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 281 | dst.z = src0.x * src1.x + src0.y * src1.y + src2.x |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 282 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 283 | dst.w = src0.x * src1.x + src0.y * src1.y + src2.x |
| 284 | |
| 285 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 286 | FRAC - Fraction |
| 287 | |
| 288 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 289 | |
| 290 | dst.x = src.x - floor(src.x) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 291 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 292 | dst.y = src.y - floor(src.y) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 293 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 294 | dst.z = src.z - floor(src.z) |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 295 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 296 | dst.w = src.w - floor(src.w) |
| 297 | |
| 298 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 299 | CLAMP - Clamp |
| 300 | |
| 301 | .. math:: |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 302 | |
| 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 Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 309 | 1.3.8 FLR - Floor |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 310 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 311 | .. math:: |
| 312 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 313 | 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 | |
| 319 | 1.3.9 ROUND - Round |
| 320 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 321 | .. math:: |
| 322 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 323 | 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 Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 329 | 1.3.10 EX2 - Exponential Base 2 |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 330 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 331 | .. math:: |
| 332 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 333 | 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 Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 339 | 1.3.11 LG2 - Logarithm Base 2 |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 340 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 341 | .. math:: |
| 342 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 343 | 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 Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 349 | 1.3.12 POW - Power |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 350 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 351 | .. math:: |
| 352 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 353 | 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 Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 358 | 1.3.15 XPD - Cross Product |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 359 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 360 | .. math:: |
| 361 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 362 | 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 Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 368 | 1.4.1 ABS - Absolute |
| 369 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 370 | .. math:: |
| 371 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 372 | 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 | |
| 378 | 1.4.2 RCC - Reciprocal Clamped |
| 379 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 380 | .. math:: |
| 381 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 382 | 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 | |
| 388 | 1.4.3 DPH - Homogeneous Dot Product |
| 389 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 390 | .. math:: |
| 391 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 392 | 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 Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 398 | 1.5.1 COS - Cosine |
| 399 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 400 | .. math:: |
| 401 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 402 | 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 | |
| 408 | 1.5.2 DDX - Derivative Relative To X |
| 409 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 410 | .. math:: |
| 411 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 412 | 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 | |
| 418 | 1.5.3 DDY - Derivative Relative To Y |
| 419 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 420 | .. math:: |
| 421 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 422 | 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 Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 428 | 1.5.7 KILP - Predicated Discard |
| 429 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 430 | .. math:: |
| 431 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 432 | discard |
| 433 | |
| 434 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 435 | 1.5.10 PK2H - Pack Two 16-bit Floats |
| 436 | |
| 437 | TBD |
| 438 | |
| 439 | |
| 440 | 1.5.11 PK2US - Pack Two Unsigned 16-bit Scalars |
| 441 | |
| 442 | TBD |
| 443 | |
| 444 | |
| 445 | 1.5.12 PK4B - Pack Four Signed 8-bit Scalars |
| 446 | |
| 447 | TBD |
| 448 | |
| 449 | |
| 450 | 1.5.13 PK4UB - Pack Four Unsigned 8-bit Scalars |
| 451 | |
| 452 | TBD |
| 453 | |
| 454 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 455 | 1.5.15 RFL - Reflection Vector |
| 456 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 457 | .. math:: |
| 458 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 459 | 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 Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 464 | Considered for removal. |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 465 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 466 | |
| 467 | 1.5.16 SEQ - Set On Equal |
| 468 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 469 | .. math:: |
| 470 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 471 | 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 | |
| 477 | 1.5.17 SFL - Set On False |
| 478 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 479 | .. math:: |
| 480 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 481 | dst.x = 0.0 |
| 482 | dst.y = 0.0 |
| 483 | dst.z = 0.0 |
| 484 | dst.w = 0.0 |
| 485 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 486 | Considered for removal. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 487 | |
| 488 | 1.5.18 SGT - Set On Greater Than |
| 489 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 490 | .. math:: |
| 491 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 492 | 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 | |
| 498 | 1.5.19 SIN - Sine |
| 499 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 500 | .. math:: |
| 501 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 502 | 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 | |
| 508 | 1.5.20 SLE - Set On Less Equal Than |
| 509 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 510 | .. math:: |
| 511 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 512 | 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 | |
| 518 | 1.5.21 SNE - Set On Not Equal |
| 519 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 520 | .. math:: |
| 521 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 522 | 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 | |
| 528 | 1.5.22 STR - Set On True |
| 529 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 530 | .. math:: |
| 531 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 532 | dst.x = 1.0 |
| 533 | dst.y = 1.0 |
| 534 | dst.z = 1.0 |
| 535 | dst.w = 1.0 |
| 536 | |
| 537 | |
| 538 | 1.5.23 TEX - Texture Lookup |
| 539 | |
| 540 | TBD |
| 541 | |
| 542 | |
| 543 | 1.5.24 TXD - Texture Lookup with Derivatives |
| 544 | |
| 545 | TBD |
| 546 | |
| 547 | |
| 548 | 1.5.25 TXP - Projective Texture Lookup |
| 549 | |
| 550 | TBD |
| 551 | |
| 552 | |
| 553 | 1.5.26 UP2H - Unpack Two 16-Bit Floats |
| 554 | |
| 555 | TBD |
| 556 | |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 557 | Considered for removal. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 558 | |
| 559 | 1.5.27 UP2US - Unpack Two Unsigned 16-Bit Scalars |
| 560 | |
| 561 | TBD |
| 562 | |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 563 | Considered for removal. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 564 | |
| 565 | 1.5.28 UP4B - Unpack Four Signed 8-Bit Values |
| 566 | |
| 567 | TBD |
| 568 | |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 569 | Considered for removal. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 570 | |
| 571 | 1.5.29 UP4UB - Unpack Four Unsigned 8-Bit Scalars |
| 572 | |
| 573 | TBD |
| 574 | |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 575 | Considered for removal. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 576 | |
| 577 | 1.5.30 X2D - 2D Coordinate Transformation |
| 578 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 579 | .. math:: |
| 580 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 581 | 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 Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 586 | Considered for removal. |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 587 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 588 | |
| 589 | 1.6 GL_NV_vertex_program2 |
| 590 | -------------------------- |
| 591 | |
| 592 | |
| 593 | 1.6.1 ARA - Address Register Add |
| 594 | |
| 595 | TBD |
| 596 | |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 597 | Considered for removal. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 598 | |
| 599 | 1.6.2 ARR - Address Register Load With Round |
| 600 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 601 | .. math:: |
| 602 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 603 | 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 | |
| 609 | 1.6.3 BRA - Branch |
| 610 | |
| 611 | pc = target |
| 612 | |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 613 | Considered for removal. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 614 | |
| 615 | 1.6.4 CAL - Subroutine Call |
| 616 | |
| 617 | push(pc) |
| 618 | pc = target |
| 619 | |
| 620 | |
| 621 | 1.6.5 RET - Subroutine Call Return |
| 622 | |
| 623 | pc = pop() |
| 624 | |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 625 | Potential restrictions: |
| 626 | * Only occurs at end of function. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 627 | |
| 628 | 1.6.6 SSG - Set Sign |
| 629 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 630 | .. math:: |
| 631 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 632 | 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 Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 638 | 1.8.1 CMP - Compare |
| 639 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 640 | .. math:: |
| 641 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 642 | 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 | |
| 648 | 1.8.2 KIL - Conditional Discard |
| 649 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 650 | .. math:: |
| 651 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 652 | if (src.x < 0.0 || src.y < 0.0 || src.z < 0.0 || src.w < 0.0) |
| 653 | discard |
| 654 | endif |
| 655 | |
| 656 | |
| 657 | 1.8.3 SCS - Sine Cosine |
| 658 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 659 | .. math:: |
| 660 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 661 | dst.x = cos(src.x) |
| 662 | dst.y = sin(src.x) |
| 663 | dst.z = 0.0 |
| 664 | dst.y = 1.0 |
| 665 | |
| 666 | |
| 667 | 1.8.4 TXB - Texture Lookup With Bias |
| 668 | |
| 669 | TBD |
| 670 | |
| 671 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 672 | 1.9.1 NRM - 3-component Vector Normalise |
| 673 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 674 | .. math:: |
| 675 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 676 | 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 | |
| 682 | 1.9.2 DIV - Divide |
| 683 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 684 | .. math:: |
| 685 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 686 | 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 | |
| 692 | 1.9.3 DP2 - 2-component Dot Product |
| 693 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 694 | .. math:: |
| 695 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 696 | 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 Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 702 | 1.9.5 TXL - Texture Lookup With LOD |
| 703 | |
| 704 | TBD |
| 705 | |
| 706 | |
| 707 | 1.9.6 BRK - Break |
| 708 | |
| 709 | TBD |
| 710 | |
| 711 | |
| 712 | 1.9.7 IF - If |
| 713 | |
| 714 | TBD |
| 715 | |
| 716 | |
| 717 | 1.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 Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 730 | Considered for cleanup / removal. |
| 731 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 732 | |
| 733 | 1.9.9 REP - Repeat |
| 734 | |
| 735 | TBD |
| 736 | |
| 737 | |
| 738 | 1.9.10 ELSE - Else |
| 739 | |
| 740 | TBD |
| 741 | |
| 742 | |
| 743 | 1.9.11 ENDIF - End If |
| 744 | |
| 745 | TBD |
| 746 | |
| 747 | |
| 748 | 1.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 Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 759 | Considered for cleanup / removal. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 760 | |
| 761 | 1.9.13 ENDREP - End Repeat |
| 762 | |
| 763 | TBD |
| 764 | |
| 765 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 766 | 1.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 Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 773 | Considered for cleanup / removal. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 774 | |
| 775 | 1.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 Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 782 | Considered for cleanup / removal. |
| 783 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 784 | |
| 785 | 1.11 GL_NV_gpu_program4 |
| 786 | ------------------------ |
| 787 | |
Keith Whitwell | 14eacb0 | 2009-12-21 23:38:29 +0000 | [diff] [blame] | 788 | Support for these opcodes indicated by a special pipe capability bit (TBD). |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 789 | |
| 790 | 1.11.1 CEIL - Ceiling |
| 791 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 792 | .. math:: |
| 793 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 794 | 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 | |
| 800 | 1.11.2 I2F - Integer To Float |
| 801 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 802 | .. math:: |
| 803 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 804 | 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 | |
| 810 | 1.11.3 NOT - Bitwise Not |
| 811 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 812 | .. math:: |
| 813 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 814 | dst.x = ~src.x |
| 815 | dst.y = ~src.y |
| 816 | dst.z = ~src.z |
| 817 | dst.w = ~src.w |
| 818 | |
| 819 | |
| 820 | 1.11.4 TRUNC - Truncate |
| 821 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 822 | .. math:: |
| 823 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 824 | 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 | |
| 830 | 1.11.5 SHL - Shift Left |
| 831 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 832 | .. math:: |
| 833 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 834 | 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 | |
| 840 | 1.11.6 SHR - Shift Right |
| 841 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 842 | .. math:: |
| 843 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 844 | 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 | |
| 850 | 1.11.7 AND - Bitwise And |
| 851 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 852 | .. math:: |
| 853 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 854 | 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 | |
| 860 | 1.11.8 OR - Bitwise Or |
| 861 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 862 | .. math:: |
| 863 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 864 | 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 | |
| 870 | 1.11.9 MOD - Modulus |
| 871 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 872 | .. math:: |
| 873 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 874 | 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 | |
| 880 | 1.11.10 XOR - Bitwise Xor |
| 881 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 882 | .. math:: |
| 883 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 884 | 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 | |
| 890 | 1.11.11 SAD - Sum Of Absolute Differences |
| 891 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 892 | .. math:: |
| 893 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 894 | 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 | |
| 900 | 1.11.12 TXF - Texel Fetch |
| 901 | |
| 902 | TBD |
| 903 | |
| 904 | |
| 905 | 1.11.13 TXQ - Texture Size Query |
| 906 | |
| 907 | TBD |
| 908 | |
| 909 | |
| 910 | 1.11.14 CONT - Continue |
| 911 | |
| 912 | TBD |
| 913 | |
| 914 | |
| 915 | 1.12 GL_NV_geometry_program4 |
| 916 | ----------------------------- |
| 917 | |
| 918 | |
| 919 | 1.12.1 EMIT - Emit |
| 920 | |
| 921 | TBD |
| 922 | |
| 923 | |
| 924 | 1.12.2 ENDPRIM - End Primitive |
| 925 | |
| 926 | TBD |
| 927 | |
| 928 | |
| 929 | 1.13 GLSL |
| 930 | ---------- |
| 931 | |
| 932 | |
| 933 | 1.13.1 BGNLOOP - Begin a Loop |
| 934 | |
| 935 | TBD |
| 936 | |
| 937 | |
| 938 | 1.13.2 BGNSUB - Begin Subroutine |
| 939 | |
| 940 | TBD |
| 941 | |
| 942 | |
| 943 | 1.13.3 ENDLOOP - End a Loop |
| 944 | |
| 945 | TBD |
| 946 | |
| 947 | |
| 948 | 1.13.4 ENDSUB - End Subroutine |
| 949 | |
| 950 | TBD |
| 951 | |
| 952 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 953 | |
| 954 | 1.13.10 NOP - No Operation |
| 955 | |
| 956 | Do nothing. |
| 957 | |
| 958 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 959 | |
| 960 | 1.16.7 NRM4 - 4-component Vector Normalise |
| 961 | |
Corbin Simpson | e8ed3b9 | 2009-12-21 19:12:55 -0800 | [diff] [blame^] | 962 | .. math:: |
| 963 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 964 | 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 Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 970 | 1.17 ps_2_x |
| 971 | ------------ |
| 972 | |
| 973 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 974 | 1.17.2 CALLNZ - Subroutine Call If Not Zero |
| 975 | |
| 976 | TBD |
| 977 | |
| 978 | |
| 979 | 1.17.3 IFC - If |
| 980 | |
| 981 | TBD |
| 982 | |
| 983 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 984 | 1.17.5 BREAKC - Break Conditional |
| 985 | |
| 986 | TBD |
| 987 | |
| 988 | |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 989 | 2 Explanation of symbols used |
| 990 | ============================== |
| 991 | |
| 992 | |
| 993 | 2.1 Functions |
| 994 | -------------- |
| 995 | |
| 996 | |
| 997 | abs(x) Absolute value of x. |
Keith Whitwell | a62aaa7 | 2009-12-21 23:25:15 +0000 | [diff] [blame] | 998 | (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 | |
| 1036 | 2.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 | |
| 1059 | 3 Other tokens |
| 1060 | =============== |
| 1061 | |
| 1062 | |
| 1063 | 3.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 | |
| 1084 | 3.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. |