1<html> 2 3<head> 4<title>GX Vertex Performance Calculator</title> 5<meta NAME="Author" Confiltered="Rob Moore (NTD), based on data from Eric Demers (ArtX)."> 6<meta NAME="Description" Confiltered="vertex performance calculator."> 7<meta NAME="KeyWords" Confiltered="Java, JavaScript, Calculators"> 8<meta NAME="Classification" Confiltered="Revolution Tools"> 9<script LANGUAGE="JavaScript1.2"> 10<!-- hide this script tag's contents from old browsers ---> 11// 12// Compute peak vertex performance 13// 14function VtxPerf( f ) 15{ 16 var geo_perf; 17 var lit_perf; 18 var in_perf; 19 var out_perf; 20 var perf; 21 var tg_stq = parseInt(f.n_texgen_stq[f.n_texgen_stq.selectedIndex].value); 22 var tg_st = parseInt(f.n_texgen_st[f.n_texgen_st.selectedIndex].value); 23 var bmap = parseInt(f.n_bm[f.n_bm.selectedIndex].value); 24 var srtg = parseInt(f.n_srtg[f.n_srtg.selectedIndex].value); 25 var nchan = parseInt(f.n_chans[f.n_chans.selectedIndex].value); 26 var alltg = tg_stq + tg_st + bmap + srtg; 27 var alltgp = 3*tg_stq + 3*tg_st + (8+1)*bmap + (4+1)*srtg; 28 var en_ch0 = ((nchan > 0) || (srtg > 0)); 29 var en_ch1 = ((nchan > 1) || (srtg > 1)); 30 var lit_c0 = parseInt(f.n_clr0[f.n_clr0.selectedIndex].value); 31 var lit_a0 = parseInt(f.n_a0[f.n_a0.selectedIndex].value); 32 var lit_c1 = parseInt(f.n_clr1[f.n_clr1.selectedIndex].value); 33 var lit_a1 = parseInt(f.n_a1[f.n_a1.selectedIndex].value); 34 var lits = lit_c0*en_ch0 + lit_a0*en_ch0 + 35 lit_c1*en_ch1 + lit_a1*en_ch1; 36 var texin = parseInt(f.gx_va_tex[f.gx_va_tex.selectedIndex].value); 37 var nrmin = parseInt(f.gx_va_nrm[f.gx_va_nrm.selectedIndex].value); 38 var clrin = parseInt(f.gx_va_clr[f.gx_va_clr.selectedIndex].value); 39 var posi = parseInt(f.gx_va_pnmtxidx[f.gx_va_pnmtxidx.selectedIndex].value); 40 var texi = 0; 41 var idxin = 0; 42 var i; 43 44 // 45 // geometry performance 46 // 47 if (alltg > 8) { 48 alert("Error: The sum total of tex coords generated must be <= 8"); 49 } 50 51 if (tg_stq == 0 && tg_st == 1) { 52 geo_perf = 4 + 2 + nchan; // fast texture case 53 } else { 54 geo_perf = 4 + 3*(tg_stq + tg_st) + nchan; 55 } 56 57 // 58 // lighting performance 59 // 60 if (!en_ch0 && (lit_c0 || lit_a0)) { 61 alert("Warning: Channel 0 is not output, although lights for channel 0 are enabled."); 62 } 63 64 if (!en_ch1 && (lit_c1 || lit_a1)) { 65 alert("Warning: Channel 1 is not output, although lights for channel 1 are enabled."); 66 } 67 68 if (nchan == 0 && bmap == 0 && srtg == 0) { 69 lit_perf = 0; 70 } 71 72 if (!lits && !clrin && (nchan || srtg)) { 73 alert("Warning: Lighting is on, but no lights are enabled (output color = register or vertex color)."); 74 75 lit_perf = 4 + 8*bmap + 1; 76 } else { 77 lit_perf = 4*lits + 8*bmap + 1; 78 } 79 80 81 // 82 // Input data performance 83 // 84 for (i = 1; i < 9; i++) { 85 if (f.gx_va_texmtxidx.options[i].selected) { 86 texi = texi | (1 << (i-1)); 87 } 88 } 89 90 if (posi || (texi & 0xf)) { 91 idxin = 1; 92 } 93 94 if (texi & 0xf0) { 95 idxin++; 96 } 97 98 in_perf = 3 + 2*texin + 3*nrmin + clrin + idxin; 99 100 // 101 // Output data performance 102 // 103 out_perf = 3 + alltgp + nchan; 104 if (out_perf < 5) { 105 out_perf = 5; 106 } 107 108 if (!alltg && !nchan) { 109 alert("Warning: No color channels output and no tex coords generated (output color = constant)."); 110 } 111 112 // 113 // Total performance = max cycles 114 // 115 if (lit_perf < geo_perf) { 116 if (in_perf < geo_perf) { 117 if (out_perf < geo_perf) { 118 perf = geo_perf; 119 } else { 120 perf = out_perf; 121 } 122 } else { 123 if (out_perf < in_perf) { 124 perf = in_perf; 125 } else { 126 perf = out_perf; 127 } 128 } 129 } else { 130 if (in_perf < lit_perf) { 131 if (out_perf < lit_perf) { 132 perf = lit_perf; 133 } else { 134 perf = out_perf; 135 } 136 } else { 137 if (out_perf < in_perf) { 138 perf = in_perf; 139 } else { 140 perf = out_perf; 141 } 142 } 143 } 144 // write output values 145 f.texgencyc.value = geo_perf; 146 f.litcyc.value = lit_perf; 147 f.incyc.value = in_perf; 148 f.outcyc.value = out_perf; 149 f.n_cyc_vtx.value = perf; 150 f.n_vtx_sec.value = Math.round(243 * 100 / perf) / 100; 151} 152 153<!-- done hiding from old browsers --> 154</script> 155</head> 156 157<body BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#551A8B" ALINK="#0000FF"> 158 159<h5 align="center">This JavaScript calculator was tested to work with Microsoft Internet Explorer 4 and 5, and Netscape Navigator 4.04 </h5> 160 161<h1 ALIGN="CENTER">Vertex Performance Calculator</h1> 162<b> 163 164<p align="center">This calculator will estimate the peak vertex performance of the Graphics Processor. </b></p> 165 166<p align="center">Please enter data for the three categories of information below.<br> Press "Compute Performance" to see the results further below.<br> Warnings may appear, but the results will still be computed.</p> 167 168<hr> 169 170<p align="center">Input Data </p> 171 172<hr> 173 174<form name="myform"> 175 <table border="0"> 176 <tr> 177 <td colspan="2"><b>Vertex Descriptor</b></td> 178 <td></td> 179 </tr> 180 <tr> 181 <td>Position</td> 182 <td><select NAME="gx_va_pos" size="1"> 183 <option selected VALUE="1">(x,y,z) </option> 184 </select> </td> 185 </tr> 186 <tr> 187 <td>Normals</td> 188 <td><select NAME="gx_va_nrm" size="1"> 189 <option selected VALUE="0">None </option> 190 <option VALUE="1">1 </option> 191 <option VALUE="3">3 </option> 192 </select> </td> 193 </tr> 194 <tr> 195 <td>Colors</td> 196 <td><select NAME="gx_va_clr" size="1"> 197 <option selected VALUE="0">None </option> 198 <option VALUE="1">1 </option> 199 <option VALUE="2">2 </option> 200 </select> </td> 201 </tr> 202 <tr> 203 <td>Texture Coordinates</td> 204 <td><select NAME="gx_va_tex" size="1"> 205 <option selected VALUE="0">None </option> 206 <option VALUE="1">1 </option> 207 <option VALUE="2">2 </option> 208 <option VALUE="3">3 </option> 209 <option VALUE="4">4 </option> 210 <option VALUE="5">5 </option> 211 <option VALUE="6">6 </option> 212 <option VALUE="7">7 </option> 213 <option VALUE="8">8 </option> 214 </select> </td> 215 </tr> 216 <tr> 217 <td>Pos/Norm Matrix Index</td> 218 <td><select NAME="gx_va_pnmtxidx" size="1"> 219 <option selected VALUE="0">None </option> 220 <option VALUE="1">1 </option> 221 </select> </td> 222 </tr> 223 <tr> 224 <td>Texture Matrix Indices</td> 225 <td><select NAME="gx_va_texmtxidx" MULTIPLE SIZE="9"> 226 <option selected>None </option> 227 <option>1 </option> 228 <option>2 </option> 229 <option>3 </option> 230 <option>4 </option> 231 <option>5 </option> 232 <option>6 </option> 233 <option>7 </option> 234 <option>8 </option> 235 </select> </td> 236 </tr> 237 <tr> 238 <td colspan="2"><b>Texture Coordinate Generation</b></td> 239 </tr> 240 <tr> 241 <td>GX_TG_MTX2x4</td> 242 <td><select NAME="n_texgen_st" size="1"> 243 <option selected VALUE="0">None </option> 244 <option VALUE="1">1 </option> 245 <option VALUE="2">2 </option> 246 <option VALUE="3">3 </option> 247 <option VALUE="4">4 </option> 248 <option VALUE="5">5 </option> 249 <option VALUE="6">6 </option> 250 <option VALUE="7">7 </option> 251 <option VALUE="8">8 </option> 252 </select> </td> 253 </tr> 254 <tr> 255 <td>GX_TG_MTX3x4</td> 256 <td><select NAME="n_texgen_stq" size="1"> 257 <option selected VALUE="0">None </option> 258 <option VALUE="1">1 </option> 259 <option VALUE="2">2 </option> 260 <option VALUE="3">3 </option> 261 <option VALUE="4">4 </option> 262 <option VALUE="5">5 </option> 263 <option VALUE="6">6 </option> 264 <option VALUE="7">7 </option> 265 <option VALUE="8">8 </option> 266 </select> </td> 267 </tr> 268 <tr> 269 <td>GX_TG_BUMP*</td> 270 <td><select NAME="n_bm" size="1"> 271 <option selected VALUE="0">None </option> 272 <option VALUE="1">1 </option> 273 <option VALUE="2">2 </option> 274 <option VALUE="3">3 </option> 275 <option VALUE="4">4 </option> 276 </select> </td> 277 </tr> 278 <tr> 279 <td>GX_TG_SRTG</td> 280 <td><select NAME="n_srtg" size="1"> 281 <option selected VALUE="0">None </option> 282 <option VALUE="1">1 </option> 283 <option VALUE="2">2 </option> 284 </select> </td> 285 </tr> 286 <tr> 287 <td colspan="2"><b>Lighting</b></td> 288 </tr> 289 <tr> 290 <td>Lights GX_COLOR0</td> 291 <td><select NAME="n_clr0" size="1"> 292 <option selected VALUE="0">None </option> 293 <option VALUE="1">1 </option> 294 <option VALUE="2">2 </option> 295 <option VALUE="3">3 </option> 296 <option VALUE="4">4 </option> 297 <option VALUE="5">5 </option> 298 <option VALUE="6">6 </option> 299 <option VALUE="7">7 </option> 300 <option VALUE="8">8 </option> 301 </select> </td> 302 </tr> 303 <tr> 304 <td>Lights GX_ALPHA0</td> 305 <td><select NAME="n_a0" size="1"> 306 <option selected VALUE="0">None </option> 307 <option VALUE="1">1 </option> 308 <option VALUE="2">2 </option> 309 <option VALUE="3">3 </option> 310 <option VALUE="4">4 </option> 311 <option VALUE="5">5 </option> 312 <option VALUE="6">6 </option> 313 <option VALUE="7">7 </option> 314 <option VALUE="8">8 </option> 315 </select> </td> 316 </tr> 317 <tr> 318 <td>Lights GX_COLOR1</td> 319 <td><select NAME="n_clr1" size="1"> 320 <option selected VALUE="0">None </option> 321 <option VALUE="1">1 </option> 322 <option VALUE="2">2 </option> 323 <option VALUE="3">3 </option> 324 <option VALUE="4">4 </option> 325 <option VALUE="5">5 </option> 326 <option VALUE="6">6 </option> 327 <option VALUE="7">7 </option> 328 <option VALUE="8">8 </option> 329 </select> </td> 330 </tr> 331 <tr> 332 <td>Lights GX_ALPHA1</td> 333 <td><select NAME="n_a1" size="1"> 334 <option selected VALUE="0">None </option> 335 <option VALUE="1">1 </option> 336 <option VALUE="2">2 </option> 337 <option VALUE="3">3 </option> 338 <option VALUE="4">4 </option> 339 <option VALUE="5">5 </option> 340 <option VALUE="6">6 </option> 341 <option VALUE="7">7 </option> 342 <option VALUE="8">8 </option> 343 </select> </td> 344 </tr> 345 <tr> 346 <td>Light Channels Output</td> 347 <td><select NAME="n_chans" size="1"> 348 <option selected VALUE="0">None </option> 349 <option VALUE="1">1 </option> 350 <option VALUE="2">2 </option> 351 </select> </td> 352 </tr> 353 </table> 354 <p><br> 355 </p> 356 <hr> 357 <div align="center"><center><p>Computed Data </p> 358 </center></div><hr> 359 <p><input TYPE="BUTTON" NAME="calc" VALUE="Compute Performance" 360 ONCLICK="VtxPerf(this.form)"><br> 361 </p> 362 <table border="0"> 363 <tr> 364 <td>Tex Gen:</td> 365 <td><input TYPE="TEXT" NAME="texgencyc" MAXLENGTH="5" size="20"></td> 366 <td>cycles/vtx</td> 367 </tr> 368 <tr> 369 <td>Lighting:</td> 370 <td><input TYPE="TEXT" NAME="litcyc" MAXLENGTH="5" size="20"></td> 371 <td>cycles/vtx</td> 372 </tr> 373 <tr> 374 <td>Input:</td> 375 <td><input TYPE="TEXT" NAME="incyc" MAXLENGTH="5" size="20"></td> 376 <td>cycles/vtx</td> 377 </tr> 378 <tr> 379 <td>Output:</td> 380 <td><input TYPE="TEXT" NAME="outcyc" MAXLENGTH="5" size="20"></td> 381 <td>cycles/vtx</td> 382 </tr> 383 <tr> 384 <td>Max:</td> 385 <td><input TYPE="TEXT" NAME="n_cyc_vtx" MAXLENGTH="5" size="20"></td> 386 <td>cycles/vtx</td> 387 </tr> 388 <tr> 389 <td>Peak rate:</td> 390 <td><input TYPE="TEXT" NAME="n_vtx_sec" MAXLENGTH="5" size="20"></td> 391 <td>M vtx/sec</td> 392 </tr> 393 </table> 394</form> 395<noscript> 396 397<p>No JavaScript? Turn it on, or upgrade to Communicator.</p> 398<hr><p>CONFIDENTIAL</p></body> 399</html> 400