Changeset 3598 for trunk/src/opengl/mesa/3dfx/fxrender.c
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/3dfx/fxrender.c
r2938 r3598 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 60 60 * endpoints must be clipped. 61 61 */ 62 #if !defined(__MWERKS__) 62 #if !defined(__MWERKS__) 63 63 INLINE 64 64 #endif 65 void fxRenderClippedLine( struct vertex_buffer *VB, 66 65 void fxRenderClippedLine( struct vertex_buffer *VB, 66 GLuint v1, GLuint v2 ) 67 67 { 68 68 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; … … 79 79 */ 80 80 INLINE void fxRenderClippedTriangle( struct vertex_buffer *VB, 81 81 GLuint n, GLuint vlist[] ) 82 82 { 83 83 GLubyte mask = 0; … … 92 92 return; 93 93 } 94 94 95 95 n = (VB->ctx->poly_clip_tab[VB->ClipPtr->size])( VB, n, vlist, mask ); 96 96 if (n >= 3) { … … 100 100 GrVertex *i2 = (GrVertex *)gWin[vlist[2]].f; 101 101 GLuint i; 102 102 103 103 for (i=2;i<n;i++, i1 = i2, i2 = (GrVertex *)gWin[vlist[i]].f) { 104 104 FX_grDrawTriangle(i0,i1,i2); … … 111 111 112 112 113 static INLINE void fxSafeClippedLine( struct vertex_buffer *VB, 114 113 static INLINE void fxSafeClippedLine( struct vertex_buffer *VB, 114 GLuint v1, GLuint v2 ) 115 115 { 116 116 GLubyte mask = VB->ClipMask[v1] | VB->ClipMask[v2]; … … 127 127 128 128 static INLINE void fxSafeClippedTriangle( struct vertex_buffer *VB, 129 130 131 129 fxVertex *gWin, 130 tfxTriClipFunc cliptri, 131 GLuint v2, GLuint v1, GLuint v ) 132 132 { 133 133 GLubyte *clipmask = VB->ClipMask; … … 136 136 if (!mask) { 137 137 FX_grDrawTriangle((GrVertex *)gWin[v2].f, 138 139 138 (GrVertex *)gWin[v1].f, 139 (GrVertex *)gWin[v].f); 140 140 return; 141 141 } … … 149 149 GLubyte *userclipmask = VB->UserClipMask; 150 150 if (userclipmask[v2] & userclipmask[v1] & userclipmask[v]) 151 151 return; 152 152 imask |= (userclipmask[v2] | userclipmask[v1] | userclipmask[v]) << 8; 153 153 } … … 160 160 161 161 static INLINE void fxSafeClippedTriangle2( struct vertex_buffer *VB, 162 163 164 162 fxVertex *gWin, 163 tfxTriViewClipFunc cliptri, 164 GLuint v2, GLuint v1, GLuint v ) 165 165 { 166 166 GLubyte *clipmask = VB->ClipMask; … … 169 169 if (!mask) { 170 170 FX_grDrawTriangle((GrVertex *)gWin[v2].f,(GrVertex *)gWin[v1].f, 171 171 (GrVertex *)gWin[v].f); 172 172 } else if (!(clipmask[v2] & clipmask[v1] & clipmask[v])) { 173 173 GLuint vl[3]; … … 179 179 180 180 static INLINE void fxSafeClippedTriangle3( struct vertex_buffer *VB, 181 182 183 181 fxVertex *gWin, 182 tfxTriClipFunc cliptri, 183 GLuint v2, GLuint v1, GLuint v ) 184 184 { 185 185 GLubyte *clipmask = VB->ClipMask; … … 213 213 */ 214 214 215 #define RENDER_POINTS( start, count ) 216 (void) gWin; 217 (void) VB; 215 #define RENDER_POINTS( start, count ) \ 216 (void) gWin; \ 217 (void) VB; \ 218 218 (VB->ctx->Driver.PointsFunc)( VB->ctx, start, count-1 ) 219 219 220 #define RENDER_LINE( i1, i ) 221 do { 222 RVB_COLOR(i); 223 FX_grDrawLine((GrVertex *)gWin[i1].f, 224 (GrVertex *)gWin[i].f);\225 } while (0) 226 227 #define RENDER_TRI( i2, i1, i, pv, parity ) 228 do { 229 RVB_COLOR(pv); 230 if (parity) { 231 FX_grDrawTriangle((GrVertex *)gWin[i1].f, 232 (GrVertex *)gWin[i2].f,\233 (GrVertex *)gWin[i].f);\234 } else { 235 FX_grDrawTriangle((GrVertex *)gWin[i2].f, 236 (GrVertex *)gWin[i1].f,\237 (GrVertex *)gWin[i].f);\238 } 239 } while (0) 240 241 #define RENDER_QUAD( i3, i2, i1, i, pv ) 242 do { 243 RVB_COLOR(pv); 244 FX_grDrawTriangle((GrVertex *)gWin[i3].f, 245 (GrVertex *)gWin[i2].f,\246 (GrVertex *)gWin[i].f);\247 FX_grDrawTriangle((GrVertex *)gWin[i2].f, 248 (GrVertex *)gWin[i1].f,\249 (GrVertex *)gWin[i].f);\250 } while (0) 251 252 253 254 #define LOCAL_VARS 255 fxMesaContext fxMesa=(fxMesaContext)VB->ctx->DriverCtx; 256 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; 220 #define RENDER_LINE( i1, i ) \ 221 do { \ 222 RVB_COLOR(i); \ 223 FX_grDrawLine((GrVertex *)gWin[i1].f, \ 224 (GrVertex *)gWin[i].f); \ 225 } while (0) 226 227 #define RENDER_TRI( i2, i1, i, pv, parity ) \ 228 do { \ 229 RVB_COLOR(pv); \ 230 if (parity) { \ 231 FX_grDrawTriangle((GrVertex *)gWin[i1].f, \ 232 (GrVertex *)gWin[i2].f, \ 233 (GrVertex *)gWin[i].f); \ 234 } else { \ 235 FX_grDrawTriangle((GrVertex *)gWin[i2].f, \ 236 (GrVertex *)gWin[i1].f, \ 237 (GrVertex *)gWin[i].f); \ 238 } \ 239 } while (0) 240 241 #define RENDER_QUAD( i3, i2, i1, i, pv ) \ 242 do { \ 243 RVB_COLOR(pv); \ 244 FX_grDrawTriangle((GrVertex *)gWin[i3].f, \ 245 (GrVertex *)gWin[i2].f, \ 246 (GrVertex *)gWin[i].f); \ 247 FX_grDrawTriangle((GrVertex *)gWin[i2].f, \ 248 (GrVertex *)gWin[i1].f, \ 249 (GrVertex *)gWin[i].f); \ 250 } while (0) 251 252 253 254 #define LOCAL_VARS \ 255 fxMesaContext fxMesa=(fxMesaContext)VB->ctx->DriverCtx; \ 256 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; \ 257 257 (void) fxMesa; 258 258 259 #define INIT(x) 259 #define INIT(x) 260 260 261 261 #define TAG(x) x##_fx_flat_raw … … 276 276 /* Render with clipped and/or culled primitives with cullmask information. 277 277 */ 278 #define RENDER_POINTS( start, count ) 279 (void) gWin; 280 (void) cullmask; 278 #define RENDER_POINTS( start, count ) \ 279 (void) gWin; \ 280 (void) cullmask; \ 281 281 (VB->ctx->Driver.PointsFunc)( VB->ctx, start, count-1 ) 282 282 283 283 284 #define RENDER_LINE( i1, i ) 285 do { 286 const GLubyte flags = cullmask[i]; 287 288 if (!(flags & PRIM_NOT_CULLED)) 289 continue; 290 291 RVB_COLOR(i); 292 if (flags & PRIM_ANY_CLIP) 293 fxRenderClippedLine( VB, i1, i ); 294 else 295 FX_grDrawLine( (GrVertex *)gWin[i1].f, (GrVertex *)gWin[i].f ); 284 #define RENDER_LINE( i1, i ) \ 285 do { \ 286 const GLubyte flags = cullmask[i]; \ 287 \ 288 if (!(flags & PRIM_NOT_CULLED)) \ 289 continue; \ 290 \ 291 RVB_COLOR(i); \ 292 if (flags & PRIM_ANY_CLIP) \ 293 fxRenderClippedLine( VB, i1, i ); \ 294 else \ 295 FX_grDrawLine( (GrVertex *)gWin[i1].f, (GrVertex *)gWin[i].f ); \ 296 296 } while (0) 297 297 298 298 299 #define RENDER_TRI( i2, i1, i, pv, parity) 300 do { 301 const GLubyte flags = cullmask[i]; 302 GLuint e2,e1; 303 304 if (!(flags & PRIM_NOT_CULLED)) 305 continue; 306 307 e2=i2, e1=i1; 308 if (parity) { e2=i1; e1=i2; } 309 310 RVB_COLOR(pv); 311 if (flags & PRIM_ANY_CLIP) { 312 fxSafeClippedTriangle3(VB,gWin,cliptri,e2,e1,i); 313 } else { 314 FX_grDrawTriangle((GrVertex *)gWin[e2].f, 315 (GrVertex *)gWin[e1].f,\316 (GrVertex *)gWin[i].f);\317 } 318 } while (0) 319 320 321 #define RENDER_QUAD(i3, i2, i1, i, pv) 322 do { 323 const GLubyte flags = cullmask[i]; 324 325 if (!(flags & PRIM_NOT_CULLED)) 326 continue; 327 328 RVB_COLOR(pv); 329 if (flags&PRIM_ANY_CLIP) { 330 fxSafeClippedTriangle3(VB,gWin,cliptri,i3,i2,i); 331 fxSafeClippedTriangle3(VB,gWin,cliptri,i2,i1,i); 332 } else { 333 FX_grDrawTriangle((GrVertex *)gWin[i3].f, 334 (GrVertex *)gWin[i2].f,\335 (GrVertex *)gWin[i].f);\336 FX_grDrawTriangle((GrVertex *)gWin[i2].f, 337 (GrVertex *)gWin[i1].f,\338 (GrVertex *)gWin[i].f);\339 } 340 } while (0) 341 342 343 344 345 346 #define LOCAL_VARS 347 fxMesaContext fxMesa=(fxMesaContext)VB->ctx->DriverCtx; 348 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; 349 const GLubyte *cullmask = VB->CullMask; 299 #define RENDER_TRI( i2, i1, i, pv, parity) \ 300 do { \ 301 const GLubyte flags = cullmask[i]; \ 302 GLuint e2,e1; \ 303 \ 304 if (!(flags & PRIM_NOT_CULLED)) \ 305 continue; \ 306 \ 307 e2=i2, e1=i1; \ 308 if (parity) { e2=i1; e1=i2; } \ 309 \ 310 RVB_COLOR(pv); \ 311 if (flags & PRIM_ANY_CLIP) { \ 312 fxSafeClippedTriangle3(VB,gWin,cliptri,e2,e1,i); \ 313 } else { \ 314 FX_grDrawTriangle((GrVertex *)gWin[e2].f, \ 315 (GrVertex *)gWin[e1].f, \ 316 (GrVertex *)gWin[i].f); \ 317 } \ 318 } while (0) 319 320 321 #define RENDER_QUAD(i3, i2, i1, i, pv) \ 322 do { \ 323 const GLubyte flags = cullmask[i]; \ 324 \ 325 if (!(flags & PRIM_NOT_CULLED)) \ 326 continue; \ 327 \ 328 RVB_COLOR(pv); \ 329 if (flags&PRIM_ANY_CLIP) { \ 330 fxSafeClippedTriangle3(VB,gWin,cliptri,i3,i2,i); \ 331 fxSafeClippedTriangle3(VB,gWin,cliptri,i2,i1,i); \ 332 } else { \ 333 FX_grDrawTriangle((GrVertex *)gWin[i3].f, \ 334 (GrVertex *)gWin[i2].f, \ 335 (GrVertex *)gWin[i].f); \ 336 FX_grDrawTriangle((GrVertex *)gWin[i2].f, \ 337 (GrVertex *)gWin[i1].f, \ 338 (GrVertex *)gWin[i].f); \ 339 } \ 340 } while (0) 341 342 343 344 345 346 #define LOCAL_VARS \ 347 fxMesaContext fxMesa=(fxMesaContext)VB->ctx->DriverCtx; \ 348 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; \ 349 const GLubyte *cullmask = VB->CullMask; \ 350 350 tfxTriClipFunc cliptri = fxMesa->clip_tri_stride; 351 351 … … 371 371 372 372 /* Direct, with the possibility of clipping. 373 */ 374 #define RENDER_POINTS( start, count ) 375 do { 376 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; 377 GLubyte *clipmask = VB->ClipMask; 378 GLuint i; 379 for (i = start ; i <= count ; i++) 380 if (clipmask[i] == 0) { 381 RVB_COLOR(i); 373 */ 374 #define RENDER_POINTS( start, count ) \ 375 do { \ 376 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; \ 377 GLubyte *clipmask = VB->ClipMask; \ 378 GLuint i; \ 379 for (i = start ; i <= count ; i++) \ 380 if (clipmask[i] == 0) { \ 381 RVB_COLOR(i); \ 382 382 FX_grDrawPoint( (GrVertex *)gWin[i].f );\ 383 } 384 } while (0) 385 386 #define RENDER_LINE( i1, i ) 387 do { 388 RVB_COLOR(i); 389 fxSafeClippedLine( VB, i1, i ); 390 } while (0) 391 392 #define RENDER_TRI( i2, i1, i, pv, parity) 393 do { 394 GLuint e2=i2, e1=i1; 395 if (parity) { GLuint t=e2; e2=e1; e1=t; } 396 RVB_COLOR(pv); 397 fxSafeClippedTriangle(VB,gWin,cliptri,e2,e1,i); 398 } while (0) 399 400 #define RENDER_QUAD( i3, i2, i1, i, pv) 401 do { 402 RVB_COLOR(pv); 403 fxSafeClippedTriangle(VB,gWin,cliptri,i3,i2,i); 404 fxSafeClippedTriangle(VB,gWin,cliptri,i2,i1,i); 405 } while (0) 406 407 #define LOCAL_VARS 408 fxMesaContext fxMesa=(fxMesaContext)VB->ctx->DriverCtx; 409 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; 383 } \ 384 } while (0) 385 386 #define RENDER_LINE( i1, i ) \ 387 do { \ 388 RVB_COLOR(i); \ 389 fxSafeClippedLine( VB, i1, i ); \ 390 } while (0) 391 392 #define RENDER_TRI( i2, i1, i, pv, parity) \ 393 do { \ 394 GLuint e2=i2, e1=i1; \ 395 if (parity) { GLuint t=e2; e2=e1; e1=t; } \ 396 RVB_COLOR(pv); \ 397 fxSafeClippedTriangle(VB,gWin,cliptri,e2,e1,i); \ 398 } while (0) 399 400 #define RENDER_QUAD( i3, i2, i1, i, pv) \ 401 do { \ 402 RVB_COLOR(pv); \ 403 fxSafeClippedTriangle(VB,gWin,cliptri,i3,i2,i); \ 404 fxSafeClippedTriangle(VB,gWin,cliptri,i2,i1,i); \ 405 } while (0) 406 407 #define LOCAL_VARS \ 408 fxMesaContext fxMesa=(fxMesaContext)VB->ctx->DriverCtx; \ 409 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; \ 410 410 tfxTriClipFunc cliptri = fxMesa->clip_tri_stride; 411 411 … … 430 430 431 431 /* Indirect, with the possibility of clipping. 432 */ 433 #define RENDER_POINTS( start, count ) 434 do { 435 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; 436 GLuint e; 437 GLubyte *clipmask = VB->ClipMask; 438 for(e=start;e<=count;e++) 439 if(clipmask[elt[e]]==0) { 440 FX_grDrawPoint((GrVertex *)gWin[elt[e]].f); 441 } 442 } while (0) 443 444 #define RENDER_LINE( i1, i ) 445 do { 446 GLuint e1 = elt[i1], e = elt[i]; 447 RVB_COLOR(e); 448 fxSafeClippedLine( VB, e1, e ); 449 } while (0) 450 451 #define RENDER_TRI( i2, i1, i, pv, parity) 452 do { 453 GLuint e2 = elt[i2], e1 = elt[i1], e = elt[i]; 454 if (parity) { GLuint t=e2; e2=e1; e1=t; } 455 fxSafeClippedTriangle(VB,gWin,cliptri,e2,e1,e); 456 } while (0) 457 458 #define RENDER_QUAD( i3, i2, i1, i, pv) 459 do { 432 */ 433 #define RENDER_POINTS( start, count ) \ 434 do { \ 435 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; \ 436 GLuint e; \ 437 GLubyte *clipmask = VB->ClipMask; \ 438 for(e=start;e<=count;e++) \ 439 if(clipmask[elt[e]]==0) { \ 440 FX_grDrawPoint((GrVertex *)gWin[elt[e]].f); \ 441 } \ 442 } while (0) 443 444 #define RENDER_LINE( i1, i ) \ 445 do { \ 446 GLuint e1 = elt[i1], e = elt[i]; \ 447 RVB_COLOR(e); \ 448 fxSafeClippedLine( VB, e1, e ); \ 449 } while (0) 450 451 #define RENDER_TRI( i2, i1, i, pv, parity) \ 452 do { \ 453 GLuint e2 = elt[i2], e1 = elt[i1], e = elt[i]; \ 454 if (parity) { GLuint t=e2; e2=e1; e1=t; } \ 455 fxSafeClippedTriangle(VB,gWin,cliptri,e2,e1,e); \ 456 } while (0) 457 458 #define RENDER_QUAD( i3, i2, i1, i, pv) \ 459 do { \ 460 460 GLuint e3 = elt[i3], e2 = elt[i2], e1 = elt[i1], e = elt[i];\ 461 fxSafeClippedTriangle(VB,gWin,cliptri,e3,e2,e); 462 fxSafeClippedTriangle(VB,gWin,cliptri,e2,e1,e); 463 } while (0) 464 465 #define LOCAL_VARS const GLuint *elt = VB->EltPtr->data; 466 fxMesaContext fxMesa = (fxMesaContext)VB->ctx->DriverCtx; 467 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; 461 fxSafeClippedTriangle(VB,gWin,cliptri,e3,e2,e); \ 462 fxSafeClippedTriangle(VB,gWin,cliptri,e2,e1,e); \ 463 } while (0) 464 465 #define LOCAL_VARS const GLuint *elt = VB->EltPtr->data; \ 466 fxMesaContext fxMesa = (fxMesaContext)VB->ctx->DriverCtx; \ 467 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; \ 468 468 tfxTriClipFunc cliptri = fxMesa->clip_tri_stride; 469 469 … … 478 478 /* Indirect, clipped, but no user clip. 479 479 */ 480 #define RENDER_POINTS( start, count ) 481 do { 482 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; 483 GLuint e; 484 GLubyte *clipmask = VB->ClipMask; 485 for(e=start;e<=count;e++) 486 if(clipmask[elt[e]]==0) { 487 FX_grDrawPoint((GrVertex *)gWin[elt[e]].f); 488 } 489 } while (0) 490 491 #define RENDER_LINE( i1, i ) 492 do { 493 GLuint e1 = elt[i1], e = elt[i]; 494 RVB_COLOR(e); 495 fxSafeClippedLine( VB, e1, e ); 496 } while (0) 497 498 #define RENDER_TRI( i2, i1, i, pv, parity) 499 do { 500 GLuint e2 = elt[i2], e1 = elt[i1], e = elt[i]; 501 if (parity) { GLuint t=e2; e2=e1; e1=t; } 502 fxSafeClippedTriangle2(VB,gWin,cliptri,e2,e1,e); 503 } while (0) 504 505 #define RENDER_QUAD( i3, i2, i1, i, pv) 506 do { 480 #define RENDER_POINTS( start, count ) \ 481 do { \ 482 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; \ 483 GLuint e; \ 484 GLubyte *clipmask = VB->ClipMask; \ 485 for(e=start;e<=count;e++) \ 486 if(clipmask[elt[e]]==0) { \ 487 FX_grDrawPoint((GrVertex *)gWin[elt[e]].f); \ 488 } \ 489 } while (0) 490 491 #define RENDER_LINE( i1, i ) \ 492 do { \ 493 GLuint e1 = elt[i1], e = elt[i]; \ 494 RVB_COLOR(e); \ 495 fxSafeClippedLine( VB, e1, e ); \ 496 } while (0) 497 498 #define RENDER_TRI( i2, i1, i, pv, parity) \ 499 do { \ 500 GLuint e2 = elt[i2], e1 = elt[i1], e = elt[i]; \ 501 if (parity) { GLuint t=e2; e2=e1; e1=t; } \ 502 fxSafeClippedTriangle2(VB,gWin,cliptri,e2,e1,e); \ 503 } while (0) 504 505 #define RENDER_QUAD( i3, i2, i1, i, pv) \ 506 do { \ 507 507 GLuint e3 = elt[i3], e2 = elt[i2], e1 = elt[i1], e = elt[i];\ 508 fxSafeClippedTriangle2(VB,gWin,cliptri,e3,e2,e); 509 fxSafeClippedTriangle2(VB,gWin,cliptri,e2,e1,e); 510 } while (0) 511 512 #define LOCAL_VARS const GLuint *elt = VB->EltPtr->data; 513 fxMesaContext fxMesa = (fxMesaContext)VB->ctx->DriverCtx; 514 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; 508 fxSafeClippedTriangle2(VB,gWin,cliptri,e3,e2,e); \ 509 fxSafeClippedTriangle2(VB,gWin,cliptri,e2,e1,e); \ 510 } while (0) 511 512 #define LOCAL_VARS const GLuint *elt = VB->EltPtr->data; \ 513 fxMesaContext fxMesa = (fxMesaContext)VB->ctx->DriverCtx; \ 514 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; \ 515 515 tfxTriViewClipFunc cliptri = fxMesa->view_clip_tri; 516 516 … … 530 530 /* Indirect, and no clipping required. 531 531 */ 532 #define RENDER_POINTS( start, count ) 533 do { 534 GLuint e; 535 for(e=start;e<=count;e++) { 536 FX_grDrawPoint((GrVertex *)gWin[elt[e]].f); 537 } 538 } while (0) 539 540 #define RENDER_LINE( i1, i ) 541 do { 542 GLuint e1 = elt[i1], e = elt[i]; 543 FX_grDrawLine((GrVertex *)gWin[e1].f, (GrVertex *)gWin[e].f); 544 } while (0) 545 546 547 #define RENDER_TRI( i2, i1, i, pv, parity) 548 do { 549 GLuint e2 = elt[i2], e1 = elt[i1], e = elt[i]; 550 if (parity) {GLuint tmp = e2; e2 = e1; e1 = tmp;} 551 FX_grDrawTriangle((GrVertex *)gWin[e2].f, 552 (GrVertex *)gWin[e1].f,\553 (GrVertex *)gWin[e].f);\554 } while (0) 555 556 557 #define RENDER_QUAD( i3, i2, i1, i, pv) 558 do { 532 #define RENDER_POINTS( start, count ) \ 533 do { \ 534 GLuint e; \ 535 for(e=start;e<=count;e++) { \ 536 FX_grDrawPoint((GrVertex *)gWin[elt[e]].f); \ 537 } \ 538 } while (0) 539 540 #define RENDER_LINE( i1, i ) \ 541 do { \ 542 GLuint e1 = elt[i1], e = elt[i]; \ 543 FX_grDrawLine((GrVertex *)gWin[e1].f, (GrVertex *)gWin[e].f); \ 544 } while (0) 545 546 547 #define RENDER_TRI( i2, i1, i, pv, parity) \ 548 do { \ 549 GLuint e2 = elt[i2], e1 = elt[i1], e = elt[i]; \ 550 if (parity) {GLuint tmp = e2; e2 = e1; e1 = tmp;} \ 551 FX_grDrawTriangle((GrVertex *)gWin[e2].f, \ 552 (GrVertex *)gWin[e1].f, \ 553 (GrVertex *)gWin[e].f); \ 554 } while (0) 555 556 557 #define RENDER_QUAD( i3, i2, i1, i, pv) \ 558 do { \ 559 559 GLuint e3 = elt[i3], e2 = elt[i2], e1 = elt[i1], e = elt[i];\ 560 FX_grDrawTriangle((GrVertex *)gWin[e3].f, 561 (GrVertex *)gWin[e2].f,\562 (GrVertex *)gWin[e].f);\563 FX_grDrawTriangle((GrVertex *)gWin[e2].f, 564 (GrVertex *)gWin[e1].f,\565 (GrVertex *)gWin[e].f);\566 } while (0) 567 568 #define LOCAL_VARS 569 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; 560 FX_grDrawTriangle((GrVertex *)gWin[e3].f, \ 561 (GrVertex *)gWin[e2].f, \ 562 (GrVertex *)gWin[e].f); \ 563 FX_grDrawTriangle((GrVertex *)gWin[e2].f, \ 564 (GrVertex *)gWin[e1].f, \ 565 (GrVertex *)gWin[e].f); \ 566 } while (0) 567 568 #define LOCAL_VARS \ 569 fxVertex *gWin = FX_DRIVER_DATA(VB)->verts; \ 570 570 const GLuint *elt = VB->EltPtr->data; 571 571 572 #define INIT(x) 572 #define INIT(x) 573 573 574 574 #define TAG(x) x##_fx_smooth_indirect … … 586 586 * 'safe' set of clipping routines which don't require write-access to 587 587 * the arrays in the vertex buffer, and don't care about array 588 * stride. 589 * 590 * Thus there is no call to gl_import_arrays() in this function. 588 * stride. 589 * 590 * Thus there is no call to gl_import_arrays() in this function. 591 591 * 592 592 * This safe clipping should be generalized to call driver->trianglefunc … … 606 606 GLuint p = 0; 607 607 608 if (!nr) 608 if (!nr) 609 609 return; 610 610 611 if (fxMesa->new_state) 611 if (fxMesa->new_state) 612 612 fxSetupFXUnits(ctx); 613 613 … … 619 619 func = render_tab_fx_smooth_indirect_clipped[prim]; 620 620 } 621 622 ctx->VB = VB; 621 622 ctx->VB = VB; /* kludge */ 623 623 624 624 do { 625 625 func( VB, 0, nr, 0 ); 626 626 } while (ctx->Driver.MultipassFunc && 627 627 ctx->Driver.MultipassFunc( VB, ++p )); 628 628 629 629 … … 644 644 if (cvaVB->ClipOrMask) 645 645 tab = render_tab_fx_smooth_indirect_clipped; 646 646 647 647 if (!VB->CullDone) 648 648 gl_fast_copy_vb( VB ); 649 649 650 if (fxMesa->new_state) 650 if (fxMesa->new_state) 651 651 fxSetupFXUnits( ctx ); 652 652 … … 657 657 GLuint parity = VB->Parity; 658 658 659 for (i = VB->CopyStart ; i < count ; parity = 0, i = next) 659 for (i = VB->CopyStart ; i < count ; parity = 0, i = next) 660 660 { 661 661 GLuint prim = VB->Primitive[i]; … … 665 665 /* loop never taken */ 666 666 } while (ctx->Driver.MultipassFunc && 667 667 ctx->Driver.MultipassFunc( cvaVB, ++p )); 668 668 669 669 cvaVB->EltPtr = 0; … … 719 719 fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx; 720 720 721 if (ctx->IndirectTriangles & DD_SW_SETUP) 722 return null_tables; 721 if (ctx->IndirectTriangles & DD_SW_SETUP) 722 return null_tables; 723 723 724 724 switch (fxMesa->render_index) { … … 726 726 return fxDDRenderVBFlat_tables; 727 727 case 0: 728 return fxDDRenderVBSmooth_tables; 728 return fxDDRenderVBSmooth_tables; 729 729 default: 730 return null_tables; 730 return null_tables; 731 731 } 732 732 } … … 743 743 GLint p = 0; 744 744 745 if (fxMesa->new_state) 745 if (fxMesa->new_state) 746 746 fxSetupFXUnits(ctx); 747 747 748 if (VB->Indirect) { 749 return; 748 if (VB->Indirect) { 749 return; 750 750 } else if (VB->CullMode & CLIP_MASK_ACTIVE) { 751 751 tab = fxMesa->RenderVBClippedTab; … … 758 758 759 759 do 760 { 761 for ( i= VB->CopyStart ; i < count ; parity = 0, i = next ) 760 { 761 for ( i= VB->CopyStart ; i < count ; parity = 0, i = next ) 762 762 { 763 764 765 763 prim = VB->Primitive[i]; 764 next = VB->NextPrimitive[i]; 765 tab[prim]( VB, i, next, parity ); 766 766 } 767 767 768 768 } while (ctx->Driver.MultipassFunc && 769 769 ctx->Driver.MultipassFunc( VB, ++p )); 770 770 } 771 771
Note:
See TracChangeset
for help on using the changeset viewer.