Ignore:
Timestamp:
May 23, 2000, 10:41:28 PM (25 years ago)
Author:
jeroen
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/mesa/3dfx/fxrender.c

    r2938 r3598  
    33/*
    44 * Mesa 3-D graphics library
    5  * Version:  3.1
     5 * Version:  3.3
    66 *
    77 * Copyright (C) 1999  Brian Paul   All Rights Reserved.
     
    6060 * endpoints must be clipped.
    6161 */
    62 #if !defined(__MWERKS__) 
     62#if !defined(__MWERKS__)
    6363INLINE
    6464#endif
    65 void fxRenderClippedLine( struct vertex_buffer *VB, 
    66                                 GLuint v1, GLuint v2 )
     65void fxRenderClippedLine( struct vertex_buffer *VB,
     66                                GLuint v1, GLuint v2 )
    6767{
    6868  fxVertex *gWin = FX_DRIVER_DATA(VB)->verts;
     
    7979 */
    8080INLINE void fxRenderClippedTriangle( struct vertex_buffer *VB,
    81                                         GLuint n, GLuint vlist[] )
     81                                        GLuint n, GLuint vlist[] )
    8282{
    8383  GLubyte mask = 0;
     
    9292      return;
    9393  }
    94    
     94
    9595  n = (VB->ctx->poly_clip_tab[VB->ClipPtr->size])( VB, n, vlist, mask );
    9696  if (n >= 3) {
     
    100100    GrVertex *i2 = (GrVertex *)gWin[vlist[2]].f;
    101101    GLuint i;
    102      
     102
    103103    for (i=2;i<n;i++, i1 = i2, i2 = (GrVertex *)gWin[vlist[i]].f) {
    104104      FX_grDrawTriangle(i0,i1,i2);
     
    111111
    112112
    113 static INLINE void fxSafeClippedLine( struct vertex_buffer *VB, 
    114                                       GLuint v1, GLuint v2 )
     113static INLINE void fxSafeClippedLine( struct vertex_buffer *VB,
     114                                      GLuint v1, GLuint v2 )
    115115{
    116116  GLubyte mask = VB->ClipMask[v1] | VB->ClipMask[v2];
     
    127127
    128128static INLINE void fxSafeClippedTriangle( struct vertex_buffer *VB,
    129                                           fxVertex *gWin,
    130                                           tfxTriClipFunc cliptri,
    131                                           GLuint v2, GLuint v1, GLuint v )
     129                                          fxVertex *gWin,
     130                                          tfxTriClipFunc cliptri,
     131                                          GLuint v2, GLuint v1, GLuint v )
    132132{
    133133  GLubyte *clipmask = VB->ClipMask;
     
    136136  if (!mask) {
    137137    FX_grDrawTriangle((GrVertex *)gWin[v2].f,
    138                       (GrVertex *)gWin[v1].f,
    139                       (GrVertex *)gWin[v].f);
     138                      (GrVertex *)gWin[v1].f,
     139                      (GrVertex *)gWin[v].f);
    140140    return;
    141141  }
     
    149149      GLubyte *userclipmask = VB->UserClipMask;
    150150      if (userclipmask[v2] & userclipmask[v1] & userclipmask[v])
    151         return;
     151        return;
    152152      imask |= (userclipmask[v2] | userclipmask[v1] | userclipmask[v]) << 8;
    153153    }
     
    160160
    161161static INLINE void fxSafeClippedTriangle2( struct vertex_buffer *VB,
    162                                            fxVertex *gWin,
    163                                            tfxTriViewClipFunc cliptri,
    164                                            GLuint v2, GLuint v1, GLuint v )
     162                                           fxVertex *gWin,
     163                                           tfxTriViewClipFunc cliptri,
     164                                           GLuint v2, GLuint v1, GLuint v )
    165165{
    166166  GLubyte *clipmask = VB->ClipMask;
     
    169169  if (!mask) {
    170170    FX_grDrawTriangle((GrVertex *)gWin[v2].f,(GrVertex *)gWin[v1].f,
    171                       (GrVertex *)gWin[v].f);
     171                      (GrVertex *)gWin[v].f);
    172172  } else if (!(clipmask[v2] & clipmask[v1] & clipmask[v])) {
    173173    GLuint vl[3];
     
    179179
    180180static INLINE void fxSafeClippedTriangle3( struct vertex_buffer *VB,
    181                                            fxVertex *gWin,
    182                                            tfxTriClipFunc cliptri,
    183                                            GLuint v2, GLuint v1, GLuint v )
     181                                           fxVertex *gWin,
     182                                           tfxTriClipFunc cliptri,
     183                                           GLuint v2, GLuint v1, GLuint v )
    184184{
    185185  GLubyte *clipmask = VB->ClipMask;
     
    213213 */
    214214
    215 #define RENDER_POINTS( start, count )                           \
    216    (void) gWin;                                                 \
    217    (void) VB;                                                   \
     215#define RENDER_POINTS( start, count )                           \
     216   (void) gWin;                                                 \
     217   (void) VB;                                                   \
    218218   (VB->ctx->Driver.PointsFunc)( VB->ctx, start, count-1 )
    219219
    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;                  \
    257257   (void) fxMesa;
    258258
    259 #define INIT(x) 
     259#define INIT(x)
    260260
    261261#define TAG(x) x##_fx_flat_raw
     
    276276/* Render with clipped and/or culled primitives with cullmask information.
    277277 */
    278 #define RENDER_POINTS( start, count )                           \
    279    (void) gWin;                                                 \
    280    (void) cullmask;                                             \
     278#define RENDER_POINTS( start, count )                           \
     279   (void) gWin;                                                 \
     280   (void) cullmask;                                             \
    281281   (VB->ctx->Driver.PointsFunc)( VB->ctx, start, count-1 )
    282282
    283283
    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 );   \
    296296 } while (0)
    297297
    298298
    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;                      \
    350350   tfxTriClipFunc cliptri = fxMesa->clip_tri_stride;
    351351
     
    371371
    372372/* 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);                           \
    382382        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;                  \
    410410   tfxTriClipFunc cliptri = fxMesa->clip_tri_stride;
    411411
     
    430430
    431431/* 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 {                                                          \
    460460    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;                  \
    468468   tfxTriClipFunc cliptri = fxMesa->clip_tri_stride;
    469469
     
    478478/* Indirect, clipped, but no user clip.
    479479 */
    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 {                                                          \
    507507    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;                  \
    515515   tfxTriViewClipFunc cliptri = fxMesa->view_clip_tri;
    516516
     
    530530/* Indirect, and no clipping required.
    531531 */
    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 {                                                          \
    559559    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;  \
    570570   const GLuint *elt = VB->EltPtr->data;
    571571
    572 #define INIT(x) 
     572#define INIT(x)
    573573
    574574#define TAG(x) x##_fx_smooth_indirect
     
    586586 * 'safe' set of clipping routines which don't require write-access to
    587587 * 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.
    591591 *
    592592 * This safe clipping should be generalized to call driver->trianglefunc
     
    606606  GLuint p = 0;
    607607
    608   if (!nr) 
     608  if (!nr)
    609609    return;
    610610
    611   if (fxMesa->new_state) 
     611  if (fxMesa->new_state)
    612612    fxSetupFXUnits(ctx);
    613613
     
    619619      func = render_tab_fx_smooth_indirect_clipped[prim];
    620620  }
    621    
    622   ctx->VB = VB;                 /* kludge */
     621
     622  ctx->VB = VB;                 /* kludge */
    623623
    624624  do {
    625625    func( VB, 0, nr, 0 );
    626626  } while (ctx->Driver.MultipassFunc &&
    627            ctx->Driver.MultipassFunc( VB, ++p ));
     627           ctx->Driver.MultipassFunc( VB, ++p ));
    628628
    629629
     
    644644  if (cvaVB->ClipOrMask)
    645645    tab = render_tab_fx_smooth_indirect_clipped;
    646    
     646
    647647  if (!VB->CullDone)
    648648    gl_fast_copy_vb( VB );
    649649
    650   if (fxMesa->new_state) 
     650  if (fxMesa->new_state)
    651651    fxSetupFXUnits( ctx );
    652652
     
    657657    GLuint parity = VB->Parity;
    658658
    659     for (i = VB->CopyStart ; i < count ; parity = 0, i = next) 
     659    for (i = VB->CopyStart ; i < count ; parity = 0, i = next)
    660660    {
    661661      GLuint prim = VB->Primitive[i];
     
    665665    /* loop never taken */
    666666  } while (ctx->Driver.MultipassFunc &&
    667            ctx->Driver.MultipassFunc( cvaVB, ++p ));
     667           ctx->Driver.MultipassFunc( cvaVB, ++p ));
    668668
    669669  cvaVB->EltPtr = 0;
     
    719719  fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
    720720
    721   if (ctx->IndirectTriangles & DD_SW_SETUP) 
    722     return null_tables; 
     721  if (ctx->IndirectTriangles & DD_SW_SETUP)
     722    return null_tables;
    723723
    724724  switch (fxMesa->render_index) {
     
    726726    return fxDDRenderVBFlat_tables;
    727727  case 0:
    728     return fxDDRenderVBSmooth_tables; 
     728    return fxDDRenderVBSmooth_tables;
    729729  default:
    730     return null_tables;   
     730    return null_tables;
    731731  }
    732732}
     
    743743   GLint p = 0;
    744744
    745    if (fxMesa->new_state) 
     745   if (fxMesa->new_state)
    746746     fxSetupFXUnits(ctx);
    747747
    748    if (VB->Indirect) { 
    749       return; 
     748   if (VB->Indirect) {
     749      return;
    750750   } else if (VB->CullMode & CLIP_MASK_ACTIVE) {
    751751      tab = fxMesa->RenderVBClippedTab;
     
    758758
    759759   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 )
    762762      {
    763         prim = VB->Primitive[i];
    764         next = VB->NextPrimitive[i];
    765         tab[prim]( VB, i, next, parity );
     763        prim = VB->Primitive[i];
     764        next = VB->NextPrimitive[i];
     765        tab[prim]( VB, i, next, parity );
    766766      }
    767767
    768768   } while (ctx->Driver.MultipassFunc &&
    769             ctx->Driver.MultipassFunc( VB, ++p ));
     769            ctx->Driver.MultipassFunc( VB, ++p ));
    770770}
    771771
Note: See TracChangeset for help on using the changeset viewer.