2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 * Keith Whitwell <keith@tungstengraphics.com>
30 #include "bufferobj.h"
36 #include "nvfragprog.h"
40 #include "s_context.h"
44 #include "s_triangle.h"
45 #include "s_texture.h"
49 * Recompute the value of swrast->_RasterMask, etc. according to
50 * the current context. The _RasterMask field can be easily tested by
51 * drivers to determine certain basic GL state (does the primitive need
52 * stenciling, logic-op, fog, etc?).
55 _swrast_update_rasterflags( GLcontext
*ctx
)
57 GLuint rasterMask
= 0;
59 if (ctx
->Color
.AlphaEnabled
) rasterMask
|= ALPHATEST_BIT
;
60 if (ctx
->Color
.BlendEnabled
) rasterMask
|= BLEND_BIT
;
61 if (ctx
->Depth
.Test
) rasterMask
|= DEPTH_BIT
;
62 if (ctx
->Fog
.Enabled
) rasterMask
|= FOG_BIT
;
63 if (ctx
->Scissor
.Enabled
) rasterMask
|= CLIP_BIT
;
64 if (ctx
->Stencil
.Enabled
) rasterMask
|= STENCIL_BIT
;
65 if (ctx
->Visual
.rgbMode
) {
66 const GLuint colorMask
= *((GLuint
*) &ctx
->Color
.ColorMask
);
67 if (colorMask
!= 0xffffffff) rasterMask
|= MASKING_BIT
;
68 if (ctx
->Color
._LogicOpEnabled
) rasterMask
|= LOGIC_OP_BIT
;
69 if (ctx
->Texture
._EnabledUnits
) rasterMask
|= TEXTURE_BIT
;
72 if (ctx
->Color
.IndexMask
!= 0xffffffff) rasterMask
|= MASKING_BIT
;
73 if (ctx
->Color
.IndexLogicOpEnabled
) rasterMask
|= LOGIC_OP_BIT
;
76 if ( ctx
->Viewport
.X
< 0
77 || ctx
->Viewport
.X
+ ctx
->Viewport
.Width
> (GLint
) ctx
->DrawBuffer
->Width
78 || ctx
->Viewport
.Y
< 0
79 || ctx
->Viewport
.Y
+ ctx
->Viewport
.Height
> (GLint
) ctx
->DrawBuffer
->Height
) {
80 rasterMask
|= CLIP_BIT
;
83 if (ctx
->Depth
.OcclusionTest
|| ctx
->Occlusion
.Active
)
84 rasterMask
|= OCCLUSION_BIT
;
87 /* If we're not drawing to exactly one color buffer set the
88 * MULTI_DRAW_BIT flag. Also set it if we're drawing to no
89 * buffers or the RGBA or CI mask disables all writes.
92 if (ctx
->DrawBuffer
->_NumColorDrawBuffers
[0] != 1) {
94 /* more than one color buffer designated for writing (or zero buffers) */
95 rasterMask
|= MULTI_DRAW_BIT
;
97 else if (ctx
->Visual
.rgbMode
&& *((GLuint
*) ctx
->Color
.ColorMask
) == 0) {
98 rasterMask
|= MULTI_DRAW_BIT
; /* all RGBA channels disabled */
100 else if (!ctx
->Visual
.rgbMode
&& ctx
->Color
.IndexMask
==0) {
101 rasterMask
|= MULTI_DRAW_BIT
; /* all color index bits disabled */
104 if (ctx
->FragmentProgram
._Active
) {
105 rasterMask
|= FRAGPROG_BIT
;
108 if (ctx
->ATIFragmentShader
._Enabled
) {
109 rasterMask
|= ATIFRAGSHADER_BIT
;
112 SWRAST_CONTEXT(ctx
)->_RasterMask
= rasterMask
;
117 * Examine polycon culls tate to compute the _BackfaceSign field.
118 * _BackfaceSign will be 0 if no culling, -1 if culling back-faces,
119 * and 1 if culling front-faces. The Polygon FrontFace state also
123 _swrast_update_polygon( GLcontext
*ctx
)
125 GLfloat backface_sign
= 1;
127 if (ctx
->Polygon
.CullFlag
) {
129 switch(ctx
->Polygon
.CullFaceMode
) {
131 if(ctx
->Polygon
.FrontFace
==GL_CCW
)
135 if(ctx
->Polygon
.FrontFace
!=GL_CCW
)
139 case GL_FRONT_AND_BACK
:
148 SWRAST_CONTEXT(ctx
)->_BackfaceSign
= backface_sign
;
153 * Update the _PreferPixelFog field to indicate if we need to compute
154 * fog factors per-fragment.
157 _swrast_update_fog_hint( GLcontext
*ctx
)
159 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
160 swrast
->_PreferPixelFog
= (!swrast
->AllowVertexFog
||
161 ctx
->FragmentProgram
._Enabled
|| /* not _Active! */
162 (ctx
->Hint
.Fog
== GL_NICEST
&&
163 swrast
->AllowPixelFog
));
169 * Update the swrast->_AnyTextureCombine flag.
172 _swrast_update_texture_env( GLcontext
*ctx
)
174 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
176 swrast
->_AnyTextureCombine
= GL_FALSE
;
177 for (i
= 0; i
< ctx
->Const
.MaxTextureUnits
; i
++) {
178 if (ctx
->Texture
.Unit
[i
].EnvMode
== GL_COMBINE_EXT
||
179 ctx
->Texture
.Unit
[i
].EnvMode
== GL_COMBINE4_NV
) {
180 swrast
->_AnyTextureCombine
= GL_TRUE
;
188 * Update swrast->_FogColor and swrast->_FogEnable values.
191 _swrast_update_fog_state( GLcontext
*ctx
)
193 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
195 /* convert fog color to GLchan values */
196 CLAMPED_FLOAT_TO_CHAN(swrast
->_FogColor
[RCOMP
], ctx
->Fog
.Color
[RCOMP
]);
197 CLAMPED_FLOAT_TO_CHAN(swrast
->_FogColor
[GCOMP
], ctx
->Fog
.Color
[GCOMP
]);
198 CLAMPED_FLOAT_TO_CHAN(swrast
->_FogColor
[BCOMP
], ctx
->Fog
.Color
[BCOMP
]);
200 /* determine if fog is needed, and if so, which fog mode */
201 swrast
->_FogEnabled
= GL_FALSE
;
202 if (ctx
->FragmentProgram
._Active
) {
203 if (ctx
->FragmentProgram
._Current
->Base
.Target
==GL_FRAGMENT_PROGRAM_ARB
) {
204 const struct fragment_program
*p
205 = (struct fragment_program
*) ctx
->FragmentProgram
._Current
;
206 if (p
->FogOption
!= GL_NONE
) {
207 swrast
->_FogEnabled
= GL_TRUE
;
208 swrast
->_FogMode
= p
->FogOption
;
212 else if (ctx
->Fog
.Enabled
) {
213 swrast
->_FogEnabled
= GL_TRUE
;
214 swrast
->_FogMode
= ctx
->Fog
.Mode
;
220 * Update state for running fragment programs. Basically, load the
221 * program parameters with current state values.
224 _swrast_update_fragment_program( GLcontext
*ctx
)
226 if (ctx
->FragmentProgram
._Active
) {
227 struct fragment_program
*program
= ctx
->FragmentProgram
._Current
;
228 _mesa_load_state_parameters(ctx
, program
->Parameters
);
234 #define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \
239 /* State referenced by _swrast_choose_triangle, _swrast_choose_line.
241 #define _SWRAST_NEW_TRIANGLE (_SWRAST_NEW_DERIVED | \
248 _SWRAST_NEW_RASTERMASK| \
251 _DD_NEW_SEPARATE_SPECULAR)
253 #define _SWRAST_NEW_LINE (_SWRAST_NEW_DERIVED | \
260 _DD_NEW_SEPARATE_SPECULAR)
262 #define _SWRAST_NEW_POINT (_SWRAST_NEW_DERIVED | \
268 _DD_NEW_SEPARATE_SPECULAR)
270 #define _SWRAST_NEW_TEXTURE_SAMPLE_FUNC _NEW_TEXTURE
272 #define _SWRAST_NEW_TEXTURE_ENV_MODE _NEW_TEXTURE
274 #define _SWRAST_NEW_BLEND_FUNC _NEW_COLOR
279 * Stub for swrast->Triangle to select a true triangle function
280 * after a state change.
283 _swrast_validate_triangle( GLcontext
*ctx
,
288 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
290 _swrast_validate_derived( ctx
);
291 swrast
->choose_triangle( ctx
);
293 if (ctx
->Texture
._EnabledUnits
== 0
294 && NEED_SECONDARY_COLOR(ctx
)
295 && !ctx
->FragmentProgram
._Active
) {
296 /* separate specular color, but no texture */
297 swrast
->SpecTriangle
= swrast
->Triangle
;
298 swrast
->Triangle
= _swrast_add_spec_terms_triangle
;
301 swrast
->Triangle( ctx
, v0
, v1
, v2
);
305 * Called via swrast->Line. Examine current GL state and choose a software
306 * line routine. Then call it.
309 _swrast_validate_line( GLcontext
*ctx
, const SWvertex
*v0
, const SWvertex
*v1
)
311 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
313 _swrast_validate_derived( ctx
);
314 swrast
->choose_line( ctx
);
316 if (ctx
->Texture
._EnabledUnits
== 0
317 && NEED_SECONDARY_COLOR(ctx
)
318 && !ctx
->FragmentProgram
._Active
) {
319 swrast
->SpecLine
= swrast
->Line
;
320 swrast
->Line
= _swrast_add_spec_terms_line
;
324 swrast
->Line( ctx
, v0
, v1
);
328 * Called via swrast->Point. Examine current GL state and choose a software
329 * point routine. Then call it.
332 _swrast_validate_point( GLcontext
*ctx
, const SWvertex
*v0
)
334 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
336 _swrast_validate_derived( ctx
);
337 swrast
->choose_point( ctx
);
339 if (ctx
->Texture
._EnabledUnits
== 0
340 && NEED_SECONDARY_COLOR(ctx
)
341 && !ctx
->FragmentProgram
._Active
) {
342 swrast
->SpecPoint
= swrast
->Point
;
343 swrast
->Point
= _swrast_add_spec_terms_point
;
346 swrast
->Point( ctx
, v0
);
351 * Called via swrast->BlendFunc. Examine GL state to choose a blending
352 * function, then call it.
355 _swrast_validate_blend_func( GLcontext
*ctx
, GLuint n
,
356 const GLubyte mask
[],
358 CONST GLchan dst
[][4] )
360 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
362 _swrast_validate_derived( ctx
);
363 _swrast_choose_blend_func( ctx
);
365 swrast
->BlendFunc( ctx
, n
, mask
, src
, dst
);
370 * Called via the swrast->TextureSample[i] function pointer.
371 * Basically, given a texture object, an array of texture coords
372 * and an array of level-of-detail values, return an array of colors.
373 * In this case, determine the correct texture sampling routine
374 * (depending on filter mode, texture dimensions, etc) then call the
378 _swrast_validate_texture_sample( GLcontext
*ctx
, GLuint texUnit
,
379 const struct gl_texture_object
*tObj
,
380 GLuint n
, const GLfloat texcoords
[][4],
381 const GLfloat lambda
[], GLchan rgba
[][4] )
383 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
385 _swrast_validate_derived( ctx
);
387 /* Compute min/mag filter threshold */
388 if (tObj
&& tObj
->MinFilter
!= tObj
->MagFilter
) {
389 if (tObj
->MagFilter
== GL_LINEAR
390 && (tObj
->MinFilter
== GL_NEAREST_MIPMAP_NEAREST
||
391 tObj
->MinFilter
== GL_NEAREST_MIPMAP_LINEAR
)) {
392 swrast
->_MinMagThresh
[texUnit
] = 0.5F
;
395 swrast
->_MinMagThresh
[texUnit
] = 0.0F
;
399 swrast
->TextureSample
[texUnit
] =
400 _swrast_choose_texture_sample_func( ctx
, tObj
);
402 swrast
->TextureSample
[texUnit
]( ctx
, texUnit
, tObj
, n
, texcoords
,
408 _swrast_sleep( GLcontext
*ctx
, GLuint new_state
)
410 (void) ctx
; (void) new_state
;
415 _swrast_invalidate_state( GLcontext
*ctx
, GLuint new_state
)
417 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
420 swrast
->NewState
|= new_state
;
422 /* After 10 statechanges without any swrast functions being called,
423 * put the module to sleep.
425 if (++swrast
->StateChanges
> 10) {
426 swrast
->InvalidateState
= _swrast_sleep
;
427 swrast
->NewState
= ~0;
431 if (new_state
& swrast
->invalidate_triangle
)
432 swrast
->Triangle
= _swrast_validate_triangle
;
434 if (new_state
& swrast
->invalidate_line
)
435 swrast
->Line
= _swrast_validate_line
;
437 if (new_state
& swrast
->invalidate_point
)
438 swrast
->Point
= _swrast_validate_point
;
440 if (new_state
& _SWRAST_NEW_BLEND_FUNC
)
441 swrast
->BlendFunc
= _swrast_validate_blend_func
;
443 if (new_state
& _SWRAST_NEW_TEXTURE_SAMPLE_FUNC
)
444 for (i
= 0 ; i
< ctx
->Const
.MaxTextureUnits
; i
++)
445 swrast
->TextureSample
[i
] = _swrast_validate_texture_sample
;
450 _swrast_validate_derived( GLcontext
*ctx
)
452 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
454 if (swrast
->NewState
) {
455 if (swrast
->NewState
& _SWRAST_NEW_RASTERMASK
)
456 _swrast_update_rasterflags( ctx
);
458 if (swrast
->NewState
& _NEW_POLYGON
)
459 _swrast_update_polygon( ctx
);
461 if (swrast
->NewState
& (_NEW_HINT
| _NEW_PROGRAM
))
462 _swrast_update_fog_hint( ctx
);
464 if (swrast
->NewState
& _SWRAST_NEW_TEXTURE_ENV_MODE
)
465 _swrast_update_texture_env( ctx
);
467 if (swrast
->NewState
& (_NEW_FOG
| _NEW_PROGRAM
))
468 _swrast_update_fog_state( ctx
);
470 if (swrast
->NewState
& _NEW_PROGRAM
)
471 _swrast_update_fragment_program( ctx
);
473 swrast
->NewState
= 0;
474 swrast
->StateChanges
= 0;
475 swrast
->InvalidateState
= _swrast_invalidate_state
;
479 #define SWRAST_DEBUG 0
481 /* Public entrypoints: See also s_accum.c, s_bitmap.c, etc.
484 _swrast_Quad( GLcontext
*ctx
,
485 const SWvertex
*v0
, const SWvertex
*v1
,
486 const SWvertex
*v2
, const SWvertex
*v3
)
489 _mesa_debug(ctx
, "_swrast_Quad\n");
490 _swrast_print_vertex( ctx
, v0
);
491 _swrast_print_vertex( ctx
, v1
);
492 _swrast_print_vertex( ctx
, v2
);
493 _swrast_print_vertex( ctx
, v3
);
495 SWRAST_CONTEXT(ctx
)->Triangle( ctx
, v0
, v1
, v3
);
496 SWRAST_CONTEXT(ctx
)->Triangle( ctx
, v1
, v2
, v3
);
500 _swrast_Triangle( GLcontext
*ctx
, const SWvertex
*v0
,
501 const SWvertex
*v1
, const SWvertex
*v2
)
504 _mesa_debug(ctx
, "_swrast_Triangle\n");
505 _swrast_print_vertex( ctx
, v0
);
506 _swrast_print_vertex( ctx
, v1
);
507 _swrast_print_vertex( ctx
, v2
);
509 SWRAST_CONTEXT(ctx
)->Triangle( ctx
, v0
, v1
, v2
);
513 _swrast_Line( GLcontext
*ctx
, const SWvertex
*v0
, const SWvertex
*v1
)
516 _mesa_debug(ctx
, "_swrast_Line\n");
517 _swrast_print_vertex( ctx
, v0
);
518 _swrast_print_vertex( ctx
, v1
);
520 SWRAST_CONTEXT(ctx
)->Line( ctx
, v0
, v1
);
524 _swrast_Point( GLcontext
*ctx
, const SWvertex
*v0
)
527 _mesa_debug(ctx
, "_swrast_Point\n");
528 _swrast_print_vertex( ctx
, v0
);
530 SWRAST_CONTEXT(ctx
)->Point( ctx
, v0
);
534 _swrast_InvalidateState( GLcontext
*ctx
, GLuint new_state
)
537 _mesa_debug(ctx
, "_swrast_InvalidateState\n");
539 SWRAST_CONTEXT(ctx
)->InvalidateState( ctx
, new_state
);
543 _swrast_ResetLineStipple( GLcontext
*ctx
)
546 _mesa_debug(ctx
, "_swrast_ResetLineStipple\n");
548 SWRAST_CONTEXT(ctx
)->StippleCounter
= 0;
552 _swrast_allow_vertex_fog( GLcontext
*ctx
, GLboolean value
)
555 _mesa_debug(ctx
, "_swrast_allow_vertex_fog %d\n", value
);
557 SWRAST_CONTEXT(ctx
)->InvalidateState( ctx
, _NEW_HINT
);
558 SWRAST_CONTEXT(ctx
)->AllowVertexFog
= value
;
562 _swrast_allow_pixel_fog( GLcontext
*ctx
, GLboolean value
)
565 _mesa_debug(ctx
, "_swrast_allow_pixel_fog %d\n", value
);
567 SWRAST_CONTEXT(ctx
)->InvalidateState( ctx
, _NEW_HINT
);
568 SWRAST_CONTEXT(ctx
)->AllowPixelFog
= value
;
573 _swrast_CreateContext( GLcontext
*ctx
)
576 SWcontext
*swrast
= (SWcontext
*)CALLOC(sizeof(SWcontext
));
579 _mesa_debug(ctx
, "_swrast_CreateContext\n");
585 swrast
->NewState
= ~0;
587 swrast
->choose_point
= _swrast_choose_point
;
588 swrast
->choose_line
= _swrast_choose_line
;
589 swrast
->choose_triangle
= _swrast_choose_triangle
;
591 swrast
->invalidate_point
= _SWRAST_NEW_POINT
;
592 swrast
->invalidate_line
= _SWRAST_NEW_LINE
;
593 swrast
->invalidate_triangle
= _SWRAST_NEW_TRIANGLE
;
595 swrast
->Point
= _swrast_validate_point
;
596 swrast
->Line
= _swrast_validate_line
;
597 swrast
->Triangle
= _swrast_validate_triangle
;
598 swrast
->InvalidateState
= _swrast_sleep
;
599 swrast
->BlendFunc
= _swrast_validate_blend_func
;
601 swrast
->AllowVertexFog
= GL_TRUE
;
602 swrast
->AllowPixelFog
= GL_TRUE
;
604 if (ctx
->Visual
.doubleBufferMode
)
605 swrast
->CurrentBufferBit
= BUFFER_BIT_BACK_LEFT
;
607 swrast
->CurrentBufferBit
= BUFFER_FRONT_LEFT
;
609 /* Optimized Accum buffer */
610 swrast
->_IntegerAccumMode
= GL_FALSE
;
611 swrast
->_IntegerAccumScaler
= 0.0;
613 for (i
= 0; i
< MAX_TEXTURE_IMAGE_UNITS
; i
++)
614 swrast
->TextureSample
[i
] = _swrast_validate_texture_sample
;
616 swrast
->SpanArrays
= MALLOC_STRUCT(span_arrays
);
617 if (!swrast
->SpanArrays
) {
622 /* init point span buffer */
623 swrast
->PointSpan
.primitive
= GL_POINT
;
624 swrast
->PointSpan
.start
= 0;
625 swrast
->PointSpan
.end
= 0;
626 swrast
->PointSpan
.facing
= 0;
627 swrast
->PointSpan
.array
= swrast
->SpanArrays
;
629 assert(ctx
->Const
.MaxTextureUnits
> 0);
630 assert(ctx
->Const
.MaxTextureUnits
<= MAX_TEXTURE_UNITS
);
632 swrast
->TexelBuffer
= (GLchan
*) MALLOC(ctx
->Const
.MaxTextureUnits
*
633 MAX_WIDTH
* 4 * sizeof(GLchan
));
634 if (!swrast
->TexelBuffer
) {
635 FREE(swrast
->SpanArrays
);
640 ctx
->swrast_context
= swrast
;
646 _swrast_DestroyContext( GLcontext
*ctx
)
648 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
651 _mesa_debug(ctx
, "_swrast_DestroyContext\n");
654 FREE( swrast
->SpanArrays
);
655 FREE( swrast
->TexelBuffer
);
658 ctx
->swrast_context
= 0;
662 struct swrast_device_driver
*
663 _swrast_GetDeviceDriverReference( GLcontext
*ctx
)
665 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
666 return &swrast
->Driver
;
670 _swrast_flush( GLcontext
*ctx
)
672 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
673 /* flush any pending fragments from rendering points */
674 if (swrast
->PointSpan
.end
> 0) {
675 if (ctx
->Visual
.rgbMode
) {
676 _swrast_write_rgba_span(ctx
, &(swrast
->PointSpan
));
679 _swrast_write_index_span(ctx
, &(swrast
->PointSpan
));
681 swrast
->PointSpan
.end
= 0;
686 _swrast_render_primitive( GLcontext
*ctx
, GLenum prim
)
688 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
689 if (swrast
->Primitive
== GL_POINTS
&& prim
!= GL_POINTS
) {
692 swrast
->Primitive
= prim
;
697 _swrast_render_start( GLcontext
*ctx
)
699 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
700 if (swrast
->Driver
.SpanRenderStart
)
701 swrast
->Driver
.SpanRenderStart( ctx
);
702 swrast
->PointSpan
.end
= 0;
706 _swrast_render_finish( GLcontext
*ctx
)
708 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
709 if (swrast
->Driver
.SpanRenderFinish
)
710 swrast
->Driver
.SpanRenderFinish( ctx
);
716 #define SWRAST_DEBUG_VERTICES 0
719 _swrast_print_vertex( GLcontext
*ctx
, const SWvertex
*v
)
723 if (SWRAST_DEBUG_VERTICES
) {
724 _mesa_debug(ctx
, "win %f %f %f %f\n",
725 v
->win
[0], v
->win
[1], v
->win
[2], v
->win
[3]);
727 for (i
= 0 ; i
< ctx
->Const
.MaxTextureUnits
; i
++)
728 if (ctx
->Texture
.Unit
[i
]._ReallyEnabled
)
729 _mesa_debug(ctx
, "texcoord[%d] %f %f %f %f\n", i
,
730 v
->texcoord
[i
][0], v
->texcoord
[i
][1],
731 v
->texcoord
[i
][2], v
->texcoord
[i
][3]);
733 #if CHAN_TYPE == GL_FLOAT
734 _mesa_debug(ctx
, "color %f %f %f %f\n",
735 v
->color
[0], v
->color
[1], v
->color
[2], v
->color
[3]);
736 _mesa_debug(ctx
, "spec %f %f %f %f\n",
737 v
->specular
[0], v
->specular
[1],
738 v
->specular
[2], v
->specular
[3]);
740 _mesa_debug(ctx
, "color %d %d %d %d\n",
741 v
->color
[0], v
->color
[1], v
->color
[2], v
->color
[3]);
742 _mesa_debug(ctx
, "spec %d %d %d %d\n",
743 v
->specular
[0], v
->specular
[1],
744 v
->specular
[2], v
->specular
[3]);
746 _mesa_debug(ctx
, "fog %f\n", v
->fog
);
747 _mesa_debug(ctx
, "index %d\n", v
->index
);
748 _mesa_debug(ctx
, "pointsize %f\n", v
->pointSize
);
749 _mesa_debug(ctx
, "\n");