2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
25 * Keith Whitwell <keithw@vmware.com>
31 * Template for render stages which build and emit vertices directly
32 * to fixed-size dma buffers. Useful for rendering strips and other
33 * native primitives where clipping and per-vertex tweaks such as
34 * those in t_dd_tritmp.h are not required.
36 * Produces code for both inline triangles and indexed triangles.
37 * Where various primitive types are unaccelerated by hardware, the
38 * code attempts to fallback to other primitive types (quadstrips to
39 * tristrips, lineloops to linestrips).
42 #if !defined(HAVE_TRIANGLES)
43 #error "must have at least triangles to use render template"
47 #define ELTS_VARS(buf)
48 #define ALLOC_ELTS(nr) 0
49 #define EMIT_ELT( offset, elt )
50 #define EMIT_TWO_ELTS( offset, elt0, elt1 )
51 #define INCR_ELTS( nr )
52 #define ELT_INIT(prim)
53 #define GET_CURRENT_VB_MAX_ELTS() 0
54 #define GET_SUBSEQUENT_VB_MAX_ELTS() 0
55 #define RELEASE_ELT_VERTS()
56 #define EMIT_INDEXED_VERTS( ctx, start, count )
60 #define EMIT_TWO_ELTS( offset, elt0, elt1 ) \
62 EMIT_ELT( offset, elt0 ); \
63 EMIT_ELT( offset+1, elt1 ); \
68 /**********************************************************************/
69 /* Render whole begin/end objects */
70 /**********************************************************************/
76 static void *TAG(emit_elts)( struct gl_context *ctx, GLuint *elts, GLuint nr,
83 for ( i = 0 ; i+1 < nr ; i+=2, elts += 2 ) {
84 EMIT_TWO_ELTS( 0, elts[0], elts[1] );
89 EMIT_ELT( 0, elts[0] );
93 return (void *)ELTPTR;
97 static __inline void *TAG(emit_verts)( struct gl_context *ctx, GLuint start,
98 GLuint count, void *buf )
100 return EMIT_VERTS(ctx, start, count, buf);
103 /***********************************************************************
104 * Render non-indexed primitives.
105 ***********************************************************************/
107 static void TAG(render_points_verts)( struct gl_context *ctx,
114 int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
120 currentsz = GET_CURRENT_VB_MAX_VERTS();
124 for (j = start; j < count; j += nr ) {
125 nr = MIN2( currentsz, count - j );
126 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
131 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
136 static void TAG(render_lines_verts)( struct gl_context *ctx,
143 int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
149 /* Emit whole number of lines in total and in each buffer:
151 count -= (count-start) & 1;
152 currentsz = GET_CURRENT_VB_MAX_VERTS();
153 currentsz -= currentsz & 1;
159 for (j = start; j < count; j += nr ) {
160 nr = MIN2( currentsz, count - j );
161 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
166 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
172 static void TAG(render_line_strip_verts)( struct gl_context *ctx,
177 if (HAVE_LINE_STRIPS) {
179 int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
183 INIT( GL_LINE_STRIP );
185 currentsz = GET_CURRENT_VB_MAX_VERTS();
189 for (j = start; j + 1 < count; j += nr - 1 ) {
190 nr = MIN2( currentsz, count - j );
191 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
198 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
204 static void TAG(render_line_loop_verts)( struct gl_context *ctx,
209 if (HAVE_LINE_STRIPS) {
211 int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
215 INIT( GL_LINE_STRIP );
217 if (flags & PRIM_BEGIN)
222 /* Ensure last vertex won't wrap buffers:
224 currentsz = GET_CURRENT_VB_MAX_VERTS();
233 for ( ; j + 1 < count; j += nr - 1 ) {
234 nr = MIN2( currentsz, count - j );
236 if (j + nr >= count &&
241 tmp = ALLOC_VERTS(nr+1);
242 tmp = TAG(emit_verts)( ctx, j, nr, tmp );
243 tmp = TAG(emit_verts)( ctx, start, 1, tmp );
247 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
253 else if (start + 1 < count && (flags & PRIM_END)) {
255 tmp = ALLOC_VERTS(2);
256 tmp = TAG(emit_verts)( ctx, start+1, 1, tmp );
257 tmp = TAG(emit_verts)( ctx, start, 1, tmp );
264 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
270 static void TAG(render_triangles_verts)( struct gl_context *ctx,
276 int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/3) * 3;
282 currentsz = (GET_CURRENT_VB_MAX_VERTS()/3) * 3;
284 /* Emit whole number of tris in total. dmasz is already a multiple
287 count -= (count-start)%3;
292 for (j = start; j < count; j += nr) {
293 nr = MIN2( currentsz, count - j );
294 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
301 static void TAG(render_tri_strip_verts)( struct gl_context *ctx,
306 if (HAVE_TRI_STRIPS) {
309 int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
312 INIT(GL_TRIANGLE_STRIP);
314 currentsz = GET_CURRENT_VB_MAX_VERTS();
320 /* From here on emit even numbers of tris when wrapping over buffers:
322 dmasz -= (dmasz & 1);
323 currentsz -= (currentsz & 1);
325 for (j = start ; j + 2 < count; j += nr - 2 ) {
326 nr = MIN2( currentsz, count - j );
327 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
334 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
339 static void TAG(render_tri_fan_verts)( struct gl_context *ctx,
347 int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
350 INIT(GL_TRIANGLE_FAN);
352 currentsz = GET_CURRENT_VB_MAX_VERTS();
357 for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
359 nr = MIN2( currentsz, count - j + 1 );
360 tmp = ALLOC_VERTS( nr );
361 tmp = TAG(emit_verts)( ctx, start, 1, tmp );
362 tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp );
370 /* Could write code to emit these as indexed vertices (for the
371 * g400, for instance).
373 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
379 static void TAG(render_poly_verts)( struct gl_context *ctx,
387 int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
392 currentsz = GET_CURRENT_VB_MAX_VERTS();
397 for (j = start + 1 ; j + 1 < count ; j += nr - 2 ) {
399 nr = MIN2( currentsz, count - j + 1 );
400 tmp = ALLOC_VERTS( nr );
401 tmp = TAG(emit_verts)( ctx, start, 1, tmp );
402 tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp );
409 else if (HAVE_TRI_FANS &&
410 (ctx->Light.ShadeModel == GL_SMOOTH ||
411 ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION_EXT)) {
412 TAG(render_tri_fan_verts)( ctx, start, count, flags );
414 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
419 static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
426 if (HAVE_QUAD_STRIPS) {
429 int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
434 currentsz = GET_CURRENT_VB_MAX_VERTS();
439 dmasz -= (dmasz & 2);
440 currentsz -= (currentsz & 2);
442 for (j = start ; j + 3 < count; j += nr - 2 ) {
443 nr = MIN2( currentsz, count - j );
444 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
450 else if (HAVE_TRI_STRIPS) {
452 int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
455 /* Emit smooth-shaded quadstrips as tristrips:
458 INIT( GL_TRIANGLE_STRIP );
460 /* Emit whole number of quads in total, and in each buffer.
463 currentsz = GET_CURRENT_VB_MAX_VERTS();
464 currentsz -= currentsz & 1;
465 count -= (count-start) & 1;
471 for (j = start; j + 3 < count; j += nr - 2 ) {
472 nr = MIN2( currentsz, count - j );
473 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
480 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
486 static void TAG(render_quads_verts)( struct gl_context *ctx,
493 int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/4) * 4;
499 /* Emit whole number of quads in total. dmasz is already a multiple
502 count -= (count-start)%4;
504 currentsz = (GET_CURRENT_VB_MAX_VERTS()/4) * 4;
508 for (j = start; j < count; j += nr) {
509 nr = MIN2( currentsz, count - j );
510 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
514 else if (HAVE_TRIANGLES) {
515 /* Hardware doesn't have a quad primitive type -- try to
516 * simulate it using triangle primitive. This is a win for
517 * gears, but is it useful in the broader world?
524 for (j = start; j < count-3; j += 4) {
525 void *tmp = ALLOC_VERTS( 6 );
528 tmp = EMIT_VERTS(ctx, j, 2, tmp);
529 tmp = EMIT_VERTS(ctx, j + 3, 1, tmp);
532 tmp = EMIT_VERTS(ctx, j + 1, 3, tmp);
537 /* Vertices won't fit in a single buffer, should never happen.
539 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
544 static void TAG(render_noop)( struct gl_context *ctx,
554 static tnl_render_func TAG(render_tab_verts)[GL_POLYGON+2] =
556 TAG(render_points_verts),
557 TAG(render_lines_verts),
558 TAG(render_line_loop_verts),
559 TAG(render_line_strip_verts),
560 TAG(render_triangles_verts),
561 TAG(render_tri_strip_verts),
562 TAG(render_tri_fan_verts),
563 TAG(render_quads_verts),
564 TAG(render_quad_strip_verts),
565 TAG(render_poly_verts),
570 /****************************************************************************
571 * Render elts using hardware indexed verts *
572 ****************************************************************************/
575 static void TAG(render_points_elts)( struct gl_context *ctx,
582 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
584 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
587 ELT_INIT( GL_POINTS );
589 currentsz = GET_CURRENT_VB_MAX_ELTS();
593 for (j = start; j < count; j += nr ) {
594 nr = MIN2( currentsz, count - j );
595 TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
600 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
607 static void TAG(render_lines_elts)( struct gl_context *ctx,
614 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
616 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
619 ELT_INIT( GL_LINES );
621 /* Emit whole number of lines in total and in each buffer:
623 count -= (count-start) & 1;
624 currentsz -= currentsz & 1;
627 currentsz = GET_CURRENT_VB_MAX_ELTS();
631 for (j = start; j < count; j += nr ) {
632 nr = MIN2( currentsz, count - j );
633 TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
638 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
644 static void TAG(render_line_strip_elts)( struct gl_context *ctx,
649 if (HAVE_LINE_STRIPS) {
651 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
653 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
656 FLUSH(); /* always a new primitive */
657 ELT_INIT( GL_LINE_STRIP );
659 currentsz = GET_CURRENT_VB_MAX_ELTS();
663 for (j = start; j + 1 < count; j += nr - 1 ) {
664 nr = MIN2( currentsz, count - j );
665 TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
670 /* TODO: Try to emit as indexed lines.
672 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
678 static void TAG(render_line_loop_elts)( struct gl_context *ctx,
683 if (HAVE_LINE_STRIPS) {
685 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
687 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
691 ELT_INIT( GL_LINE_STRIP );
693 if (flags & PRIM_BEGIN)
698 currentsz = GET_CURRENT_VB_MAX_ELTS();
703 /* Ensure last vertex doesn't wrap:
709 for ( ; j + 1 < count; j += nr - 1 ) {
710 nr = MIN2( currentsz, count - j );
712 if (j + nr >= count &&
717 tmp = ALLOC_ELTS(nr+1);
718 tmp = TAG(emit_elts)( ctx, elts+j, nr, tmp );
719 tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
723 TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
729 else if (start + 1 < count && (flags & PRIM_END)) {
732 tmp = TAG(emit_elts)( ctx, elts+start+1, 1, tmp );
733 tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
739 /* TODO: Try to emit as indexed lines */
740 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
746 /* For verts, we still eliminate the copy from main memory to dma
747 * buffers. For elts, this is probably no better (worse?) than the
750 static void TAG(render_triangles_elts)( struct gl_context *ctx,
756 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
757 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS()/3*3;
762 ELT_INIT( GL_TRIANGLES );
764 currentsz = GET_CURRENT_VB_MAX_ELTS();
766 /* Emit whole number of tris in total. dmasz is already a multiple
769 count -= (count-start)%3;
770 currentsz -= currentsz%3;
774 for (j = start; j < count; j += nr) {
775 nr = MIN2( currentsz, count - j );
776 TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
784 static void TAG(render_tri_strip_elts)( struct gl_context *ctx,
789 if (HAVE_TRI_STRIPS) {
792 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
793 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
797 ELT_INIT( GL_TRIANGLE_STRIP );
799 currentsz = GET_CURRENT_VB_MAX_ELTS();
804 /* Keep the same winding over multiple buffers:
806 dmasz -= (dmasz & 1);
807 currentsz -= (currentsz & 1);
809 for (j = start ; j + 2 < count; j += nr - 2 ) {
810 nr = MIN2( currentsz, count - j );
811 TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
816 /* TODO: try to emit as indexed triangles */
817 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
822 static void TAG(render_tri_fan_elts)( struct gl_context *ctx,
829 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
831 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
835 ELT_INIT( GL_TRIANGLE_FAN );
837 currentsz = GET_CURRENT_VB_MAX_ELTS();
842 for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
844 nr = MIN2( currentsz, count - j + 1 );
845 tmp = ALLOC_ELTS( nr );
846 tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
847 tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp );
853 /* TODO: try to emit as indexed triangles */
854 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
860 static void TAG(render_poly_elts)( struct gl_context *ctx,
867 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
869 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
873 ELT_INIT( GL_POLYGON );
875 currentsz = GET_CURRENT_VB_MAX_ELTS();
880 for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
882 nr = MIN2( currentsz, count - j + 1 );
883 tmp = ALLOC_ELTS( nr );
884 tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
885 tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp );
890 } else if (HAVE_TRI_FANS &&
891 (ctx->Light.ShadeModel == GL_SMOOTH ||
892 ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION_EXT)) {
893 TAG(render_tri_fan_verts)( ctx, start, count, flags );
895 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
900 static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
905 if (HAVE_QUAD_STRIPS && 0) {
907 else if (HAVE_TRI_STRIPS) {
909 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
910 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
915 currentsz = GET_CURRENT_VB_MAX_ELTS();
917 /* Emit whole number of quads in total, and in each buffer.
920 count -= (count-start) & 1;
921 currentsz -= currentsz & 1;
926 if (ctx->Light.ShadeModel == GL_FLAT) {
927 ELT_INIT( GL_TRIANGLES );
929 currentsz = currentsz/6*2;
932 for (j = start; j + 3 < count; j += nr - 2 ) {
933 nr = MIN2( currentsz, count - j );
938 GLint quads = (nr/2)-1;
939 ELTS_VARS( ALLOC_ELTS( quads*6 ) );
941 for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) {
942 EMIT_TWO_ELTS( 0, elts[0], elts[1] );
943 EMIT_TWO_ELTS( 2, elts[2], elts[1] );
944 EMIT_TWO_ELTS( 4, elts[3], elts[2] );
955 ELT_INIT( GL_TRIANGLE_STRIP );
957 for (j = start; j + 3 < count; j += nr - 2 ) {
958 nr = MIN2( currentsz, count - j );
959 TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
968 static void TAG(render_quads_elts)( struct gl_context *ctx,
975 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
976 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS()/4*4;
981 ELT_INIT( GL_TRIANGLES );
983 currentsz = GET_CURRENT_VB_MAX_ELTS()/4*4;
985 count -= (count-start)%4;
990 for (j = start; j < count; j += nr) {
991 nr = MIN2( currentsz, count - j );
992 TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
998 GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
999 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
1003 ELT_INIT( GL_TRIANGLES );
1004 currentsz = GET_CURRENT_VB_MAX_ELTS();
1006 /* Emit whole number of quads in total, and in each buffer.
1009 count -= (count-start) & 3;
1010 currentsz -= currentsz & 3;
1012 /* Adjust for rendering as triangles:
1014 currentsz = currentsz/6*4;
1020 for (j = start; j + 3 < count; j += nr - 2 ) {
1021 nr = MIN2( currentsz, count - j );
1027 ELTS_VARS( ALLOC_ELTS( quads * 6 ) );
1029 for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) {
1030 EMIT_TWO_ELTS( 0, elts[0], elts[1] );
1031 EMIT_TWO_ELTS( 2, elts[3], elts[1] );
1032 EMIT_TWO_ELTS( 4, elts[2], elts[3] );
1046 static tnl_render_func TAG(render_tab_elts)[GL_POLYGON+2] =
1048 TAG(render_points_elts),
1049 TAG(render_lines_elts),
1050 TAG(render_line_loop_elts),
1051 TAG(render_line_strip_elts),
1052 TAG(render_triangles_elts),
1053 TAG(render_tri_strip_elts),
1054 TAG(render_tri_fan_elts),
1055 TAG(render_quads_elts),
1056 TAG(render_quad_strip_elts),
1057 TAG(render_poly_elts),
1067 /* Pre-check the primitives in the VB to prevent the need for
1068 * fallbacks later on.
1070 static GLboolean TAG(validate_render)( struct gl_context *ctx,
1071 struct vertex_buffer *VB )
1075 if (VB->ClipOrMask & ~CLIP_CULL_BIT)
1078 if (VB->Elts && !HAVE_ELTS)
1081 for (i = 0 ; i < VB->PrimitiveCount ; i++) {
1082 GLuint prim = VB->Primitive[i].mode;
1083 GLuint count = VB->Primitive[i].count;
1084 GLboolean ok = GL_FALSE;
1089 switch (prim & PRIM_MODE_MASK) {
1094 ok = HAVE_LINES && !ctx->Line.StippleFlag;
1097 ok = HAVE_LINE_STRIPS && !ctx->Line.StippleFlag;
1100 ok = HAVE_LINE_STRIPS && !ctx->Line.StippleFlag;
1103 ok = HAVE_TRIANGLES;
1105 case GL_TRIANGLE_STRIP:
1106 ok = HAVE_TRI_STRIPS;
1108 case GL_TRIANGLE_FAN:
1112 if (HAVE_POLYGONS) {
1116 ok = (HAVE_TRI_FANS &&
1117 (ctx->Light.ShadeModel == GL_SMOOTH ||
1118 ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION_EXT));
1123 ok = HAVE_TRI_STRIPS;
1124 } else if (HAVE_QUAD_STRIPS) {
1127 ok = HAVE_TRI_STRIPS;
1134 ok = HAVE_TRIANGLES; /* flatshading is ok. */
1142 /* fprintf(stderr, "not ok %s\n", _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK)); */