2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2008 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.
30 * This file manages recalculation of derived values in GLcontext.
39 #include "ffvertex_prog.h"
40 #include "framebuffer.h"
43 #if FEATURE_pixel_transfer
46 #include "shader/program.h"
47 #include "shader/prog_parameter.h"
50 #include "texenvprogram.h"
57 update_separate_specular(GLcontext
*ctx
)
59 if (NEED_SECONDARY_COLOR(ctx
))
60 ctx
->_TriangleCaps
|= DD_SEPARATE_SPECULAR
;
62 ctx
->_TriangleCaps
&= ~DD_SEPARATE_SPECULAR
;
67 * Update state dependent on vertex arrays.
70 update_arrays( GLcontext
*ctx
)
72 const struct gl_array_object
*arrayObj
= ctx
->Array
.ArrayObj
;
75 /* find min of _MaxElement values for all enabled arrays */
78 if (ctx
->VertexProgram
._Current
79 && arrayObj
->VertexAttrib
[VERT_ATTRIB_POS
].Enabled
) {
80 min
= arrayObj
->VertexAttrib
[VERT_ATTRIB_POS
]._MaxElement
;
82 else if (arrayObj
->Vertex
.Enabled
) {
83 min
= arrayObj
->Vertex
._MaxElement
;
86 /* can't draw anything without vertex positions! */
91 if (ctx
->VertexProgram
._Enabled
92 && arrayObj
->VertexAttrib
[VERT_ATTRIB_WEIGHT
].Enabled
) {
93 min
= MIN2(min
, arrayObj
->VertexAttrib
[VERT_ATTRIB_WEIGHT
]._MaxElement
);
95 /* no conventional vertex weight array */
98 if (ctx
->VertexProgram
._Enabled
99 && arrayObj
->VertexAttrib
[VERT_ATTRIB_NORMAL
].Enabled
) {
100 min
= MIN2(min
, arrayObj
->VertexAttrib
[VERT_ATTRIB_NORMAL
]._MaxElement
);
102 else if (arrayObj
->Normal
.Enabled
) {
103 min
= MIN2(min
, arrayObj
->Normal
._MaxElement
);
107 if (ctx
->VertexProgram
._Enabled
108 && arrayObj
->VertexAttrib
[VERT_ATTRIB_COLOR0
].Enabled
) {
109 min
= MIN2(min
, arrayObj
->VertexAttrib
[VERT_ATTRIB_COLOR0
]._MaxElement
);
111 else if (arrayObj
->Color
.Enabled
) {
112 min
= MIN2(min
, arrayObj
->Color
._MaxElement
);
116 if (ctx
->VertexProgram
._Enabled
117 && arrayObj
->VertexAttrib
[VERT_ATTRIB_COLOR1
].Enabled
) {
118 min
= MIN2(min
, arrayObj
->VertexAttrib
[VERT_ATTRIB_COLOR1
]._MaxElement
);
120 else if (arrayObj
->SecondaryColor
.Enabled
) {
121 min
= MIN2(min
, arrayObj
->SecondaryColor
._MaxElement
);
125 if (ctx
->VertexProgram
._Enabled
126 && arrayObj
->VertexAttrib
[VERT_ATTRIB_FOG
].Enabled
) {
127 min
= MIN2(min
, arrayObj
->VertexAttrib
[VERT_ATTRIB_FOG
]._MaxElement
);
129 else if (arrayObj
->FogCoord
.Enabled
) {
130 min
= MIN2(min
, arrayObj
->FogCoord
._MaxElement
);
134 if (ctx
->VertexProgram
._Enabled
135 && arrayObj
->VertexAttrib
[VERT_ATTRIB_COLOR_INDEX
].Enabled
) {
136 min
= MIN2(min
, arrayObj
->VertexAttrib
[VERT_ATTRIB_COLOR_INDEX
]._MaxElement
);
138 else if (arrayObj
->Index
.Enabled
) {
139 min
= MIN2(min
, arrayObj
->Index
._MaxElement
);
144 if (ctx
->VertexProgram
._Enabled
145 && arrayObj
->VertexAttrib
[VERT_ATTRIB_EDGEFLAG
].Enabled
) {
146 min
= MIN2(min
, arrayObj
->VertexAttrib
[VERT_ATTRIB_EDGEFLAG
]._MaxElement
);
150 for (i
= VERT_ATTRIB_TEX0
; i
<= VERT_ATTRIB_TEX7
; i
++) {
151 if (ctx
->VertexProgram
._Enabled
152 && arrayObj
->VertexAttrib
[i
].Enabled
) {
153 min
= MIN2(min
, arrayObj
->VertexAttrib
[i
]._MaxElement
);
155 else if (i
- VERT_ATTRIB_TEX0
< ctx
->Const
.MaxTextureCoordUnits
156 && arrayObj
->TexCoord
[i
- VERT_ATTRIB_TEX0
].Enabled
) {
157 min
= MIN2(min
, arrayObj
->TexCoord
[i
- VERT_ATTRIB_TEX0
]._MaxElement
);
162 if (ctx
->VertexProgram
._Current
) {
163 for (i
= VERT_ATTRIB_GENERIC0
; i
< VERT_ATTRIB_MAX
; i
++) {
164 if (arrayObj
->VertexAttrib
[i
].Enabled
) {
165 min
= MIN2(min
, arrayObj
->VertexAttrib
[i
]._MaxElement
);
170 if (arrayObj
->EdgeFlag
.Enabled
) {
171 min
= MIN2(min
, arrayObj
->EdgeFlag
._MaxElement
);
174 /* _MaxElement is one past the last legal array element */
175 ctx
->Array
._MaxElement
= min
;
180 * Update the following fields:
181 * ctx->VertexProgram._Enabled
182 * ctx->FragmentProgram._Enabled
183 * ctx->ATIFragmentShader._Enabled
184 * This needs to be done before texture state validation.
187 update_program_enables(GLcontext
*ctx
)
189 /* These _Enabled flags indicate if the program is enabled AND valid. */
190 ctx
->VertexProgram
._Enabled
= ctx
->VertexProgram
.Enabled
191 && ctx
->VertexProgram
.Current
->Base
.Instructions
;
192 ctx
->FragmentProgram
._Enabled
= ctx
->FragmentProgram
.Enabled
193 && ctx
->FragmentProgram
.Current
->Base
.Instructions
;
194 ctx
->ATIFragmentShader
._Enabled
= ctx
->ATIFragmentShader
.Enabled
195 && ctx
->ATIFragmentShader
.Current
->Instructions
[0];
200 * Update vertex/fragment program state. In particular, update these fields:
201 * ctx->VertexProgram._Current
202 * ctx->VertexProgram._TnlProgram,
203 * These point to the highest priority enabled vertex/fragment program or are
204 * NULL if fixed-function processing is to be done.
206 * This function needs to be called after texture state validation in case
207 * we're generating a fragment program from fixed-function texture state.
209 * \return bitfield which will indicate _NEW_PROGRAM state if a new vertex
210 * or fragment program is being used.
213 update_program(GLcontext
*ctx
)
215 const struct gl_shader_program
*shProg
= ctx
->Shader
.CurrentProgram
;
216 const struct gl_vertex_program
*prevVP
= ctx
->VertexProgram
._Current
;
217 const struct gl_fragment_program
*prevFP
= ctx
->FragmentProgram
._Current
;
218 GLbitfield new_state
= 0x0;
221 * Set the ctx->VertexProgram._Current and ctx->FragmentProgram._Current
222 * pointers to the programs that should be used for rendering. If either
223 * is NULL, use fixed-function code paths.
225 * These programs may come from several sources. The priority is as
227 * 1. OpenGL 2.0/ARB vertex/fragment shaders
228 * 2. ARB/NV vertex/fragment programs
229 * 3. Programs derived from fixed-function state.
231 * Note: it's possible for a vertex shader to get used with a fragment
232 * program (and vice versa) here, but in practice that shouldn't ever
233 * come up, or matter.
236 if (shProg
&& shProg
->LinkStatus
&& shProg
->FragmentProgram
) {
237 /* Use shader programs */
238 _mesa_reference_fragprog(ctx
, &ctx
->FragmentProgram
._Current
,
239 shProg
->FragmentProgram
);
241 else if (ctx
->FragmentProgram
._Enabled
) {
242 /* use user-defined vertex program */
243 _mesa_reference_fragprog(ctx
, &ctx
->FragmentProgram
._Current
,
244 ctx
->FragmentProgram
.Current
);
246 else if (ctx
->FragmentProgram
._MaintainTexEnvProgram
) {
247 /* Use fragment program generated from fixed-function state.
249 _mesa_reference_fragprog(ctx
, &ctx
->FragmentProgram
._Current
,
250 _mesa_get_fixed_func_fragment_program(ctx
));
251 _mesa_reference_fragprog(ctx
, &ctx
->FragmentProgram
._TexEnvProgram
,
252 ctx
->FragmentProgram
._Current
);
255 /* no fragment program */
256 _mesa_reference_fragprog(ctx
, &ctx
->FragmentProgram
._Current
, NULL
);
259 /* Examine vertex program after fragment program as
260 * _mesa_get_fixed_func_vertex_program() needs to know active
263 if (shProg
&& shProg
->LinkStatus
&& shProg
->VertexProgram
) {
264 /* Use shader programs */
265 _mesa_reference_vertprog(ctx
, &ctx
->VertexProgram
._Current
,
266 shProg
->VertexProgram
);
268 else if (ctx
->VertexProgram
._Enabled
) {
269 /* use user-defined vertex program */
270 _mesa_reference_vertprog(ctx
, &ctx
->VertexProgram
._Current
,
271 ctx
->VertexProgram
.Current
);
273 else if (ctx
->VertexProgram
._MaintainTnlProgram
) {
274 /* Use vertex program generated from fixed-function state.
276 _mesa_reference_vertprog(ctx
, &ctx
->VertexProgram
._Current
,
277 _mesa_get_fixed_func_vertex_program(ctx
));
278 _mesa_reference_vertprog(ctx
, &ctx
->VertexProgram
._TnlProgram
,
279 ctx
->VertexProgram
._Current
);
282 /* no vertex program */
283 _mesa_reference_vertprog(ctx
, &ctx
->VertexProgram
._Current
, NULL
);
286 /* Let the driver know what's happening:
288 if (ctx
->FragmentProgram
._Current
!= prevFP
) {
289 new_state
|= _NEW_PROGRAM
;
290 if (ctx
->Driver
.BindProgram
) {
291 ctx
->Driver
.BindProgram(ctx
, GL_FRAGMENT_PROGRAM_ARB
,
292 (struct gl_program
*) ctx
->FragmentProgram
._Current
);
296 if (ctx
->VertexProgram
._Current
!= prevVP
) {
297 new_state
|= _NEW_PROGRAM
;
298 if (ctx
->Driver
.BindProgram
) {
299 ctx
->Driver
.BindProgram(ctx
, GL_VERTEX_PROGRAM_ARB
,
300 (struct gl_program
*) ctx
->VertexProgram
._Current
);
309 * Examine shader constants and return either _NEW_PROGRAM_CONSTANTS or 0.
312 update_program_constants(GLcontext
*ctx
)
314 GLbitfield new_state
= 0x0;
316 if (ctx
->FragmentProgram
._Current
) {
317 const struct gl_program_parameter_list
*params
=
318 ctx
->FragmentProgram
._Current
->Base
.Parameters
;
319 if (params
&& params
->StateFlags
& ctx
->NewState
) {
320 new_state
|= _NEW_PROGRAM_CONSTANTS
;
324 if (ctx
->VertexProgram
._Current
) {
325 const struct gl_program_parameter_list
*params
=
326 ctx
->VertexProgram
._Current
->Base
.Parameters
;
327 if (params
&& params
->StateFlags
& ctx
->NewState
) {
328 new_state
|= _NEW_PROGRAM_CONSTANTS
;
339 update_viewport_matrix(GLcontext
*ctx
)
341 const GLfloat depthMax
= ctx
->DrawBuffer
->_DepthMaxF
;
343 ASSERT(depthMax
> 0);
345 /* Compute scale and bias values. This is really driver-specific
346 * and should be maintained elsewhere if at all.
347 * NOTE: RasterPos uses this.
349 _math_matrix_viewport(&ctx
->Viewport
._WindowMap
,
350 ctx
->Viewport
.X
, ctx
->Viewport
.Y
,
351 ctx
->Viewport
.Width
, ctx
->Viewport
.Height
,
352 ctx
->Viewport
.Near
, ctx
->Viewport
.Far
,
358 * Update derived multisample state.
361 update_multisample(GLcontext
*ctx
)
363 ctx
->Multisample
._Enabled
= GL_FALSE
;
364 if (ctx
->Multisample
.Enabled
&&
366 ctx
->DrawBuffer
->Visual
.sampleBuffers
)
367 ctx
->Multisample
._Enabled
= GL_TRUE
;
372 * Update derived color/blend/logicop state.
375 update_color(GLcontext
*ctx
)
377 /* This is needed to support 1.1's RGB logic ops AND
378 * 1.0's blending logicops.
380 ctx
->Color
._LogicOpEnabled
= RGBA_LOGICOP_ENABLED(ctx
);
385 * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET
386 * in ctx->_TriangleCaps if needed.
389 update_polygon(GLcontext
*ctx
)
391 ctx
->_TriangleCaps
&= ~(DD_TRI_CULL_FRONT_BACK
| DD_TRI_OFFSET
);
393 if (ctx
->Polygon
.CullFlag
&& ctx
->Polygon
.CullFaceMode
== GL_FRONT_AND_BACK
)
394 ctx
->_TriangleCaps
|= DD_TRI_CULL_FRONT_BACK
;
396 if ( ctx
->Polygon
.OffsetPoint
397 || ctx
->Polygon
.OffsetLine
398 || ctx
->Polygon
.OffsetFill
)
399 ctx
->_TriangleCaps
|= DD_TRI_OFFSET
;
404 * Update the ctx->_TriangleCaps bitfield.
405 * XXX that bitfield should really go away someday!
406 * This function must be called after other update_*() functions since
407 * there are dependencies on some other derived values.
411 update_tricaps(GLcontext
*ctx
, GLbitfield new_state
)
413 ctx
->_TriangleCaps
= 0;
418 if (1/*new_state & _NEW_POINT*/) {
419 if (ctx
->Point
.SmoothFlag
)
420 ctx
->_TriangleCaps
|= DD_POINT_SMOOTH
;
421 if (ctx
->Point
.Size
!= 1.0F
)
422 ctx
->_TriangleCaps
|= DD_POINT_SIZE
;
423 if (ctx
->Point
._Attenuated
)
424 ctx
->_TriangleCaps
|= DD_POINT_ATTEN
;
430 if (1/*new_state & _NEW_LINE*/) {
431 if (ctx
->Line
.SmoothFlag
)
432 ctx
->_TriangleCaps
|= DD_LINE_SMOOTH
;
433 if (ctx
->Line
.StippleFlag
)
434 ctx
->_TriangleCaps
|= DD_LINE_STIPPLE
;
435 if (ctx
->Line
.Width
!= 1.0)
436 ctx
->_TriangleCaps
|= DD_LINE_WIDTH
;
442 if (1/*new_state & _NEW_POLYGON*/) {
443 if (ctx
->Polygon
.SmoothFlag
)
444 ctx
->_TriangleCaps
|= DD_TRI_SMOOTH
;
445 if (ctx
->Polygon
.StippleFlag
)
446 ctx
->_TriangleCaps
|= DD_TRI_STIPPLE
;
447 if (ctx
->Polygon
.FrontMode
!= GL_FILL
448 || ctx
->Polygon
.BackMode
!= GL_FILL
)
449 ctx
->_TriangleCaps
|= DD_TRI_UNFILLED
;
450 if (ctx
->Polygon
.CullFlag
451 && ctx
->Polygon
.CullFaceMode
== GL_FRONT_AND_BACK
)
452 ctx
->_TriangleCaps
|= DD_TRI_CULL_FRONT_BACK
;
453 if (ctx
->Polygon
.OffsetPoint
||
454 ctx
->Polygon
.OffsetLine
||
455 ctx
->Polygon
.OffsetFill
)
456 ctx
->_TriangleCaps
|= DD_TRI_OFFSET
;
460 * Lighting and shading
462 if (ctx
->Light
.Enabled
&& ctx
->Light
.Model
.TwoSide
)
463 ctx
->_TriangleCaps
|= DD_TRI_LIGHT_TWOSIDE
;
464 if (ctx
->Light
.ShadeModel
== GL_FLAT
)
465 ctx
->_TriangleCaps
|= DD_FLATSHADE
;
466 if (NEED_SECONDARY_COLOR(ctx
))
467 ctx
->_TriangleCaps
|= DD_SEPARATE_SPECULAR
;
472 if (ctx
->Stencil
._TestTwoSide
)
473 ctx
->_TriangleCaps
|= DD_TRI_TWOSTENCIL
;
479 * Compute derived GL state.
480 * If __GLcontextRec::NewState is non-zero then this function \b must
481 * be called before rendering anything.
483 * Calls dd_function_table::UpdateState to perform any internal state
484 * management necessary.
486 * \sa _mesa_update_modelview_project(), _mesa_update_texture(),
487 * _mesa_update_buffer_bounds(),
488 * _mesa_update_lighting() and _mesa_update_tnl_spaces().
491 _mesa_update_state_locked( GLcontext
*ctx
)
493 GLbitfield new_state
= ctx
->NewState
;
494 GLbitfield prog_flags
= _NEW_PROGRAM
;
495 GLbitfield new_prog_state
= 0x0;
497 if (new_state
== _NEW_CURRENT_ATTRIB
)
500 if (MESA_VERBOSE
& VERBOSE_STATE
)
501 _mesa_print_state("_mesa_update_state", new_state
);
503 /* Determine which state flags effect vertex/fragment program state */
504 if (ctx
->FragmentProgram
._MaintainTexEnvProgram
) {
505 prog_flags
|= (_NEW_TEXTURE
| _NEW_FOG
| _DD_NEW_SEPARATE_SPECULAR
|
508 if (ctx
->VertexProgram
._MaintainTnlProgram
) {
509 prog_flags
|= (_NEW_ARRAY
| _NEW_TEXTURE
| _NEW_TEXTURE_MATRIX
|
510 _NEW_TRANSFORM
| _NEW_POINT
|
511 _NEW_FOG
| _NEW_LIGHT
|
512 _MESA_NEW_NEED_EYE_COORDS
);
516 * Now update derived state info
519 if (new_state
& prog_flags
)
520 update_program_enables( ctx
);
522 if (new_state
& (_NEW_MODELVIEW
|_NEW_PROJECTION
))
523 _mesa_update_modelview_project( ctx
, new_state
);
525 if (new_state
& (_NEW_PROGRAM
|_NEW_TEXTURE
|_NEW_TEXTURE_MATRIX
))
526 _mesa_update_texture( ctx
, new_state
);
528 if (new_state
& _NEW_BUFFERS
)
529 _mesa_update_framebuffer(ctx
);
531 if (new_state
& (_NEW_SCISSOR
| _NEW_BUFFERS
| _NEW_VIEWPORT
))
532 _mesa_update_draw_buffer_bounds( ctx
);
534 if (new_state
& _NEW_POLYGON
)
535 update_polygon( ctx
);
537 if (new_state
& _NEW_LIGHT
)
538 _mesa_update_lighting( ctx
);
540 if (new_state
& (_NEW_STENCIL
| _NEW_BUFFERS
))
541 _mesa_update_stencil( ctx
);
543 #if FEATURE_pixel_transfer
544 if (new_state
& _MESA_NEW_TRANSFER_STATE
)
545 _mesa_update_pixel( ctx
, new_state
);
548 if (new_state
& _DD_NEW_SEPARATE_SPECULAR
)
549 update_separate_specular( ctx
);
551 if (new_state
& (_NEW_ARRAY
| _NEW_PROGRAM
))
552 update_arrays( ctx
);
554 if (new_state
& (_NEW_BUFFERS
| _NEW_VIEWPORT
))
555 update_viewport_matrix(ctx
);
557 if (new_state
& _NEW_MULTISAMPLE
)
558 update_multisample( ctx
);
560 if (new_state
& _NEW_COLOR
)
564 if (new_state
& (_NEW_POINT
| _NEW_LINE
| _NEW_POLYGON
| _NEW_LIGHT
565 | _NEW_STENCIL
| _DD_NEW_SEPARATE_SPECULAR
))
566 update_tricaps( ctx
, new_state
);
569 /* ctx->_NeedEyeCoords is now up to date.
571 * If the truth value of this variable has changed, update for the
572 * new lighting space and recompute the positions of lights and the
575 * If the lighting space hasn't changed, may still need to recompute
576 * light positions & normal transforms for other reasons.
578 if (new_state
& _MESA_NEW_NEED_EYE_COORDS
)
579 _mesa_update_tnl_spaces( ctx
, new_state
);
581 if (new_state
& prog_flags
) {
582 /* When we generate programs from fixed-function vertex/fragment state
583 * this call may generate/bind a new program. If so, we need to
584 * propogate the _NEW_PROGRAM flag to the driver.
586 new_prog_state
|= update_program( ctx
);
591 new_prog_state
|= update_program_constants(ctx
);
594 * Give the driver a chance to act upon the new_state flags.
595 * The driver might plug in different span functions, for example.
596 * Also, this is where the driver can invalidate the state of any
597 * active modules (such as swrast_setup, swrast, tnl, etc).
599 * Set ctx->NewState to zero to avoid recursion if
600 * Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)
602 new_state
= ctx
->NewState
| new_prog_state
;
604 ctx
->Driver
.UpdateState(ctx
, new_state
);
605 ctx
->Array
.NewState
= 0;
609 /* This is the usual entrypoint for state updates:
612 _mesa_update_state( GLcontext
*ctx
)
614 _mesa_lock_context_textures(ctx
);
615 _mesa_update_state_locked(ctx
);
616 _mesa_unlock_context_textures(ctx
);
623 * Want to figure out which fragment program inputs are actually
624 * constant/current values from ctx->Current. These should be
625 * referenced as a tracked state variable rather than a fragment
626 * program input, to save the overhead of putting a constant value in
627 * every submitted vertex, transferring it to hardware, interpolating
628 * it across the triangle, etc...
630 * When there is a VP bound, just use vp->outputs. But when we're
631 * generating vp from fixed function state, basically want to
634 * vp_out_2_fp_in( vp_in_2_vp_out( varying_inputs ) |
635 * potential_vp_outputs )
637 * Where potential_vp_outputs is calculated by looking at enabled
640 * The generated fragment program should then only declare inputs that
641 * may vary or otherwise differ from the ctx->Current values.
642 * Otherwise, the fp should track them as state values instead.
645 _mesa_set_varying_vp_inputs( GLcontext
*ctx
,
646 GLbitfield varying_inputs
)
648 if (ctx
->varying_vp_inputs
!= varying_inputs
) {
649 ctx
->varying_vp_inputs
= varying_inputs
;
650 ctx
->NewState
|= _NEW_ARRAY
;
651 /*_mesa_printf("%s %x\n", __FUNCTION__, varying_inputs);*/
657 * Used by drivers to tell core Mesa that the driver is going to
658 * install/ use its own vertex program. In particular, this will
659 * prevent generated fragment programs from using state vars instead
660 * of ordinary varyings/inputs.
663 _mesa_set_vp_override(GLcontext
*ctx
, GLboolean flag
)
665 if (ctx
->VertexProgram
._Overriden
!= flag
) {
666 ctx
->VertexProgram
._Overriden
= flag
;
668 /* Set one of the bits which will trigger fragment program
671 ctx
->NewState
|= _NEW_ARRAY
;