3 * Mesa 3-D graphics library
6 * Copyright (C) 1999-2003 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 /* Unlike the other templates here, this assumes quite a bit about the
31 * underlying hardware. Specifically it assumes a d3d-like vertex
32 * format, with a layout more or less constrained to look like the
38 * struct { char r, g, b, a; } color;
39 * struct { char r, g, b, fog; } spec;
47 * struct { char r, g, b, a; } color;
48 * struct { char r, g, b, fog; } spec;
56 * struct { char r, g, b, a; } color;
59 * unsigned int ui[16];
60 * unsigned char ub4[4][16];
64 * VERTEX: hw vertex type as above
65 * VERTEX_COLOR: hw color struct type in VERTEX
67 * DO_XYZW: Emit xyz and maybe w coordinates.
68 * DO_RGBA: Emit color.
69 * DO_SPEC: Emit specular color.
70 * DO_FOG: Emit fog coordinate in specular alpha.
71 * DO_TEX0: Emit tex0 u,v coordinates.
72 * DO_TEX1: Emit tex1 u,v coordinates.
73 * DO_TEX2: Emit tex2 u,v coordinates.
74 * DO_TEX3: Emit tex3 u,v coordinates.
75 * DO_PTEX: Emit tex0,1,2,3 q coordinates where possible.
77 * HAVE_RGBA_COLOR: Hardware takes color in rgba order (else bgra).
79 * HAVE_HW_VIEWPORT: Hardware performs viewport transform.
80 * HAVE_HW_DIVIDE: Hardware performs perspective divide.
82 * HAVE_TINY_VERTICES: Hardware understands v.tv format.
83 * HAVE_PTEX_VERTICES: Hardware understands v.pv format.
84 * HAVE_NOTEX_VERTICES: Hardware understands v.v format with texcount 0.
86 * Additionally, this template assumes it is emitting *transformed*
87 * vertices; the modifications to emit untransformed vertices (ie. to
88 * t&l hardware) are probably too great to cooexist with the code
89 * already in this file.
91 * NOTE: The PTEX vertex format always includes TEX0 and TEX1, even if
92 * only TEX0 is enabled, in order to maintain a vertex size which is
93 * an exact number of quadwords.
96 #if (HAVE_HW_VIEWPORT)
97 #define VIEWPORT_X(dst,x) dst = x
98 #define VIEWPORT_Y(dst,y) dst = y
99 #define VIEWPORT_Z(dst,z) dst = z
101 #define VIEWPORT_X(dst,x) dst = s[0] * x + s[12]
102 #define VIEWPORT_Y(dst,y) dst = s[5] * y + s[13]
103 #define VIEWPORT_Z(dst,z) dst = s[10] * z + s[14]
106 #if (HAVE_HW_DIVIDE && !HAVE_PTEX_VERTICES)
107 #error "can't cope with this combination"
114 #ifndef CHECK_HW_DIVIDE
115 #define CHECK_HW_DIVIDE 1
118 #if (HAVE_HW_DIVIDE || DO_SPEC || DO_TEX0 || DO_FOG || !HAVE_TINY_VERTICES)
120 static void TAG(emit
)( GLcontext
*ctx
,
121 GLuint start
, GLuint end
,
126 struct vertex_buffer
*VB
= &TNL_CONTEXT(ctx
)->vb
;
127 GLfloat (*tc0
)[4], (*tc1
)[4], (*fog
)[4];
128 GLfloat (*tc2
)[4], (*tc3
)[4];
129 GLfloat (*col
)[4], (*spec
)[4];
130 GLuint tc0_stride
, tc1_stride
, col_stride
, spec_stride
, fog_stride
;
131 GLuint tc2_stride
, tc3_stride
;
132 GLuint tc0_size
, tc1_size
, col_size
;
133 GLuint tc2_size
, tc3_size
;
136 VERTEX
*v
= (VERTEX
*)dest
;
137 const GLfloat
*s
= GET_VIEWPORT_MAT();
138 const GLubyte
*mask
= VB
->ClipMask
;
141 /* fprintf(stderr, "%s(big) importable %d %d..%d\n", */
142 /* __FUNCTION__, VB->importable_data, start, end); */
144 if (HAVE_HW_VIEWPORT
&& HAVE_HW_DIVIDE
&& CHECK_HW_DIVIDE
) {
146 coord
= VB
->ClipPtr
->data
;
147 coord_stride
= VB
->ClipPtr
->stride
;
150 coord
= VB
->NdcPtr
->data
;
151 coord_stride
= VB
->NdcPtr
->stride
;
155 const GLuint t3
= GET_TEXSOURCE(3);
156 tc3
= VB
->TexCoordPtr
[t3
]->data
;
157 tc3_stride
= VB
->TexCoordPtr
[t3
]->stride
;
159 tc3_size
= VB
->TexCoordPtr
[t3
]->size
;
163 const GLuint t2
= GET_TEXSOURCE(2);
164 tc2
= VB
->TexCoordPtr
[t2
]->data
;
165 tc2_stride
= VB
->TexCoordPtr
[t2
]->stride
;
167 tc2_size
= VB
->TexCoordPtr
[t2
]->size
;
171 const GLuint t1
= GET_TEXSOURCE(1);
172 tc1
= VB
->TexCoordPtr
[t1
]->data
;
173 tc1_stride
= VB
->TexCoordPtr
[t1
]->stride
;
175 tc1_size
= VB
->TexCoordPtr
[t1
]->size
;
179 const GLuint t0
= GET_TEXSOURCE(0);
180 tc0_stride
= VB
->TexCoordPtr
[t0
]->stride
;
181 tc0
= VB
->TexCoordPtr
[t0
]->data
;
183 tc0_size
= VB
->TexCoordPtr
[t0
]->size
;
187 col_stride
= VB
->ColorPtr
[0]->stride
;
188 col
= VB
->ColorPtr
[0]->data
;
189 col_size
= VB
->ColorPtr
[0]->size
;
193 if (VB
->SecondaryColorPtr
[0]) {
194 spec_stride
= VB
->SecondaryColorPtr
[0]->stride
;
195 spec
= VB
->SecondaryColorPtr
[0]->data
;
197 spec
= (GLfloat (*)[4])ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
];
203 if (VB
->FogCoordPtr
) {
204 fog
= VB
->FogCoordPtr
->data
;
205 fog_stride
= VB
->FogCoordPtr
->stride
;
208 static GLfloat tmp
[4] = {0, 0, 0, 0};
214 /* May have nonstandard strides:
217 STRIDE_4F(coord
, start
* coord_stride
);
219 STRIDE_4F(tc0
, start
* tc0_stride
);
221 STRIDE_4F(tc1
, start
* tc1_stride
);
223 STRIDE_4F(tc2
, start
* tc2_stride
);
225 STRIDE_4F(tc3
, start
* tc3_stride
);
227 STRIDE_4F(col
, start
* col_stride
);
229 STRIDE_4F(spec
, start
* spec_stride
);
231 STRIDE_4F(fog
, start
* fog_stride
);
234 for (i
=start
; i
< end
; i
++, v
= (VERTEX
*)((GLubyte
*)v
+ stride
)) {
236 if (HAVE_HW_VIEWPORT
|| mask
[i
] == 0) {
237 VIEWPORT_X(v
->v
.x
, coord
[0][0]);
238 VIEWPORT_Y(v
->v
.y
, coord
[0][1]);
239 VIEWPORT_Z(v
->v
.z
, coord
[0][2]);
240 v
->v
.w
= coord
[0][3];
242 STRIDE_4F(coord
, coord_stride
);
245 UNCLAMPED_FLOAT_TO_UBYTE(v
->v
.color
.red
, col
[0][0]);
246 UNCLAMPED_FLOAT_TO_UBYTE(v
->v
.color
.green
, col
[0][1]);
247 UNCLAMPED_FLOAT_TO_UBYTE(v
->v
.color
.blue
, col
[0][2]);
249 UNCLAMPED_FLOAT_TO_UBYTE(v
->v
.color
.alpha
, col
[0][3]);
251 v
->v
.color
.alpha
= CHAN_MAX
;
253 STRIDE_4F(col
, col_stride
);
256 UNCLAMPED_FLOAT_TO_UBYTE(v
->v
.specular
.red
, spec
[0][0]);
257 UNCLAMPED_FLOAT_TO_UBYTE(v
->v
.specular
.green
, spec
[0][1]);
258 UNCLAMPED_FLOAT_TO_UBYTE(v
->v
.specular
.blue
, spec
[0][2]);
259 STRIDE_4F(spec
, spec_stride
);
262 UNCLAMPED_FLOAT_TO_UBYTE(v
->v
.specular
.alpha
, fog
[0][0]);
263 STRIDE_4F(fog
, fog_stride
);
269 if (HAVE_PTEX_VERTICES
) {
271 v
->pv
.q0
= tc0
[0][3];
275 else if (tc0_size
== 4) {
276 float rhw
= 1.0 / tc0
[0][3];
282 STRIDE_4F(tc0
, tc0_stride
);
286 v
->pv
.u1
= tc1
[0][0];
287 v
->pv
.v1
= tc1
[0][1];
289 v
->pv
.q1
= tc1
[0][3];
297 STRIDE_4F(tc1
, tc1_stride
);
300 *(GLuint
*)&v
->pv
.q1
= 0; /* avoid culling on radeon */
304 v
->pv
.u2
= tc2
[0][0];
305 v
->pv
.v2
= tc2
[0][1];
307 v
->pv
.q2
= tc2
[0][3];
315 STRIDE_4F(tc2
, tc2_stride
);
319 v
->pv
.u3
= tc3
[0][0];
320 v
->pv
.v3
= tc3
[0][1];
322 v
->pv
.q3
= tc3
[0][3];
330 STRIDE_4F(tc3
, tc3_stride
);
338 #error "cannot use tiny vertices with hw perspective divide"
341 static void TAG(emit
)( GLcontext
*ctx
, GLuint start
, GLuint end
,
342 void *dest
, GLuint stride
)
345 struct vertex_buffer
*VB
= &TNL_CONTEXT(ctx
)->vb
;
347 GLuint col_stride
, col_size
;
348 GLfloat (*coord
)[4] = VB
->NdcPtr
->data
;
349 GLuint coord_stride
= VB
->NdcPtr
->stride
;
350 GLfloat
*v
= (GLfloat
*)dest
;
351 const GLubyte
*mask
= VB
->ClipMask
;
352 const GLfloat
*s
= GET_VIEWPORT_MAT();
359 col
= VB
->ColorPtr
[0]->data
;
360 col_stride
= VB
->ColorPtr
[0]->stride
;
361 col_size
= VB
->ColorPtr
[0]->size
;
363 /* fprintf(stderr, "%s(small) importable %x\n", */
364 /* __FUNCTION__, VB->importable_data); */
366 /* Pack what's left into a 4-dword vertex. Color is in a different
367 * place, and there is no 'w' coordinate.
370 STRIDE_4F(coord
, start
* coord_stride
);
371 STRIDE_4F(col
, start
* col_stride
);
374 for (i
=start
; i
< end
; i
++, v
+=4) {
376 if (HAVE_HW_VIEWPORT
|| mask
[i
] == 0) {
377 VIEWPORT_X(v
[0], coord
[0][0]);
378 VIEWPORT_Y(v
[1], coord
[0][1]);
379 VIEWPORT_Z(v
[2], coord
[0][2]);
381 STRIDE_4F( coord
, coord_stride
);
384 VERTEX_COLOR
*c
= (VERTEX_COLOR
*)&v
[3];
385 UNCLAMPED_FLOAT_TO_UBYTE(c
->red
, col
[0][0]);
386 UNCLAMPED_FLOAT_TO_UBYTE(c
->green
, col
[0][1]);
387 UNCLAMPED_FLOAT_TO_UBYTE(c
->blue
, col
[0][2]);
389 UNCLAMPED_FLOAT_TO_UBYTE(c
->alpha
, col
[0][3]);
393 STRIDE_4F( col
, col_stride
);
395 /* fprintf(stderr, "vert %d: %.2f %.2f %.2f %x\n", */
396 /* i, v[0], v[1], v[2], *(int *)&v[3]); */
402 #if (DO_XYZW) && (DO_RGBA)
405 #if (HAVE_PTEX_VERTICES)
406 static GLboolean
TAG(check_tex_sizes
)( GLcontext
*ctx
)
409 struct vertex_buffer
*VB
= &TNL_CONTEXT(ctx
)->vb
;
411 /* Force 'missing' texcoords to something valid.
413 if (DO_TEX3
&& VB
->TexCoordPtr
[2] == 0)
414 VB
->TexCoordPtr
[2] = VB
->TexCoordPtr
[3];
416 if (DO_TEX2
&& VB
->TexCoordPtr
[1] == 0)
417 VB
->TexCoordPtr
[1] = VB
->TexCoordPtr
[2];
419 if (DO_TEX1
&& VB
->TexCoordPtr
[0] == 0)
420 VB
->TexCoordPtr
[0] = VB
->TexCoordPtr
[1];
425 if ((DO_TEX3
&& VB
->TexCoordPtr
[GET_TEXSOURCE(3)]->size
== 4) ||
426 (DO_TEX2
&& VB
->TexCoordPtr
[GET_TEXSOURCE(2)]->size
== 4) ||
427 (DO_TEX1
&& VB
->TexCoordPtr
[GET_TEXSOURCE(1)]->size
== 4) ||
428 (DO_TEX0
&& VB
->TexCoordPtr
[GET_TEXSOURCE(0)]->size
== 4))
434 static GLboolean
TAG(check_tex_sizes
)( GLcontext
*ctx
)
437 struct vertex_buffer
*VB
= &TNL_CONTEXT(ctx
)->vb
;
439 /* Force 'missing' texcoords to something valid.
441 if (DO_TEX3
&& VB
->TexCoordPtr
[2] == 0)
442 VB
->TexCoordPtr
[2] = VB
->TexCoordPtr
[3];
444 if (DO_TEX2
&& VB
->TexCoordPtr
[1] == 0)
445 VB
->TexCoordPtr
[1] = VB
->TexCoordPtr
[2];
447 if (DO_TEX1
&& VB
->TexCoordPtr
[0] == 0)
448 VB
->TexCoordPtr
[0] = VB
->TexCoordPtr
[1];
453 /* No hardware support for projective texture. Can fake it for
456 if ((DO_TEX3
&& VB
->TexCoordPtr
[GET_TEXSOURCE(3)]->size
== 4) ||
457 (DO_TEX2
&& VB
->TexCoordPtr
[GET_TEXSOURCE(2)]->size
== 4) ||
458 (DO_TEX1
&& VB
->TexCoordPtr
[GET_TEXSOURCE(1)]->size
== 4)) {
463 if (DO_TEX0
&& VB
->TexCoordPtr
[GET_TEXSOURCE(0)]->size
== 4) {
464 if (DO_TEX1
|| DO_TEX2
|| DO_TEX3
) {
475 static void TAG(interp
)( GLcontext
*ctx
,
477 GLuint edst
, GLuint eout
, GLuint ein
,
478 GLboolean force_boundary
)
481 struct vertex_buffer
*VB
= &TNL_CONTEXT(ctx
)->vb
;
482 GLubyte
*ddverts
= GET_VERTEX_STORE();
483 GLuint size
= GET_VERTEX_SIZE();
484 const GLfloat
*dstclip
= VB
->ClipPtr
->data
[edst
];
486 const GLfloat
*s
= GET_VIEWPORT_MAT();
488 VERTEX
*dst
= (VERTEX
*)(ddverts
+ (edst
* size
));
489 VERTEX
*in
= (VERTEX
*)(ddverts
+ (ein
* size
));
490 VERTEX
*out
= (VERTEX
*)(ddverts
+ (eout
* size
));
494 if (HAVE_HW_DIVIDE
&& CHECK_HW_DIVIDE
) {
495 VIEWPORT_X( dst
->v
.x
, dstclip
[0] );
496 VIEWPORT_Y( dst
->v
.y
, dstclip
[1] );
497 VIEWPORT_Z( dst
->v
.z
, dstclip
[2] );
501 w
= 1.0 / dstclip
[3];
502 VIEWPORT_X( dst
->v
.x
, dstclip
[0] * w
);
503 VIEWPORT_Y( dst
->v
.y
, dstclip
[1] * w
);
504 VIEWPORT_Z( dst
->v
.z
, dstclip
[2] * w
);
507 if ((HAVE_HW_DIVIDE
&& CHECK_HW_DIVIDE
) ||
508 DO_FOG
|| DO_SPEC
|| DO_TEX0
|| DO_TEX1
||
509 DO_TEX2
|| DO_TEX3
|| !HAVE_TINY_VERTICES
) {
513 INTERP_UB( t
, dst
->ub4
[4][0], out
->ub4
[4][0], in
->ub4
[4][0] );
514 INTERP_UB( t
, dst
->ub4
[4][1], out
->ub4
[4][1], in
->ub4
[4][1] );
515 INTERP_UB( t
, dst
->ub4
[4][2], out
->ub4
[4][2], in
->ub4
[4][2] );
516 INTERP_UB( t
, dst
->ub4
[4][3], out
->ub4
[4][3], in
->ub4
[4][3] );
519 INTERP_UB( t
, dst
->v
.specular
.red
, out
->v
.specular
.red
, in
->v
.specular
.red
);
520 INTERP_UB( t
, dst
->v
.specular
.green
, out
->v
.specular
.green
, in
->v
.specular
.green
);
521 INTERP_UB( t
, dst
->v
.specular
.blue
, out
->v
.specular
.blue
, in
->v
.specular
.blue
);
524 INTERP_UB( t
, dst
->v
.specular
.alpha
, out
->v
.specular
.alpha
, in
->v
.specular
.alpha
);
528 if (HAVE_PTEX_VERTICES
) {
529 INTERP_F( t
, dst
->pv
.u0
, out
->pv
.u0
, in
->pv
.u0
);
530 INTERP_F( t
, dst
->pv
.v0
, out
->pv
.v0
, in
->pv
.v0
);
531 INTERP_F( t
, dst
->pv
.q0
, out
->pv
.q0
, in
->pv
.q0
);
533 GLfloat wout
= VB
->NdcPtr
->data
[eout
][3];
534 GLfloat win
= VB
->NdcPtr
->data
[ein
][3];
535 GLfloat qout
= out
->pv
.w
/ wout
;
536 GLfloat qin
= in
->pv
.w
/ win
;
539 ASSERT( !HAVE_HW_DIVIDE
);
541 INTERP_F( t
, dst
->v
.u0
, out
->v
.u0
* qout
, in
->v
.u0
* qin
);
542 INTERP_F( t
, dst
->v
.v0
, out
->v
.v0
* qout
, in
->v
.v0
* qin
);
543 INTERP_F( t
, qdst
, qout
, qin
);
552 INTERP_F( t
, dst
->v
.u0
, out
->v
.u0
, in
->v
.u0
);
553 INTERP_F( t
, dst
->v
.v0
, out
->v
.v0
, in
->v
.v0
);
558 INTERP_F( t
, dst
->pv
.u1
, out
->pv
.u1
, in
->pv
.u1
);
559 INTERP_F( t
, dst
->pv
.v1
, out
->pv
.v1
, in
->pv
.v1
);
560 INTERP_F( t
, dst
->pv
.q1
, out
->pv
.q1
, in
->pv
.q1
);
562 INTERP_F( t
, dst
->v
.u1
, out
->v
.u1
, in
->v
.u1
);
563 INTERP_F( t
, dst
->v
.v1
, out
->v
.v1
, in
->v
.v1
);
567 dst
->pv
.q1
= 0.0; /* must be a valid float on radeon */
571 INTERP_F( t
, dst
->pv
.u2
, out
->pv
.u2
, in
->pv
.u2
);
572 INTERP_F( t
, dst
->pv
.v2
, out
->pv
.v2
, in
->pv
.v2
);
573 INTERP_F( t
, dst
->pv
.q2
, out
->pv
.q2
, in
->pv
.q2
);
575 INTERP_F( t
, dst
->v
.u2
, out
->v
.u2
, in
->v
.u2
);
576 INTERP_F( t
, dst
->v
.v2
, out
->v
.v2
, in
->v
.v2
);
581 INTERP_F( t
, dst
->pv
.u3
, out
->pv
.u3
, in
->pv
.u3
);
582 INTERP_F( t
, dst
->pv
.v3
, out
->pv
.v3
, in
->pv
.v3
);
583 INTERP_F( t
, dst
->pv
.q3
, out
->pv
.q3
, in
->pv
.q3
);
585 INTERP_F( t
, dst
->v
.u3
, out
->v
.u3
, in
->v
.u3
);
586 INTERP_F( t
, dst
->v
.v3
, out
->v
.v3
, in
->v
.v3
);
590 /* 4-dword vertex. Color is in v[3] and there is no oow coordinate.
592 INTERP_UB( t
, dst
->ub4
[3][0], out
->ub4
[3][0], in
->ub4
[3][0] );
593 INTERP_UB( t
, dst
->ub4
[3][1], out
->ub4
[3][1], in
->ub4
[3][1] );
594 INTERP_UB( t
, dst
->ub4
[3][2], out
->ub4
[3][2], in
->ub4
[3][2] );
595 INTERP_UB( t
, dst
->ub4
[3][3], out
->ub4
[3][3], in
->ub4
[3][3] );
599 #endif /* rgba && xyzw */
602 static void TAG(init
)( void )
604 setup_tab
[IND
].emit
= TAG(emit
);
606 #if (DO_XYZW && DO_RGBA)
607 setup_tab
[IND
].check_tex_sizes
= TAG(check_tex_sizes
);
608 setup_tab
[IND
].interp
= TAG(interp
);
612 setup_tab
[IND
].copy_pv
= copy_pv_rgba4_spec5
;
613 else if (HAVE_HW_DIVIDE
|| DO_SPEC
|| DO_FOG
|| DO_TEX0
|| DO_TEX1
||
614 DO_TEX2
|| DO_TEX3
|| !HAVE_TINY_VERTICES
)
615 setup_tab
[IND
].copy_pv
= copy_pv_rgba4
;
617 setup_tab
[IND
].copy_pv
= copy_pv_rgba3
;
621 ASSERT(HAVE_PTEX_VERTICES
);
622 setup_tab
[IND
].vertex_format
= PROJ_TEX3_VERTEX_FORMAT
;
623 setup_tab
[IND
].vertex_size
= 18;
626 setup_tab
[IND
].vertex_format
= TEX3_VERTEX_FORMAT
;
627 setup_tab
[IND
].vertex_size
= 14;
632 ASSERT(HAVE_PTEX_VERTICES
);
633 setup_tab
[IND
].vertex_format
= PROJ_TEX3_VERTEX_FORMAT
;
634 setup_tab
[IND
].vertex_size
= 18;
637 setup_tab
[IND
].vertex_format
= TEX2_VERTEX_FORMAT
;
638 setup_tab
[IND
].vertex_size
= 12;
643 ASSERT(HAVE_PTEX_VERTICES
);
644 setup_tab
[IND
].vertex_format
= PROJ_TEX1_VERTEX_FORMAT
;
645 setup_tab
[IND
].vertex_size
= 12;
648 setup_tab
[IND
].vertex_format
= TEX1_VERTEX_FORMAT
;
649 setup_tab
[IND
].vertex_size
= 10;
653 if (DO_PTEX
&& HAVE_PTEX_VERTICES
) {
654 setup_tab
[IND
].vertex_format
= PROJ_TEX1_VERTEX_FORMAT
;
655 setup_tab
[IND
].vertex_size
= 12;
657 setup_tab
[IND
].vertex_format
= TEX0_VERTEX_FORMAT
;
658 setup_tab
[IND
].vertex_size
= 8;
661 else if (!HAVE_HW_DIVIDE
&& !DO_SPEC
&& !DO_FOG
&& HAVE_TINY_VERTICES
) {
662 setup_tab
[IND
].vertex_format
= TINY_VERTEX_FORMAT
;
663 setup_tab
[IND
].vertex_size
= 4;
664 } else if (HAVE_NOTEX_VERTICES
) {
665 setup_tab
[IND
].vertex_format
= NOTEX_VERTEX_FORMAT
;
666 setup_tab
[IND
].vertex_size
= 6;
668 setup_tab
[IND
].vertex_format
= TEX0_VERTEX_FORMAT
;
669 setup_tab
[IND
].vertex_size
= 8;