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/vbrender.c

    r2962 r3598  
    1 /* $Id: vbrender.c,v 1.2 2000-03-01 18:49:39 jeroen Exp $ */
     1/* $Id: vbrender.c,v 1.3 2000-05-23 20:41:03 jeroen Exp $ */
    22
    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.
     
    4242#include "all.h"
    4343#else
    44 #ifndef XFree86Server
    45 #include <stdio.h>
    46 #else
    47 #include "GL/xf86glx.h"
    48 #endif
     44#include "glheader.h"
    4945#include "clip.h"
    5046#include "types.h"
     
    8783
    8884static INLINE void gl_render_clipped_line2( GLcontext *ctx,
    89                                             GLuint v1, GLuint v2 )
     85                                            GLuint v1, GLuint v2 )
    9086{
    9187   GLuint pv = v2;
     
    128124}
    129125
    130 #define FLUSH_PRIM(prim)                        \
    131 do {                                            \
    132    if (ctx->PB->primitive != prim) {            \
    133       gl_reduced_prim_change( ctx, prim );              \
    134    }                                            \
     126#define FLUSH_PRIM(prim)                        \
     127do {                                            \
     128   if (ctx->PB->primitive != prim) {            \
     129      gl_reduced_prim_change( ctx, prim );              \
     130   }                                            \
    135131} while(0)
    136132
     
    155151         j = vlist[i];
    156152         if (edge_ptr[j] & 0x3) {
    157             edge_ptr[j] &= ~0x3;
     153            edge_ptr[j] &= ~0x3;
    158154            (*ctx->Driver.PointsFunc)( ctx, j, j );
    159155         }
     
    162158   else if (mode==GL_LINE) {
    163159      GLuint i, j0, j1;
     160      ctx->StippleCounter = 0;
    164161
    165162      /* draw the edges */
    166163      for (i=0;i<n-1;i++) {
    167         j0 = vlist[i];
    168         j1 = vlist[i+1];
    169        
    170         if (edge_ptr[j0] & 0x1) {
    171             edge_ptr[j0] &= ~1;
    172             (*ctx->Driver.LineFunc)( ctx, j0, j1, pv );
    173         }
     164        j0 = vlist[i];
     165        j1 = vlist[i+1];
     166
     167        if (edge_ptr[j0] & 0x1) {
     168            edge_ptr[j0] &= ~0x1;
     169            (*ctx->Driver.LineFunc)( ctx, j0, j1, pv );
     170        }
    174171      }
    175172
     
    179176
    180177      if (edge_ptr[j0] & 0x2) {
    181          edge_ptr[j0] &= ~2;
    182         (*ctx->Driver.LineFunc)( ctx, j0, j1, pv );
     178         edge_ptr[j0] &= ~0x2;
     179        (*ctx->Driver.LineFunc)( ctx, j0, j1, pv );
    183180      }
    184181   }
     
    203200 */
    204201void gl_render_clipped_triangle( GLcontext *ctx, GLuint n, GLuint vlist[],
    205                                 GLuint pv )
     202                                GLuint pv )
    206203{
    207204   struct vertex_buffer *VB = ctx->VB;
     
    220217
    221218static INLINE void gl_render_clipped_triangle2( GLcontext *ctx,
    222                                                 GLuint v1, GLuint v2, GLuint v3,
    223                                                 GLuint pv )
     219                                                GLuint v1, GLuint v2, GLuint v3,
     220                                                GLuint pv )
    224221{
    225222   struct vertex_buffer *VB = ctx->VB;
    226    GLubyte mask = (GLubyte) (VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3]);
     223   GLubyte mask = (GLubyte) (VB->ClipMask[v1] |
     224                             VB->ClipMask[v2] |
     225                             VB->ClipMask[v3]);
    227226   GLuint vlist[VB_MAX_CLIPPED_VERTS];
    228227   GLuint i, n;
     
    238237   ASSIGN_3V(vlist, v1, v2, v3 );
    239238   n = (ctx->poly_clip_tab[VB->ClipPtr->size])( VB, 3, vlist, mask );
     239
     240   for (i=2;i<n;i++)
     241      ctx->TriangleFunc( ctx, *vlist, vlist[i-1], vlist[i], pv );
     242}
     243
     244
     245static INLINE void gl_render_clipped_quad2( GLcontext *ctx,
     246                                            GLuint v1, GLuint v2, GLuint v3,
     247                                            GLuint v4,
     248                                            GLuint pv )
     249{
     250   struct vertex_buffer *VB = ctx->VB;
     251   GLubyte mask = (GLubyte) (VB->ClipMask[v1] |
     252                             VB->ClipMask[v2] |
     253                             VB->ClipMask[v3] |
     254                             VB->ClipMask[v4]);
     255   GLuint vlist[VB_MAX_CLIPPED_VERTS];
     256   GLuint i, n;
     257
     258   if (!mask) {
     259      ctx->QuadFunc( ctx, v1, v2, v3, v4, pv );
     260      return;
     261   }
     262
     263   if (CLIP_ALL_BITS & VB->ClipMask[v1] &
     264       VB->ClipMask[v2] & VB->ClipMask[v3] &
     265       VB->ClipMask[v4])
     266      return;
     267
     268   ASSIGN_4V(vlist, v1, v2, v3, v4 );
     269   n = (ctx->poly_clip_tab[VB->ClipPtr->size])( VB, 4, vlist, mask );
    240270
    241271   for (i=2;i<n;i++)
     
    294324
    295325
     326static void null_triangle( GLcontext *ctx,
     327                           GLuint v0, GLuint v1, GLuint v2, GLuint pv )
     328{
     329}
     330
    296331
    297332/* Implements triangle_rendering when (IndirectTriangles & DD_SW_SETUP)
     
    309344   GLfloat c = ex*fy-ey*fx;
    310345   GLuint facing;
    311    GLuint tricaps;
     346   GLuint tricaps = ctx->IndirectTriangles;
    312347
    313348   if (c * ctx->backface_sign > 0)
     
    315350
    316351   facing = (c<0.0F) ^ (ctx->Polygon.FrontFace==GL_CW);
    317    tricaps = ctx->IndirectTriangles;
    318    (void) tricaps;  /* not needed? */
    319 
    320    if (ctx->IndirectTriangles & DD_TRI_OFFSET) {
     352
     353   if (tricaps & DD_TRI_OFFSET) {
    321354      GLfloat ez = win[v2][2] - win[v0][2];
    322355      GLfloat fz = win[v3][2] - win[v1][2];
     
    327360
    328361
    329    if (ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE) {
     362   if (tricaps & DD_TRI_LIGHT_TWOSIDE) {
    330363      VB->Specular = VB->Spec[facing];
    331364      VB->ColorPtr = VB->Color[facing];
     
    335368
    336369   /* Render the quad! */
    337    if (ctx->IndirectTriangles & DD_TRI_UNFILLED) {
     370   if (tricaps & DD_TRI_UNFILLED) {
    338371      GLuint vlist[4];
    339372      vlist[0] = v0;
     
    349382
    350383
    351 
     384#if 0
     385static void null_quad( GLcontext *ctx, GLuint v0, GLuint v1,
     386                       GLuint v2, GLuint v3, GLuint pv )
     387{
     388}
     389#endif
    352390
    353391
     
    366404#define NEED_EDGEFLAG_SETUP (ctx->TriangleCaps & DD_TRI_UNFILLED)
    367405
    368 #define EDGEFLAG_TRI( i2, i1, i, pv, parity)    \
    369 do {                                            \
    370   GLuint e1=i1, e0=i;                           \
    371   if (parity) { GLuint t=e1; e1=e0; e0=t; }     \
    372   eflag[i2] = eflag[e1] = 1; eflag[e0] = 2;     \
    373 } while (0)
    374 
    375 #define EDGEFLAG_QUAD( i3, i2, i1, i, pv)               \
    376 do {                                                    \
    377   eflag[i3] = eflag[i2] = eflag[i1] = 1; eflag[i] = 2;  \
    378 } while (0)
     406#define EDGEFLAG_TRI( i2, i1, i, pv, parity)    \
     407do {                                            \
     408  eflag[i2] = eflag[i1] = 1; eflag[i] = 2;      \
     409} while (0)
     410
     411#define EDGEFLAG_QUAD( i3, i2, i1, i, pv)               \
     412do {                                                    \
     413  eflag[i3] = eflag[i2] = eflag[i1] = 1; eflag[i] = 2;  \
     414} while (0)
     415
     416
     417#define EDGEFLAG_POLY_TRI_PRE( i2, i1, i, pv)   \
     418do {                                            \
     419  eflag[i1] |= (eflag[i1] >> 2) & 1;            \
     420  eflag[i] |= (eflag[i] >> 2) & 2;              \
     421} while (0)
     422
     423#define EDGEFLAG_POLY_TRI_POST( i2, i1, i, pv)  \
     424do {                                            \
     425  eflag[i2] = 0;                \
     426  eflag[i1] &= ~(4|1);          \
     427  eflag[i] &= ~(8|2);           \
     428} while (0)
     429
    379430
    380431
    381432/* Culled and possibly clipped primitives.
    382433 */
    383 #define RENDER_POINTS( start, count )                   \
    384    (void) cullmask;                                     \
     434#define RENDER_POINTS( start, count )                   \
     435   (void) cullmask;                                     \
    385436   (*ctx->Driver.PointsFunc)( ctx, start, count-1 );
    386437
    387438
    388 #define RENDER_LINE( i1, i )                    \
    389 do {                                            \
    390    const GLubyte flags = cullmask[i];           \
    391                                                 \
    392    if (!(flags & PRIM_NOT_CULLED))              \
    393       continue;                                 \
    394                                                 \
    395    if (flags & PRIM_ANY_CLIP)                   \
    396       gl_render_clipped_line( ctx, i1, i );     \
    397    else                                         \
    398       ctx->Driver.LineFunc( ctx, i1, i, i );    \
    399 } while (0)
    400 
    401 
    402 
    403 #define RENDER_TRI( i2, i1, i, pv, parity)              \
    404 do {                                                    \
    405    const GLubyte flags = cullmask[i];                   \
    406                                                         \
    407    if (!(flags & PRIM_NOT_CULLED))                      \
    408       continue;                                         \
    409                                                         \
    410    if (flags & PRIM_ANY_CLIP) {                         \
    411       if (parity) {                                     \
    412          vlist[0] = i1;                                 \
    413          vlist[1] = i2;                                 \
    414          vlist[2] = i;                                  \
    415       } else {                                          \
    416          vlist[0] = i2;                                 \
    417          vlist[1] = i1;                                 \
    418          vlist[2] = i;                                  \
    419       }                                                 \
    420       gl_render_clipped_triangle( ctx, 3, vlist, pv );  \
    421    } else if (parity)                                   \
    422       ctx->TriangleFunc( ctx, i1, i2, i, pv );          \
    423    else                                                 \
    424       ctx->TriangleFunc( ctx, i2, i1, i, pv );          \
    425                                                         \
    426 } while (0)
    427 
    428 
    429 #define RENDER_QUAD( i3, i2, i1, i, pv)                 \
    430 do {                                                    \
    431    const GLubyte flags = cullmask[i];                   \
    432                                                         \
    433    if (!(flags & PRIM_NOT_CULLED))                      \
    434       continue;                                         \
    435                                                         \
    436    if (flags&PRIM_ANY_CLIP) {                           \
    437       vlist[0] = i3;                                    \
    438       vlist[1] = i2;                                    \
    439       vlist[2] = i1;                                    \
    440       vlist[3] = i;                                     \
    441       gl_render_clipped_triangle( ctx, 4, vlist, pv );  \
    442    } else                                               \
    443       ctx->QuadFunc( ctx, i3, i2, i1, i, pv );          \
    444 } while (0)
    445 
    446 
    447 #define LOCAL_VARS                              \
    448     GLcontext *ctx = VB->ctx;                   \
    449     const GLubyte *cullmask = VB->CullMask;     \
    450     GLuint vlist[VB_SIZE];                      \
    451     GLubyte *eflag = VB->EdgeFlagPtr->data;     \
     439#define RENDER_LINE( i1, i )                    \
     440do {                                            \
     441   const GLubyte flags = cullmask[i];           \
     442                                                \
     443   if (!(flags & PRIM_NOT_CULLED))              \
     444      continue;                                 \
     445                                                \
     446   if (flags & PRIM_ANY_CLIP)                   \
     447      gl_render_clipped_line( ctx, i1, i );     \
     448   else                                         \
     449      ctx->Driver.LineFunc( ctx, i1, i, i );    \
     450} while (0)
     451
     452
     453
     454#define RENDER_TRI( i2, i1, i, pv, parity)              \
     455do {                                                    \
     456   const GLubyte flags = cullmask[i];                   \
     457                                                        \
     458   if (!(flags & PRIM_NOT_CULLED))                      \
     459      continue;                                         \
     460                                                        \
     461   if (flags & PRIM_ANY_CLIP) {                         \
     462      if (parity) {                                     \
     463         vlist[0] = i1;                                 \
     464         vlist[1] = i2;                                 \
     465         vlist[2] = i;                                  \
     466      } else {                                          \
     467         vlist[0] = i2;                                 \
     468         vlist[1] = i1;                                 \
     469         vlist[2] = i;                                  \
     470      }                                                 \
     471      gl_render_clipped_triangle( ctx, 3, vlist, pv );  \
     472   } else if (parity)                                   \
     473      ctx->TriangleFunc( ctx, i1, i2, i, pv );          \
     474   else                                                 \
     475      ctx->TriangleFunc( ctx, i2, i1, i, pv );          \
     476                                                        \
     477} while (0)
     478
     479
     480#define RENDER_QUAD( i3, i2, i1, i, pv)                 \
     481do {                                                    \
     482   const GLubyte flags = cullmask[i];                   \
     483                                                        \
     484   if (!(flags & PRIM_NOT_CULLED))                      \
     485      continue;                                         \
     486                                                        \
     487   if (flags&PRIM_ANY_CLIP) {                           \
     488      vlist[0] = i3;                                    \
     489      vlist[1] = i2;                                    \
     490      vlist[2] = i1;                                    \
     491      vlist[3] = i;                                     \
     492      gl_render_clipped_triangle( ctx, 4, vlist, pv );  \
     493   } else                                               \
     494      ctx->QuadFunc( ctx, i3, i2, i1, i, pv );          \
     495} while (0)
     496
     497
     498#define LOCAL_VARS                              \
     499    GLcontext *ctx = VB->ctx;                   \
     500    const GLubyte *cullmask = VB->CullMask;     \
     501    GLuint vlist[VB_SIZE];                      \
     502    GLubyte *eflag = VB->EdgeFlagPtr->data;     \
    452503    GLuint *stipplecounter = &VB->ctx->StippleCounter; \
    453504    (void) vlist; (void) eflag; (void) stipplecounter;
     
    472523   (*ctx->Driver.LineFunc)( ctx, i1, i, i )
    473524
    474 #define RENDER_TRI( i2, i1, i, pv, parity )     \
    475 do {                                            \
    476    if (parity)                                  \
    477       ctx->TriangleFunc( ctx, i1, i2, i, pv );  \
    478    else                                         \
    479       ctx->TriangleFunc( ctx, i2, i1, i, pv );  \
    480 } while (0)
    481 
    482 
    483 #define RENDER_QUAD( i3, i2, i1, i, pv )        \
     525#define RENDER_TRI( i2, i1, i, pv, parity )     \
     526do {                                            \
     527   if (parity)                                  \
     528      ctx->TriangleFunc( ctx, i1, i2, i, pv );  \
     529   else                                         \
     530      ctx->TriangleFunc( ctx, i2, i1, i, pv );  \
     531} while (0)
     532
     533
     534#define RENDER_QUAD( i3, i2, i1, i, pv )        \
    484535   ctx->QuadFunc( ctx, i3, i2, i1, i, i );
    485536
    486537#define TAG(x) x##_raw
    487538
    488 #define LOCAL_VARS                              \
    489     GLcontext *ctx = VB->ctx;                   \
    490     GLubyte *eflag = VB->EdgeFlagPtr->data;     \
     539#define LOCAL_VARS                              \
     540    GLcontext *ctx = VB->ctx;                   \
     541    GLubyte *eflag = VB->EdgeFlagPtr->data;     \
    491542    GLuint *stipplecounter = &VB->ctx->StippleCounter; \
    492543    (void) eflag; (void) stipplecounter;
     
    501552/* Direct, with the possibility of clipping.
    502553 */
    503 #define RENDER_POINTS( start, count )                   \
     554#define RENDER_POINTS( start, count )                   \
    504555   (*ctx->Driver.PointsFunc)( ctx, start, count-1 )
    505556
    506 #define RENDER_LINE( i1, i )                    \
     557#define RENDER_LINE( i1, i )                    \
    507558   gl_render_clipped_line2( ctx, i1, i )
    508559
    509 #define RENDER_TRI( i2, i1, i, pv, parity)      \
    510 do {                                            \
    511   GLuint e1=i1, e0=i;                           \
    512   if (parity) { GLuint t=e1; e1=e0; e0=t; }     \
    513   gl_render_clipped_triangle2(ctx,i2,e1,e0,pv); \
    514 } while (0)
    515 
    516 #define RENDER_QUAD( i3, i2, i1, i, pv)         \
    517 do {                                            \
    518   gl_render_clipped_triangle2(ctx,i3,i2,i1,pv); \
    519   gl_render_clipped_triangle2(ctx,i3,i1,i,pv);  \
    520 } while (0)
    521 
    522 /*    gl_render_clipped_triangle2(ctx,i3,i2,i,pv); */
    523 /*    gl_render_clipped_triangle2(ctx,i2,i1,i,pv); */
    524 
    525 
    526 #define LOCAL_VARS                              \
    527     GLcontext *ctx = VB->ctx;                   \
    528     GLubyte *eflag = VB->EdgeFlagPtr->data;     \
     560#define RENDER_TRI( i2, i1, i, pv, parity)      \
     561do {                                            \
     562  GLuint e2=i2, e1=i1;                          \
     563  if (parity) { GLuint t=e2; e2=e1; e1=t; }     \
     564  gl_render_clipped_triangle2(ctx,e2,e1,i,pv);  \
     565} while (0)
     566
     567#define RENDER_QUAD( i3, i2, i1, i, pv)         \
     568do {                                            \
     569  gl_render_clipped_quad2(ctx,i3,i2,i1,i,pv);   \
     570} while (0)
     571
     572
     573#define LOCAL_VARS                              \
     574    GLcontext *ctx = VB->ctx;                   \
     575    GLubyte *eflag = VB->EdgeFlagPtr->data;     \
    529576    GLuint *stipplecounter = &VB->ctx->StippleCounter; \
    530577    (void) eflag; (void) stipplecounter;
     
    557604 * Keith.
    558605 */
    559 void gl_setup_edgeflag( struct vertex_buffer *VB,
    560                         GLenum prim,
    561                         GLuint start,
    562                         GLuint count,
    563                         GLuint parity )
     606static void
     607setup_edgeflag( struct vertex_buffer *VB,
     608                GLenum prim,
     609                GLuint start,
     610                GLuint count,
     611                GLuint parity )
    564612{
    565613   GLubyte *flag = VB->EdgeFlagPtr->data + start;
     
    571619   case GL_TRIANGLES:
    572620      for (i = 0 ; i < n-2 ; i+=3) {
    573          if (flag[i])   flag[i]   = 0x5;
    574          if (flag[i+1]) flag[i+1] = 0x5;
    575          if (flag[i+2]) flag[i+2] = 0x6;
     621         if (flag[i])   flag[i]   = 0x1;
     622         if (flag[i+1]) flag[i+1] = 0x1;
     623         if (flag[i+2]) flag[i+2] = 0x3;
    576624      }
    577625      break;
    578626   case GL_QUADS:
    579627      for (i = 0 ; i < n-3 ; i+=4) {
    580          if (flag[i])   flag[i]   = 0x5;
    581          if (flag[i+1]) flag[i+1] = 0x5;
    582          if (flag[i+2]) flag[i+2] = 0x5;
    583          if (flag[i+3]) flag[i+3] = 0x6;
     628         if (flag[i])   flag[i]   = 0x1;
     629         if (flag[i+1]) flag[i+1] = 0x1;
     630         if (flag[i+2]) flag[i+2] = 0x1;
     631         if (flag[i+3]) flag[i+3] = 0x3;
    584632      }
    585633      break;
    586634   case GL_POLYGON:
    587       for (i = 0 ; i < n-1 ; i++) {
    588          if (flag[i]) flag[i] = 0x5;
    589       }
    590       if (flag[i]) flag[i] = 0x6;
     635      if (flag[0]) flag[0] = 0x1;
     636      for (i = 1 ; i < n-1 ; i++) {
     637         if (flag[i]) flag[i] = 0x1<<2;
     638      }
     639      if (flag[i]) flag[i] = 0x3<<2;
    591640      break;
    592641   default:
     
    628677
    629678   gl_import_client_data( VB, ctx->RenderFlags,
    630                           (VB->ClipOrMask
    631                            ? VEC_WRITABLE|VEC_GOOD_STRIDE
    632                            : VEC_GOOD_STRIDE));
     679                          (VB->ClipOrMask
     680                           ? VEC_WRITABLE|VEC_GOOD_STRIDE
     681                           : VEC_GOOD_STRIDE));
    633682
    634683   if (/*  ctx->Current.Primitive == GL_POLYGON+1 &&  */
     
    640689      for ( i= VB->CopyStart ; i < count ; parity = 0, i = next )
    641690      {
    642         prim = VB->Primitive[i];
    643         next = VB->NextPrimitive[i];
    644 
    645         if (ctx->TriangleCaps & DD_TRI_UNFILLED)
    646             gl_setup_edgeflag(VB, (GLenum)prim, i, next, parity);
    647 
    648         tab[prim]( VB, i, next, parity );
    649 
    650         if (ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
    651             VB->Specular = VB->Spec[0];
    652             VB->ColorPtr = VB->Color[0];
    653             VB->IndexPtr = VB->Index[0];
    654         }
     691        prim = VB->Primitive[i];
     692        next = VB->NextPrimitive[i];
     693
     694        if (ctx->TriangleCaps & DD_TRI_UNFILLED)
     695            setup_edgeflag(VB, prim, i, next, parity);
     696
     697        tab[prim]( VB, i, next, parity );
     698
     699        if (ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
     700            VB->Specular = VB->Spec[0];
     701            VB->ColorPtr = VB->Color[0];
     702            VB->IndexPtr = VB->Index[0];
     703        }
    655704      }
    656705
    657706   } while (ctx->Driver.MultipassFunc &&
    658             ctx->Driver.MultipassFunc( VB, ++p ));
     707            ctx->Driver.MultipassFunc( VB, ++p ));
    659708
    660709   if (ctx->PB->count > 0)
     
    670719{
    671720   if (ctx->PB->count > 0)
    672       gl_flush_pb(ctx); 
    673 
    674    ctx->PB->count = 0;                         
    675    ctx->PB->mono = GL_FALSE;                   
     721      gl_flush_pb(ctx);
     722
     723   ctx->PB->count = 0;
     724   ctx->PB->mono = GL_FALSE;
    676725
    677726   if (ctx->PB->primitive != prim) {
    678       ctx->PB->primitive = prim;                       
     727      ctx->PB->primitive = prim;
    679728
    680729      if (ctx->Driver.ReducedPrimitiveChange)
    681         ctx->Driver.ReducedPrimitiveChange( ctx, prim );
     730        ctx->Driver.ReducedPrimitiveChange( ctx, prim );
    682731   }
    683732}
     
    695744      ctx->Driver.RenderVBRawTab = render_tab_raw;
    696745
    697    /* Culling will be done earlier by gl_cull_vb().
    698     */
    699    if (ctx->IndirectTriangles & (DD_SW_SETUP & ~DD_TRI_CULL)) {
    700       ctx->TriangleFunc = render_triangle;
    701       ctx->QuadFunc = render_quad;
    702    } else {
    703       ctx->TriangleFunc = ctx->Driver.TriangleFunc;
    704       ctx->QuadFunc = ctx->Driver.QuadFunc;
    705    }
    706 
    707    if (ctx->IndirectTriangles & (DD_SW_SETUP)) {
     746   ctx->TriangleFunc = ctx->Driver.TriangleFunc;
     747   ctx->QuadFunc = ctx->Driver.QuadFunc;
     748   ctx->ClippedTriangleFunc = ctx->TriangleFunc;
     749
     750   if (ctx->IndirectTriangles & DD_SW_SETUP) {
     751
    708752      ctx->ClippedTriangleFunc = render_triangle;
    709    } else {
    710       ctx->ClippedTriangleFunc = ctx->TriangleFunc;
    711    }
    712 
     753
     754      if (ctx->IndirectTriangles & (DD_SW_SETUP & ~DD_TRI_CULL)) {
     755         if (ctx->IndirectTriangles & DD_TRI_CULL_FRONT_BACK) {
     756            ctx->TriangleFunc = null_triangle;
     757            ctx->QuadFunc = render_quad;
     758            ctx->ClippedTriangleFunc = null_triangle;
     759         } else {
     760            ctx->TriangleFunc = render_triangle;
     761            ctx->QuadFunc = render_quad;
     762         }
     763      }
     764   }
    713765}
    714766
Note: See TracChangeset for help on using the changeset viewer.