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.
91 if (ctx
->DrawBuffer
->_NumColorDrawBuffers
[0] != 1) {
92 /* more than one color buffer designated for writing (or zero buffers) */
93 rasterMask
|= MULTI_DRAW_BIT
;
95 else if (ctx
->Visual
.rgbMode
&& *((GLuint
*) ctx
->Color
.ColorMask
) == 0) {
96 rasterMask
|= MULTI_DRAW_BIT
; /* all RGBA channels disabled */
98 else if (!ctx
->Visual
.rgbMode
&& ctx
->Color
.IndexMask
==0) {
99 rasterMask
|= MULTI_DRAW_BIT
; /* all color index bits disabled */
102 if (ctx
->FragmentProgram
._Active
) {
103 rasterMask
|= FRAGPROG_BIT
;
106 if (ctx
->ATIFragmentShader
._Enabled
) {
107 rasterMask
|= ATIFRAGSHADER_BIT
;
110 SWRAST_CONTEXT(ctx
)->_RasterMask
= rasterMask
;
115 * Examine polycon culls tate to compute the _BackfaceSign field.
116 * _BackfaceSign will be 0 if no culling, -1 if culling back-faces,
117 * and 1 if culling front-faces. The Polygon FrontFace state also
121 _swrast_update_polygon( GLcontext
*ctx
)
123 GLfloat backface_sign
= 1;
125 if (ctx
->Polygon
.CullFlag
) {
127 switch(ctx
->Polygon
.CullFaceMode
) {
129 if(ctx
->Polygon
.FrontFace
==GL_CCW
)
133 if(ctx
->Polygon
.FrontFace
!=GL_CCW
)
137 case GL_FRONT_AND_BACK
:
146 SWRAST_CONTEXT(ctx
)->_BackfaceSign
= backface_sign
;
151 * Update the _PreferPixelFog field to indicate if we need to compute
152 * fog factors per-fragment.
155 _swrast_update_fog_hint( GLcontext
*ctx
)
157 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
158 swrast
->_PreferPixelFog
= (!swrast
->AllowVertexFog
||
159 ctx
->FragmentProgram
._Enabled
|| /* not _Active! */
160 (ctx
->Hint
.Fog
== GL_NICEST
&&
161 swrast
->AllowPixelFog
));
167 * Update the swrast->_AnyTextureCombine flag.
170 _swrast_update_texture_env( GLcontext
*ctx
)
172 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
174 swrast
->_AnyTextureCombine
= GL_FALSE
;
175 for (i
= 0; i
< ctx
->Const
.MaxTextureUnits
; i
++) {
176 if (ctx
->Texture
.Unit
[i
].EnvMode
== GL_COMBINE_EXT
||
177 ctx
->Texture
.Unit
[i
].EnvMode
== GL_COMBINE4_NV
) {
178 swrast
->_AnyTextureCombine
= GL_TRUE
;
186 * Update swrast->_FogColor and swrast->_FogEnable values.
189 _swrast_update_fog_state( GLcontext
*ctx
)
191 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
193 /* convert fog color to GLchan values */
194 CLAMPED_FLOAT_TO_CHAN(swrast
->_FogColor
[RCOMP
], ctx
->Fog
.Color
[RCOMP
]);
195 CLAMPED_FLOAT_TO_CHAN(swrast
->_FogColor
[GCOMP
], ctx
->Fog
.Color
[GCOMP
]);
196 CLAMPED_FLOAT_TO_CHAN(swrast
->_FogColor
[BCOMP
], ctx
->Fog
.Color
[BCOMP
]);
198 /* determine if fog is needed, and if so, which fog mode */
199 swrast
->_FogEnabled
= GL_FALSE
;
200 if (ctx
->FragmentProgram
._Active
) {
201 if (ctx
->FragmentProgram
._Current
->Base
.Target
==GL_FRAGMENT_PROGRAM_ARB
) {
202 const struct fragment_program
*p
203 = (struct fragment_program
*) ctx
->FragmentProgram
._Current
;
204 if (p
->FogOption
!= GL_NONE
) {
205 swrast
->_FogEnabled
= GL_TRUE
;
206 swrast
->_FogMode
= p
->FogOption
;
210 else if (ctx
->Fog
.Enabled
) {
211 swrast
->_FogEnabled
= GL_TRUE
;
212 swrast
->_FogMode
= ctx
->Fog
.Mode
;
218 * Update state for running fragment programs. Basically, load the
219 * program parameters with current state values.
222 _swrast_update_fragment_program( GLcontext
*ctx
)
224 if (ctx
->FragmentProgram
._Active
) {
225 struct fragment_program
*program
= ctx
->FragmentProgram
._Current
;
226 _mesa_load_state_parameters(ctx
, program
->Parameters
);
232 #define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \
237 /* State referenced by _swrast_choose_triangle, _swrast_choose_line.
239 #define _SWRAST_NEW_TRIANGLE (_SWRAST_NEW_DERIVED | \
246 _SWRAST_NEW_RASTERMASK| \
249 _DD_NEW_SEPARATE_SPECULAR)
251 #define _SWRAST_NEW_LINE (_SWRAST_NEW_DERIVED | \
258 _DD_NEW_SEPARATE_SPECULAR)
260 #define _SWRAST_NEW_POINT (_SWRAST_NEW_DERIVED | \
266 _DD_NEW_SEPARATE_SPECULAR)
268 #define _SWRAST_NEW_TEXTURE_SAMPLE_FUNC _NEW_TEXTURE
270 #define _SWRAST_NEW_TEXTURE_ENV_MODE _NEW_TEXTURE
272 #define _SWRAST_NEW_BLEND_FUNC _NEW_COLOR
277 * Stub for swrast->Triangle to select a true triangle function
278 * after a state change.
281 _swrast_validate_triangle( GLcontext
*ctx
,
286 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
288 _swrast_validate_derived( ctx
);
289 swrast
->choose_triangle( ctx
);
291 if (ctx
->Texture
._EnabledUnits
== 0
292 && NEED_SECONDARY_COLOR(ctx
)
293 && !ctx
->FragmentProgram
._Active
) {
294 /* separate specular color, but no texture */
295 swrast
->SpecTriangle
= swrast
->Triangle
;
296 swrast
->Triangle
= _swrast_add_spec_terms_triangle
;
299 swrast
->Triangle( ctx
, v0
, v1
, v2
);
303 * Called via swrast->Line. Examine current GL state and choose a software
304 * line routine. Then call it.
307 _swrast_validate_line( GLcontext
*ctx
, const SWvertex
*v0
, const SWvertex
*v1
)
309 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
311 _swrast_validate_derived( ctx
);
312 swrast
->choose_line( ctx
);
314 if (ctx
->Texture
._EnabledUnits
== 0
315 && NEED_SECONDARY_COLOR(ctx
)
316 && !ctx
->FragmentProgram
._Active
) {
317 swrast
->SpecLine
= swrast
->Line
;
318 swrast
->Line
= _swrast_add_spec_terms_line
;
322 swrast
->Line( ctx
, v0
, v1
);
326 * Called via swrast->Point. Examine current GL state and choose a software
327 * point routine. Then call it.
330 _swrast_validate_point( GLcontext
*ctx
, const SWvertex
*v0
)
332 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
334 _swrast_validate_derived( ctx
);
335 swrast
->choose_point( ctx
);
337 if (ctx
->Texture
._EnabledUnits
== 0
338 && NEED_SECONDARY_COLOR(ctx
)
339 && !ctx
->FragmentProgram
._Active
) {
340 swrast
->SpecPoint
= swrast
->Point
;
341 swrast
->Point
= _swrast_add_spec_terms_point
;
344 swrast
->Point( ctx
, v0
);
349 * Called via swrast->BlendFunc. Examine GL state to choose a blending
350 * function, then call it.
353 _swrast_validate_blend_func( GLcontext
*ctx
, GLuint n
,
354 const GLubyte mask
[],
356 CONST GLchan dst
[][4] )
358 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
360 _swrast_validate_derived( ctx
);
361 _swrast_choose_blend_func( ctx
);
363 swrast
->BlendFunc( ctx
, n
, mask
, src
, dst
);
368 * Called via the swrast->TextureSample[i] function pointer.
369 * Basically, given a texture object, an array of texture coords
370 * and an array of level-of-detail values, return an array of colors.
371 * In this case, determine the correct texture sampling routine
372 * (depending on filter mode, texture dimensions, etc) then call the
376 _swrast_validate_texture_sample( GLcontext
*ctx
, GLuint texUnit
,
377 const struct gl_texture_object
*tObj
,
378 GLuint n
, const GLfloat texcoords
[][4],
379 const GLfloat lambda
[], GLchan rgba
[][4] )
381 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
383 _swrast_validate_derived( ctx
);
385 /* Compute min/mag filter threshold */
386 if (tObj
&& tObj
->MinFilter
!= tObj
->MagFilter
) {
387 if (tObj
->MagFilter
== GL_LINEAR
388 && (tObj
->MinFilter
== GL_NEAREST_MIPMAP_NEAREST
||
389 tObj
->MinFilter
== GL_NEAREST_MIPMAP_LINEAR
)) {
390 swrast
->_MinMagThresh
[texUnit
] = 0.5F
;
393 swrast
->_MinMagThresh
[texUnit
] = 0.0F
;
397 swrast
->TextureSample
[texUnit
] =
398 _swrast_choose_texture_sample_func( ctx
, tObj
);
400 swrast
->TextureSample
[texUnit
]( ctx
, texUnit
, tObj
, n
, texcoords
,
406 _swrast_sleep( GLcontext
*ctx
, GLuint new_state
)
408 (void) ctx
; (void) new_state
;
413 _swrast_invalidate_state( GLcontext
*ctx
, GLuint new_state
)
415 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
418 swrast
->NewState
|= new_state
;
420 /* After 10 statechanges without any swrast functions being called,
421 * put the module to sleep.
423 if (++swrast
->StateChanges
> 10) {
424 swrast
->InvalidateState
= _swrast_sleep
;
425 swrast
->NewState
= ~0;
429 if (new_state
& swrast
->invalidate_triangle
)
430 swrast
->Triangle
= _swrast_validate_triangle
;
432 if (new_state
& swrast
->invalidate_line
)
433 swrast
->Line
= _swrast_validate_line
;
435 if (new_state
& swrast
->invalidate_point
)
436 swrast
->Point
= _swrast_validate_point
;
438 if (new_state
& _SWRAST_NEW_BLEND_FUNC
)
439 swrast
->BlendFunc
= _swrast_validate_blend_func
;
441 if (new_state
& _SWRAST_NEW_TEXTURE_SAMPLE_FUNC
)
442 for (i
= 0 ; i
< ctx
->Const
.MaxTextureUnits
; i
++)
443 swrast
->TextureSample
[i
] = _swrast_validate_texture_sample
;
448 _swrast_validate_derived( GLcontext
*ctx
)
450 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
452 if (swrast
->NewState
) {
453 if (swrast
->NewState
& _SWRAST_NEW_RASTERMASK
)
454 _swrast_update_rasterflags( ctx
);
456 if (swrast
->NewState
& _NEW_POLYGON
)
457 _swrast_update_polygon( ctx
);
459 if (swrast
->NewState
& (_NEW_HINT
| _NEW_PROGRAM
))
460 _swrast_update_fog_hint( ctx
);
462 if (swrast
->NewState
& _SWRAST_NEW_TEXTURE_ENV_MODE
)
463 _swrast_update_texture_env( ctx
);
465 if (swrast
->NewState
& (_NEW_FOG
| _NEW_PROGRAM
))
466 _swrast_update_fog_state( ctx
);
468 if (swrast
->NewState
& _NEW_PROGRAM
)
469 _swrast_update_fragment_program( ctx
);
471 swrast
->NewState
= 0;
472 swrast
->StateChanges
= 0;
473 swrast
->InvalidateState
= _swrast_invalidate_state
;
477 #define SWRAST_DEBUG 0
479 /* Public entrypoints: See also s_accum.c, s_bitmap.c, etc.
482 _swrast_Quad( GLcontext
*ctx
,
483 const SWvertex
*v0
, const SWvertex
*v1
,
484 const SWvertex
*v2
, const SWvertex
*v3
)
487 _mesa_debug(ctx
, "_swrast_Quad\n");
488 _swrast_print_vertex( ctx
, v0
);
489 _swrast_print_vertex( ctx
, v1
);
490 _swrast_print_vertex( ctx
, v2
);
491 _swrast_print_vertex( ctx
, v3
);
493 SWRAST_CONTEXT(ctx
)->Triangle( ctx
, v0
, v1
, v3
);
494 SWRAST_CONTEXT(ctx
)->Triangle( ctx
, v1
, v2
, v3
);
498 _swrast_Triangle( GLcontext
*ctx
, const SWvertex
*v0
,
499 const SWvertex
*v1
, const SWvertex
*v2
)
502 _mesa_debug(ctx
, "_swrast_Triangle\n");
503 _swrast_print_vertex( ctx
, v0
);
504 _swrast_print_vertex( ctx
, v1
);
505 _swrast_print_vertex( ctx
, v2
);
507 SWRAST_CONTEXT(ctx
)->Triangle( ctx
, v0
, v1
, v2
);
511 _swrast_Line( GLcontext
*ctx
, const SWvertex
*v0
, const SWvertex
*v1
)
514 _mesa_debug(ctx
, "_swrast_Line\n");
515 _swrast_print_vertex( ctx
, v0
);
516 _swrast_print_vertex( ctx
, v1
);
518 SWRAST_CONTEXT(ctx
)->Line( ctx
, v0
, v1
);
522 _swrast_Point( GLcontext
*ctx
, const SWvertex
*v0
)
525 _mesa_debug(ctx
, "_swrast_Point\n");
526 _swrast_print_vertex( ctx
, v0
);
528 SWRAST_CONTEXT(ctx
)->Point( ctx
, v0
);
532 _swrast_InvalidateState( GLcontext
*ctx
, GLuint new_state
)
535 _mesa_debug(ctx
, "_swrast_InvalidateState\n");
537 SWRAST_CONTEXT(ctx
)->InvalidateState( ctx
, new_state
);
541 _swrast_ResetLineStipple( GLcontext
*ctx
)
544 _mesa_debug(ctx
, "_swrast_ResetLineStipple\n");
546 SWRAST_CONTEXT(ctx
)->StippleCounter
= 0;
550 _swrast_allow_vertex_fog( GLcontext
*ctx
, GLboolean value
)
553 _mesa_debug(ctx
, "_swrast_allow_vertex_fog %d\n", value
);
555 SWRAST_CONTEXT(ctx
)->InvalidateState( ctx
, _NEW_HINT
);
556 SWRAST_CONTEXT(ctx
)->AllowVertexFog
= value
;
560 _swrast_allow_pixel_fog( GLcontext
*ctx
, GLboolean value
)
563 _mesa_debug(ctx
, "_swrast_allow_pixel_fog %d\n", value
);
565 SWRAST_CONTEXT(ctx
)->InvalidateState( ctx
, _NEW_HINT
);
566 SWRAST_CONTEXT(ctx
)->AllowPixelFog
= value
;
571 _swrast_CreateContext( GLcontext
*ctx
)
574 SWcontext
*swrast
= (SWcontext
*)CALLOC(sizeof(SWcontext
));
577 _mesa_debug(ctx
, "_swrast_CreateContext\n");
583 swrast
->NewState
= ~0;
585 swrast
->choose_point
= _swrast_choose_point
;
586 swrast
->choose_line
= _swrast_choose_line
;
587 swrast
->choose_triangle
= _swrast_choose_triangle
;
589 swrast
->invalidate_point
= _SWRAST_NEW_POINT
;
590 swrast
->invalidate_line
= _SWRAST_NEW_LINE
;
591 swrast
->invalidate_triangle
= _SWRAST_NEW_TRIANGLE
;
593 swrast
->Point
= _swrast_validate_point
;
594 swrast
->Line
= _swrast_validate_line
;
595 swrast
->Triangle
= _swrast_validate_triangle
;
596 swrast
->InvalidateState
= _swrast_sleep
;
597 swrast
->BlendFunc
= _swrast_validate_blend_func
;
599 swrast
->AllowVertexFog
= GL_TRUE
;
600 swrast
->AllowPixelFog
= GL_TRUE
;
602 if (ctx
->Visual
.doubleBufferMode
)
603 swrast
->CurrentBufferBit
= BUFFER_BIT_BACK_LEFT
;
605 swrast
->CurrentBufferBit
= BUFFER_FRONT_LEFT
;
607 /* Optimized Accum buffer */
608 swrast
->_IntegerAccumMode
= GL_FALSE
;
609 swrast
->_IntegerAccumScaler
= 0.0;
611 for (i
= 0; i
< MAX_TEXTURE_IMAGE_UNITS
; i
++)
612 swrast
->TextureSample
[i
] = _swrast_validate_texture_sample
;
614 swrast
->SpanArrays
= MALLOC_STRUCT(span_arrays
);
615 if (!swrast
->SpanArrays
) {
620 /* init point span buffer */
621 swrast
->PointSpan
.primitive
= GL_POINT
;
622 swrast
->PointSpan
.start
= 0;
623 swrast
->PointSpan
.end
= 0;
624 swrast
->PointSpan
.facing
= 0;
625 swrast
->PointSpan
.array
= swrast
->SpanArrays
;
627 assert(ctx
->Const
.MaxTextureUnits
> 0);
628 assert(ctx
->Const
.MaxTextureUnits
<= MAX_TEXTURE_UNITS
);
630 swrast
->TexelBuffer
= (GLchan
*) MALLOC(ctx
->Const
.MaxTextureUnits
*
631 MAX_WIDTH
* 4 * sizeof(GLchan
));
632 if (!swrast
->TexelBuffer
) {
633 FREE(swrast
->SpanArrays
);
638 ctx
->swrast_context
= swrast
;
644 _swrast_DestroyContext( GLcontext
*ctx
)
646 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
649 _mesa_debug(ctx
, "_swrast_DestroyContext\n");
652 FREE( swrast
->SpanArrays
);
653 FREE( swrast
->TexelBuffer
);
656 ctx
->swrast_context
= 0;
660 struct swrast_device_driver
*
661 _swrast_GetDeviceDriverReference( GLcontext
*ctx
)
663 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
664 return &swrast
->Driver
;
668 _swrast_flush( GLcontext
*ctx
)
670 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
671 /* flush any pending fragments from rendering points */
672 if (swrast
->PointSpan
.end
> 0) {
673 if (ctx
->Visual
.rgbMode
) {
674 _swrast_write_rgba_span(ctx
, &(swrast
->PointSpan
));
677 _swrast_write_index_span(ctx
, &(swrast
->PointSpan
));
679 swrast
->PointSpan
.end
= 0;
684 _swrast_render_primitive( GLcontext
*ctx
, GLenum prim
)
686 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
687 if (swrast
->Primitive
== GL_POINTS
&& prim
!= GL_POINTS
) {
690 swrast
->Primitive
= prim
;
695 _swrast_render_start( GLcontext
*ctx
)
697 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
698 if (swrast
->Driver
.SpanRenderStart
)
699 swrast
->Driver
.SpanRenderStart( ctx
);
700 swrast
->PointSpan
.end
= 0;
704 _swrast_render_finish( GLcontext
*ctx
)
706 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
707 if (swrast
->Driver
.SpanRenderFinish
)
708 swrast
->Driver
.SpanRenderFinish( ctx
);
714 #define SWRAST_DEBUG_VERTICES 0
717 _swrast_print_vertex( GLcontext
*ctx
, const SWvertex
*v
)
721 if (SWRAST_DEBUG_VERTICES
) {
722 _mesa_debug(ctx
, "win %f %f %f %f\n",
723 v
->win
[0], v
->win
[1], v
->win
[2], v
->win
[3]);
725 for (i
= 0 ; i
< ctx
->Const
.MaxTextureUnits
; i
++)
726 if (ctx
->Texture
.Unit
[i
]._ReallyEnabled
)
727 _mesa_debug(ctx
, "texcoord[%d] %f %f %f %f\n", i
,
728 v
->texcoord
[i
][0], v
->texcoord
[i
][1],
729 v
->texcoord
[i
][2], v
->texcoord
[i
][3]);
731 #if CHAN_TYPE == GL_FLOAT
732 _mesa_debug(ctx
, "color %f %f %f %f\n",
733 v
->color
[0], v
->color
[1], v
->color
[2], v
->color
[3]);
734 _mesa_debug(ctx
, "spec %f %f %f %f\n",
735 v
->specular
[0], v
->specular
[1],
736 v
->specular
[2], v
->specular
[3]);
738 _mesa_debug(ctx
, "color %d %d %d %d\n",
739 v
->color
[0], v
->color
[1], v
->color
[2], v
->color
[3]);
740 _mesa_debug(ctx
, "spec %d %d %d %d\n",
741 v
->specular
[0], v
->specular
[1],
742 v
->specular
[2], v
->specular
[3]);
744 _mesa_debug(ctx
, "fog %f\n", v
->fog
);
745 _mesa_debug(ctx
, "index %d\n", v
->index
);
746 _mesa_debug(ctx
, "pointsize %f\n", v
->pointSize
);
747 _mesa_debug(ctx
, "\n");