3 * Mesa 3-D graphics library
6 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 * Keith Whitwell <keith@tungstengraphics.com>
30 /* Template for building functions to plug into the driver interface
32 * ctx->Driver.QuadFunc
33 * ctx->Driver.TriangleFunc
34 * ctx->Driver.LineFunc
35 * ctx->Driver.PointsFunc
37 * DO_TWOSIDE: Plug back-color values from the VB into backfacing triangles,
38 * and restore vertices afterwards.
39 * DO_OFFSET: Calculate offset for triangles and adjust vertices. Restore
40 * vertices after rendering.
41 * DO_FLAT: For hardware without native flatshading, copy provoking colors
42 * into the other vertices. Restore after rendering.
43 * DO_UNFILLED: Decompose triangles to lines and points where appropriate.
44 * DO_TWOSTENCIL:Gross hack for two-sided stencil.
46 * HAVE_RGBA: Vertices have rgba values (otherwise index values).
47 * HAVE_SPEC: Vertices have secondary rgba values.
49 * VERT_X(v): Alias for vertex x value.
50 * VERT_Y(v): Alias for vertex y value.
51 * VERT_Z(v): Alias for vertex z value.
52 * DEPTH_SCALE: Scale for offset.
54 * VERTEX: Hardware vertex type.
55 * GET_VERTEX(n): Retreive vertex with index n.
56 * AREA_IS_CCW(a): Return true if triangle with signed area a is ccw.
58 * VERT_SET_RGBA: Assign vertex rgba from VB color.
59 * VERT_COPY_RGBA: Copy vertex rgba another vertex.
60 * VERT_SAVE_RGBA: Save vertex rgba to a local variable.
61 * VERT_RESTORE_RGBA: Restore vertex rgba from a local variable.
62 * --> Similar for IND and SPEC.
64 * LOCAL_VARS(n): (At least) define local vars for save/restore rgba.
69 #define VERT_SET_IND( v, c ) (void) c
70 #define VERT_COPY_IND( v0, v1 )
71 #define VERT_SAVE_IND( idx )
72 #define VERT_RESTORE_IND( idx )
74 #define VERT_SET_RGBA( v, c )
77 #define VERT_SET_RGBA( v, c ) (void) c
78 #define VERT_COPY_RGBA( v0, v1 )
79 #define VERT_SAVE_RGBA( idx )
80 #define VERT_RESTORE_RGBA( idx )
82 #define VERT_SET_IND( v, c )
87 #define VERT_SET_SPEC( v, c ) (void) c
88 #define VERT_COPY_SPEC( v0, v1 )
89 #define VERT_SAVE_SPEC( idx )
90 #define VERT_RESTORE_SPEC( idx )
92 #define VERT_COPY_SPEC1( v )
96 #define VERT_SET_SPEC( v, c )
100 #if !HAVE_BACK_COLORS
101 #define VERT_COPY_SPEC1( v )
102 #define VERT_COPY_IND1( v )
103 #define VERT_COPY_RGBA1( v )
106 #ifndef INSANE_VERTICES
107 #define VERT_SET_Z(v,val) VERT_Z(v) = val
108 #define VERT_Z_ADD(v,val) VERT_Z(v) += val
111 /* disable twostencil for un-aware drivers */
112 #ifndef HAVE_STENCIL_TWOSIDE
113 #define HAVE_STENCIL_TWOSIDE 0
115 #ifndef DO_TWOSTENCIL
116 #define DO_TWOSTENCIL 0
118 #ifndef SETUP_STENCIL
119 #define SETUP_STENCIL(f)
121 #ifndef UNSET_STENCIL
122 #define UNSET_STENCIL(f)
126 static void TAG(triangle
)( GLcontext
*ctx
, GLuint e0
, GLuint e1
, GLuint e2
)
128 struct vertex_buffer
*VB
= &TNL_CONTEXT( ctx
)->vb
;
132 GLenum mode
= GL_FILL
;
136 /* fprintf(stderr, "%s\n", __FUNCTION__); */
138 v
[0] = (VERTEX
*)GET_VERTEX(e0
);
139 v
[1] = (VERTEX
*)GET_VERTEX(e1
);
140 v
[2] = (VERTEX
*)GET_VERTEX(e2
);
142 if (DO_TWOSIDE
|| DO_OFFSET
|| DO_UNFILLED
|| DO_TWOSTENCIL
)
144 GLfloat ex
= VERT_X(v
[0]) - VERT_X(v
[2]);
145 GLfloat ey
= VERT_Y(v
[0]) - VERT_Y(v
[2]);
146 GLfloat fx
= VERT_X(v
[1]) - VERT_X(v
[2]);
147 GLfloat fy
= VERT_Y(v
[1]) - VERT_Y(v
[2]);
148 GLfloat cc
= ex
*fy
- ey
*fx
;
150 if (DO_TWOSIDE
|| DO_UNFILLED
|| DO_TWOSTENCIL
)
152 facing
= AREA_IS_CCW( cc
) ^ ctx
->Polygon
._FrontBit
;
154 if (DO_TWOSTENCIL
&& ctx
->Stencil
.TestTwoSide
) {
155 ctx
->_Facing
= facing
; /* mixed mode rendering: for 2-sided stencil test */
160 mode
= ctx
->Polygon
.BackMode
;
161 if (ctx
->Polygon
.CullFlag
&&
162 ctx
->Polygon
.CullFaceMode
!= GL_FRONT
) {
166 mode
= ctx
->Polygon
.FrontMode
;
167 if (ctx
->Polygon
.CullFlag
&&
168 ctx
->Polygon
.CullFaceMode
!= GL_BACK
) {
174 if (DO_TWOSIDE
&& facing
== 1)
177 if (HAVE_BACK_COLORS
) {
181 VERT_COPY_RGBA1( v
[0] );
182 VERT_COPY_RGBA1( v
[1] );
185 VERT_COPY_RGBA1( v
[2] );
190 VERT_COPY_SPEC1( v
[0] );
191 VERT_COPY_SPEC1( v
[1] );
194 VERT_COPY_SPEC1( v
[2] );
198 GLfloat (*vbcolor
)[4] = VB
->ColorPtr
[1]->data
;
207 if (VB
->ColorPtr
[1]->stride
) {
208 ASSERT(VB
->ColorPtr
[1]->stride
== 4*sizeof(GLfloat
));
211 VERT_SET_RGBA( v
[0], vbcolor
[e0
] );
212 VERT_SET_RGBA( v
[1], vbcolor
[e1
] );
214 VERT_SET_RGBA( v
[2], vbcolor
[e2
] );
218 VERT_SET_RGBA( v
[0], vbcolor
[0] );
219 VERT_SET_RGBA( v
[1], vbcolor
[0] );
221 VERT_SET_RGBA( v
[2], vbcolor
[0] );
224 if (HAVE_SPEC
&& VB
->SecondaryColorPtr
[1]) {
225 GLfloat (*vbspec
)[4] = VB
->SecondaryColorPtr
[1]->data
;
226 ASSERT(VB
->SecondaryColorPtr
[1]->stride
== 4*sizeof(GLfloat
));
231 VERT_SET_SPEC( v
[0], vbspec
[e0
] );
232 VERT_SET_SPEC( v
[1], vbspec
[e1
] );
235 VERT_SET_SPEC( v
[2], vbspec
[e2
] );
240 GLfloat (*vbindex
) = (GLfloat
*)VB
->IndexPtr
[1]->data
;
244 VERT_SET_IND( v
[0], vbindex
[e0
] );
245 VERT_SET_IND( v
[1], vbindex
[e1
] );
248 VERT_SET_IND( v
[2], vbindex
[e2
] );
256 offset
= ctx
->Polygon
.OffsetUnits
* DEPTH_SCALE
;
260 if (cc
* cc
> 1e-16) {
261 GLfloat ic
= 1.0 / cc
;
262 GLfloat ez
= z
[0] - z
[2];
263 GLfloat fz
= z
[1] - z
[2];
264 GLfloat a
= ey
*fz
- ez
*fy
;
265 GLfloat b
= ez
*fx
- ex
*fz
;
268 if ( ac
< 0.0f
) ac
= -ac
;
269 if ( bc
< 0.0f
) bc
= -bc
;
270 offset
+= MAX2( ac
, bc
) * ctx
->Polygon
.OffsetFactor
;
280 VERT_COPY_RGBA( v
[0], v
[2] );
281 VERT_COPY_RGBA( v
[1], v
[2] );
282 if (HAVE_SPEC
&& VB
->SecondaryColorPtr
[0]) {
285 VERT_COPY_SPEC( v
[0], v
[2] );
286 VERT_COPY_SPEC( v
[1], v
[2] );
292 VERT_COPY_IND( v
[0], v
[2] );
293 VERT_COPY_IND( v
[1], v
[2] );
297 if (mode
== GL_POINT
) {
298 if (DO_OFFSET
&& ctx
->Polygon
.OffsetPoint
) {
299 VERT_Z_ADD(v
[0], offset
);
300 VERT_Z_ADD(v
[1], offset
);
301 VERT_Z_ADD(v
[2], offset
);
303 if (DO_TWOSTENCIL
&& !HAVE_STENCIL_TWOSIDE
&& ctx
->Stencil
.TestTwoSide
) {
304 SETUP_STENCIL(facing
);
305 UNFILLED_TRI( ctx
, GL_POINT
, e0
, e1
, e2
);
306 UNSET_STENCIL(facing
);
308 UNFILLED_TRI( ctx
, GL_POINT
, e0
, e1
, e2
);
310 } else if (mode
== GL_LINE
) {
311 if (DO_OFFSET
&& ctx
->Polygon
.OffsetLine
) {
312 VERT_Z_ADD(v
[0], offset
);
313 VERT_Z_ADD(v
[1], offset
);
314 VERT_Z_ADD(v
[2], offset
);
316 if (DO_TWOSTENCIL
&& !HAVE_STENCIL_TWOSIDE
&& ctx
->Stencil
.TestTwoSide
) {
317 SETUP_STENCIL(facing
);
318 UNFILLED_TRI( ctx
, GL_LINE
, e0
, e1
, e2
);
319 UNSET_STENCIL(facing
);
321 UNFILLED_TRI( ctx
, GL_LINE
, e0
, e1
, e2
);
324 if (DO_OFFSET
&& ctx
->Polygon
.OffsetFill
) {
325 VERT_Z_ADD(v
[0], offset
);
326 VERT_Z_ADD(v
[1], offset
);
327 VERT_Z_ADD(v
[2], offset
);
330 RASTERIZE( GL_TRIANGLES
);
331 if (DO_TWOSTENCIL
&& !HAVE_STENCIL_TWOSIDE
&& ctx
->Stencil
.TestTwoSide
) {
332 SETUP_STENCIL(facing
);
333 TRI( v
[0], v
[1], v
[2] );
334 UNSET_STENCIL(facing
);
336 TRI( v
[0], v
[1], v
[2] );
342 VERT_SET_Z(v
[0], z
[0]);
343 VERT_SET_Z(v
[1], z
[1]);
344 VERT_SET_Z(v
[2], z
[2]);
347 if (DO_TWOSIDE
&& facing
== 1)
351 VERT_RESTORE_RGBA( 0 );
352 VERT_RESTORE_RGBA( 1 );
354 VERT_RESTORE_RGBA( 2 );
357 VERT_RESTORE_SPEC( 0 );
358 VERT_RESTORE_SPEC( 1 );
360 VERT_RESTORE_SPEC( 2 );
365 VERT_RESTORE_IND( 0 );
366 VERT_RESTORE_IND( 1 );
368 VERT_RESTORE_IND( 2 );
375 VERT_RESTORE_RGBA( 0 );
376 VERT_RESTORE_RGBA( 1 );
377 if (HAVE_SPEC
&& VB
->SecondaryColorPtr
[0]) {
378 VERT_RESTORE_SPEC( 0 );
379 VERT_RESTORE_SPEC( 1 );
383 VERT_RESTORE_IND( 0 );
384 VERT_RESTORE_IND( 1 );
392 static void TAG(quad
)( GLcontext
*ctx
,
393 GLuint e0
, GLuint e1
, GLuint e2
, GLuint e3
)
395 struct vertex_buffer
*VB
= &TNL_CONTEXT( ctx
)->vb
;
399 GLenum mode
= GL_FILL
;
403 v
[0] = (VERTEX
*)GET_VERTEX(e0
);
404 v
[1] = (VERTEX
*)GET_VERTEX(e1
);
405 v
[2] = (VERTEX
*)GET_VERTEX(e2
);
406 v
[3] = (VERTEX
*)GET_VERTEX(e3
);
408 if (DO_TWOSIDE
|| DO_OFFSET
|| DO_UNFILLED
|| DO_TWOSTENCIL
)
410 GLfloat ex
= VERT_X(v
[2]) - VERT_X(v
[0]);
411 GLfloat ey
= VERT_Y(v
[2]) - VERT_Y(v
[0]);
412 GLfloat fx
= VERT_X(v
[3]) - VERT_X(v
[1]);
413 GLfloat fy
= VERT_Y(v
[3]) - VERT_Y(v
[1]);
414 GLfloat cc
= ex
*fy
- ey
*fx
;
416 if (DO_TWOSIDE
|| DO_UNFILLED
|| DO_TWOSTENCIL
)
418 facing
= AREA_IS_CCW( cc
) ^ ctx
->Polygon
._FrontBit
;
420 if (DO_TWOSTENCIL
&& ctx
->Stencil
.TestTwoSide
) {
421 ctx
->_Facing
= facing
; /* mixed mode rendering: for 2-sided stencil test */
426 mode
= ctx
->Polygon
.BackMode
;
427 if (ctx
->Polygon
.CullFlag
&&
428 ctx
->Polygon
.CullFaceMode
!= GL_FRONT
) {
432 mode
= ctx
->Polygon
.FrontMode
;
433 if (ctx
->Polygon
.CullFlag
&&
434 ctx
->Polygon
.CullFaceMode
!= GL_BACK
) {
440 if (DO_TWOSIDE
&& facing
== 1)
443 GLfloat (*vbcolor
)[4] = VB
->ColorPtr
[1]->data
;
446 if (HAVE_BACK_COLORS
) {
451 VERT_COPY_RGBA1( v
[0] );
452 VERT_COPY_RGBA1( v
[1] );
453 VERT_COPY_RGBA1( v
[2] );
456 VERT_COPY_RGBA1( v
[3] );
462 VERT_COPY_SPEC1( v
[0] );
463 VERT_COPY_SPEC1( v
[1] );
464 VERT_COPY_SPEC1( v
[2] );
467 VERT_COPY_SPEC1( v
[3] );
478 if (VB
->ColorPtr
[1]->stride
) {
480 VERT_SET_RGBA( v
[0], vbcolor
[e0
] );
481 VERT_SET_RGBA( v
[1], vbcolor
[e1
] );
482 VERT_SET_RGBA( v
[2], vbcolor
[e2
] );
484 VERT_SET_RGBA( v
[3], vbcolor
[e3
] );
488 VERT_SET_RGBA( v
[0], vbcolor
[0] );
489 VERT_SET_RGBA( v
[1], vbcolor
[0] );
490 VERT_SET_RGBA( v
[2], vbcolor
[0] );
492 VERT_SET_RGBA( v
[3], vbcolor
[0] );
495 if (HAVE_SPEC
&& VB
->SecondaryColorPtr
[1]) {
496 GLfloat (*vbspec
)[4] = VB
->SecondaryColorPtr
[1]->data
;
497 ASSERT(VB
->SecondaryColorPtr
[1]->stride
==4*sizeof(GLfloat
));
503 VERT_SET_SPEC( v
[0], vbspec
[e0
] );
504 VERT_SET_SPEC( v
[1], vbspec
[e1
] );
505 VERT_SET_SPEC( v
[2], vbspec
[e2
] );
508 VERT_SET_SPEC( v
[3], vbspec
[e3
] );
513 GLfloat
*vbindex
= (GLfloat
*)VB
->IndexPtr
[1]->data
;
518 VERT_SET_IND( v
[0], vbindex
[e0
] );
519 VERT_SET_IND( v
[1], vbindex
[e1
] );
520 VERT_SET_IND( v
[2], vbindex
[e2
] );
523 VERT_SET_IND( v
[3], vbindex
[e3
] );
531 offset
= ctx
->Polygon
.OffsetUnits
* DEPTH_SCALE
;
536 if (cc
* cc
> 1e-16) {
537 GLfloat ez
= z
[2] - z
[0];
538 GLfloat fz
= z
[3] - z
[1];
539 GLfloat a
= ey
*fz
- ez
*fy
;
540 GLfloat b
= ez
*fx
- ex
*fz
;
541 GLfloat ic
= 1.0 / cc
;
544 if ( ac
< 0.0f
) ac
= -ac
;
545 if ( bc
< 0.0f
) bc
= -bc
;
546 offset
+= MAX2( ac
, bc
) * ctx
->Polygon
.OffsetFactor
;
557 VERT_COPY_RGBA( v
[0], v
[3] );
558 VERT_COPY_RGBA( v
[1], v
[3] );
559 VERT_COPY_RGBA( v
[2], v
[3] );
560 if (HAVE_SPEC
&& VB
->SecondaryColorPtr
[0]) {
564 VERT_COPY_SPEC( v
[0], v
[3] );
565 VERT_COPY_SPEC( v
[1], v
[3] );
566 VERT_COPY_SPEC( v
[2], v
[3] );
573 VERT_COPY_IND( v
[0], v
[3] );
574 VERT_COPY_IND( v
[1], v
[3] );
575 VERT_COPY_IND( v
[2], v
[3] );
579 if (mode
== GL_POINT
) {
580 if (( DO_OFFSET
) && ctx
->Polygon
.OffsetPoint
) {
581 VERT_Z_ADD(v
[0], offset
);
582 VERT_Z_ADD(v
[1], offset
);
583 VERT_Z_ADD(v
[2], offset
);
584 VERT_Z_ADD(v
[3], offset
);
586 if (DO_TWOSTENCIL
&& !HAVE_STENCIL_TWOSIDE
&& ctx
->Stencil
.TestTwoSide
) {
587 SETUP_STENCIL(facing
);
588 UNFILLED_QUAD( ctx
, GL_POINT
, e0
, e1
, e2
, e3
);
589 UNSET_STENCIL(facing
);
591 UNFILLED_QUAD( ctx
, GL_POINT
, e0
, e1
, e2
, e3
);
593 } else if (mode
== GL_LINE
) {
594 if (DO_OFFSET
&& ctx
->Polygon
.OffsetLine
) {
595 VERT_Z_ADD(v
[0], offset
);
596 VERT_Z_ADD(v
[1], offset
);
597 VERT_Z_ADD(v
[2], offset
);
598 VERT_Z_ADD(v
[3], offset
);
600 if (DO_TWOSTENCIL
&& !HAVE_STENCIL_TWOSIDE
&& ctx
->Stencil
.TestTwoSide
) {
601 SETUP_STENCIL(facing
);
602 UNFILLED_QUAD( ctx
, GL_LINE
, e0
, e1
, e2
, e3
);
603 UNSET_STENCIL(facing
);
605 UNFILLED_QUAD( ctx
, GL_LINE
, e0
, e1
, e2
, e3
);
608 if (DO_OFFSET
&& ctx
->Polygon
.OffsetFill
) {
609 VERT_Z_ADD(v
[0], offset
);
610 VERT_Z_ADD(v
[1], offset
);
611 VERT_Z_ADD(v
[2], offset
);
612 VERT_Z_ADD(v
[3], offset
);
614 RASTERIZE( GL_QUADS
);
615 if (DO_TWOSTENCIL
&& !HAVE_STENCIL_TWOSIDE
&& ctx
->Stencil
.TestTwoSide
) {
616 SETUP_STENCIL(facing
);
617 QUAD( (v
[0]), (v
[1]), (v
[2]), (v
[3]) );
618 UNSET_STENCIL(facing
);
620 QUAD( (v
[0]), (v
[1]), (v
[2]), (v
[3]) );
626 VERT_SET_Z(v
[0], z
[0]);
627 VERT_SET_Z(v
[1], z
[1]);
628 VERT_SET_Z(v
[2], z
[2]);
629 VERT_SET_Z(v
[3], z
[3]);
632 if (DO_TWOSIDE
&& facing
== 1)
636 VERT_RESTORE_RGBA( 0 );
637 VERT_RESTORE_RGBA( 1 );
638 VERT_RESTORE_RGBA( 2 );
640 VERT_RESTORE_RGBA( 3 );
643 VERT_RESTORE_SPEC( 0 );
644 VERT_RESTORE_SPEC( 1 );
645 VERT_RESTORE_SPEC( 2 );
647 VERT_RESTORE_SPEC( 3 );
652 VERT_RESTORE_IND( 0 );
653 VERT_RESTORE_IND( 1 );
654 VERT_RESTORE_IND( 2 );
656 VERT_RESTORE_IND( 3 );
663 VERT_RESTORE_RGBA( 0 );
664 VERT_RESTORE_RGBA( 1 );
665 VERT_RESTORE_RGBA( 2 );
666 if (HAVE_SPEC
&& VB
->SecondaryColorPtr
[0]) {
667 VERT_RESTORE_SPEC( 0 );
668 VERT_RESTORE_SPEC( 1 );
669 VERT_RESTORE_SPEC( 2 );
673 VERT_RESTORE_IND( 0 );
674 VERT_RESTORE_IND( 1 );
675 VERT_RESTORE_IND( 2 );
680 static void TAG(quad
)( GLcontext
*ctx
, GLuint e0
,
681 GLuint e1
, GLuint e2
, GLuint e3
)
684 struct vertex_buffer
*VB
= &TNL_CONTEXT(ctx
)->vb
;
685 GLubyte ef1
= VB
->EdgeFlag
[e1
];
686 GLubyte ef3
= VB
->EdgeFlag
[e3
];
687 VB
->EdgeFlag
[e1
] = 0;
688 TAG(triangle
)( ctx
, e0
, e1
, e3
);
689 VB
->EdgeFlag
[e1
] = ef1
;
690 VB
->EdgeFlag
[e3
] = 0;
691 TAG(triangle
)( ctx
, e1
, e2
, e3
);
692 VB
->EdgeFlag
[e3
] = ef3
;
694 TAG(triangle
)( ctx
, e0
, e1
, e3
);
695 TAG(triangle
)( ctx
, e1
, e2
, e3
);
702 static void TAG(line
)( GLcontext
*ctx
, GLuint e0
, GLuint e1
)
704 struct vertex_buffer
*VB
= &TNL_CONTEXT(ctx
)->vb
;
708 v
[0] = (VERTEX
*)GET_VERTEX(e0
);
709 v
[1] = (VERTEX
*)GET_VERTEX(e1
);
714 VERT_COPY_RGBA( v
[0], v
[1] );
715 if (HAVE_SPEC
&& VB
->SecondaryColorPtr
[0]) {
717 VERT_COPY_SPEC( v
[0], v
[1] );
722 VERT_COPY_IND( v
[0], v
[1] );
730 VERT_RESTORE_RGBA( 0 );
732 if (HAVE_SPEC
&& VB
->SecondaryColorPtr
[0]) {
733 VERT_RESTORE_SPEC( 0 );
737 VERT_RESTORE_IND( 0 );
744 static void TAG(points
)( GLcontext
*ctx
, GLuint first
, GLuint last
)
746 struct vertex_buffer
*VB
= &TNL_CONTEXT( ctx
)->vb
;
751 for ( i
= first
; i
< last
; i
++ ) {
752 if ( VB
->ClipMask
[i
] == 0 ) {
753 VERTEX
*v
= (VERTEX
*)GET_VERTEX(i
);
758 for ( i
= first
; i
< last
; i
++ ) {
759 GLuint e
= VB
->Elts
[i
];
760 if ( VB
->ClipMask
[e
] == 0 ) {
761 VERTEX
*v
= (VERTEX
*)GET_VERTEX(e
);
769 static void TAG(init
)( void )
772 TAB
[IND
].quad
= TAG(quad
);
775 TAB
[IND
].triangle
= TAG(triangle
);
778 TAB
[IND
].line
= TAG(line
);
781 TAB
[IND
].points
= TAG(points
);
792 #undef VERT_RESTORE_IND
798 #undef VERT_COPY_RGBA
799 #undef VERT_SAVE_RGBA
800 #undef VERT_RESTORE_RGBA
808 #undef VERT_COPY_SPEC
809 #undef VERT_SAVE_SPEC
810 #undef VERT_RESTORE_SPEC
812 #undef VERT_COPY_SPEC1
820 #if !HAVE_BACK_COLORS
821 #undef VERT_COPY_SPEC1
822 #undef VERT_COPY_IND1
823 #undef VERT_COPY_RGBA1
826 #ifndef INSANE_VERTICES