summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-04-23 14:16:46 +0000
committerBrian Paul <[email protected]>2004-04-23 14:16:46 +0000
commit6d460af6af77a0d5a5b568bcd6094b98e249ba93 (patch)
tree08656028582b357d5c9730c521cc3e1770604c50 /src/mesa/swrast/s_context.c
parent384800fe12e368f3489111de4572dbc8846a7dea (diff)
Added ctx->Vertex/FragmentProgram._Enable flags. Set when vertex/fragment
program is enabled AND the currently bound program is valid. Check _Enable instead of Enable to prevent things from blowing up when someone calls glEnable(GL_VERTEX_PROGRAM_ARB) without actually defining a program.
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 94b57e4bbfd..972de03b145 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -102,7 +102,7 @@ _swrast_update_rasterflags( GLcontext *ctx )
RasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */
}
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
RasterMask |= FRAGPROG_BIT;
}
@@ -145,7 +145,7 @@ _swrast_update_fog_hint( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
swrast->_PreferPixelFog = (!swrast->AllowVertexFog ||
- ctx->FragmentProgram.Enabled ||
+ ctx->FragmentProgram._Enabled ||
(ctx->Hint.Fog == GL_NICEST &&
swrast->AllowPixelFog));
}
@@ -189,7 +189,7 @@ _swrast_update_fog_state( GLcontext *ctx )
if (ctx->Fog.Enabled) {
swrast->_FogEnabled = GL_TRUE;
}
- else if (ctx->FragmentProgram.Enabled &&
+ else if (ctx->FragmentProgram._Enabled &&
ctx->FragmentProgram.Current->Base.Target == GL_FRAGMENT_PROGRAM_ARB) {
const struct fragment_program *p;
p = (struct fragment_program *) ctx->FragmentProgram.Current;
@@ -203,7 +203,7 @@ _swrast_update_fog_state( GLcontext *ctx )
static void
_swrast_update_fragment_program( GLcontext *ctx )
{
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
struct fragment_program *program = ctx->FragmentProgram.Current;
_mesa_load_state_parameters(ctx, program->Parameters);
}
@@ -271,7 +271,7 @@ _swrast_validate_triangle( GLcontext *ctx,
if (ctx->Texture._EnabledUnits == 0
&& NEED_SECONDARY_COLOR(ctx)
- && !ctx->FragmentProgram.Enabled) {
+ && !ctx->FragmentProgram._Enabled) {
/* separate specular color, but no texture */
swrast->SpecTriangle = swrast->Triangle;
swrast->Triangle = _swrast_add_spec_terms_triangle;
@@ -290,7 +290,7 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
if (ctx->Texture._EnabledUnits == 0
&& NEED_SECONDARY_COLOR(ctx)
- && !ctx->FragmentProgram.Enabled) {
+ && !ctx->FragmentProgram._Enabled) {
swrast->SpecLine = swrast->Line;
swrast->Line = _swrast_add_spec_terms_line;
}
@@ -309,7 +309,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
if (ctx->Texture._EnabledUnits == 0
&& NEED_SECONDARY_COLOR(ctx)
- && !ctx->FragmentProgram.Enabled) {
+ && !ctx->FragmentProgram._Enabled) {
swrast->SpecPoint = swrast->Point;
swrast->Point = _swrast_add_spec_terms_point;
}