Use _Enabled rather than _Active when checking for fragment shaders
authorKeith Whitwell <keith@tungstengraphics.com>
Fri, 22 Sep 2006 11:45:21 +0000 (11:45 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Fri, 22 Sep 2006 11:45:21 +0000 (11:45 +0000)
src/mesa/swrast/s_context.c
src/mesa/swrast/s_span.c
src/mesa/swrast/s_triangle.c

index a265d9e6cefed9e3468e4d115ed30ea168f00ebd..030313aea60c2ae0d10c3ecbc759df99f4a088d7 100644 (file)
@@ -98,7 +98,7 @@ _swrast_update_rasterflags( GLcontext *ctx )
       rasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */
    }
 
-   if (ctx->FragmentProgram._Active) {
+   if (ctx->FragmentProgram._Enabled) {
       rasterMask |= FRAGPROG_BIT;
    }
 
@@ -206,7 +206,7 @@ _swrast_update_fog_state( GLcontext *ctx )
 
    /* determine if fog is needed, and if so, which fog mode */
    swrast->_FogEnabled = GL_FALSE;
-   if (ctx->FragmentProgram._Active) {
+   if (ctx->FragmentProgram._Enabled) {
       if (ctx->FragmentProgram._Current->Base.Target==GL_FRAGMENT_PROGRAM_ARB) {
          const struct gl_fragment_program *fp
             = ctx->FragmentProgram._Current;
@@ -230,7 +230,7 @@ _swrast_update_fog_state( GLcontext *ctx )
 static void
 _swrast_update_fragment_program( GLcontext *ctx )
 {
-   if (ctx->FragmentProgram._Active) {
+   if (ctx->FragmentProgram._Enabled) {
       const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
       _mesa_load_state_parameters(ctx, fp->Base.Parameters);
    }
@@ -299,7 +299,7 @@ _swrast_validate_triangle( GLcontext *ctx,
 
    if (ctx->Texture._EnabledUnits == 0
        && NEED_SECONDARY_COLOR(ctx)
-       && !ctx->FragmentProgram._Active) {
+       && !ctx->FragmentProgram._Enabled) {
       /* separate specular color, but no texture */
       swrast->SpecTriangle = swrast->Triangle;
       swrast->Triangle = _swrast_add_spec_terms_triangle;
@@ -322,7 +322,7 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
 
    if (ctx->Texture._EnabledUnits == 0
        && NEED_SECONDARY_COLOR(ctx)
-       && !ctx->FragmentProgram._Active) {
+       && !ctx->FragmentProgram._Enabled) {
       swrast->SpecLine = swrast->Line;
       swrast->Line = _swrast_add_spec_terms_line;
    }
@@ -345,7 +345,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
 
    if (ctx->Texture._EnabledUnits == 0
        && NEED_SECONDARY_COLOR(ctx)
-       && !ctx->FragmentProgram._Active) {
+       && !ctx->FragmentProgram._Enabled) {
       swrast->SpecPoint = swrast->Point;
       swrast->Point = _swrast_add_spec_terms_point;
    }
index d14310541627082e0e20c78b69b12e07e0fad221..cc7d4113fc32f63ad94a380e1d1f4a35ed1e15f5 100644 (file)
@@ -129,7 +129,7 @@ _swrast_span_default_texcoords( GLcontext *ctx, struct sw_span *span )
    GLuint i;
    for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
       const GLfloat *tc = ctx->Current.RasterTexCoords[i];
-      if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled) {
+      if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled) {
          COPY_4V(span->tex[i], tc);
       }
       else if (tc[3] > 0.0F) {
@@ -410,7 +410,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
             if (obj) {
                const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
                needLambda = (obj->MinFilter != obj->MagFilter)
-                  || ctx->FragmentProgram._Active;
+                  || ctx->FragmentProgram._Enabled;
                texW = img->WidthScale;
                texH = img->HeightScale;
             }
@@ -435,7 +435,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
                GLfloat r = span->tex[u][2];
                GLfloat q = span->tex[u][3];
                GLuint i;
-               if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled ||
+               if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled ||
                    ctx->ShaderObjects._FragmentShaderPresent) {
                   /* do perspective correction but don't divide s, t, r by q */
                   const GLfloat dwdx = span->dwdx;
@@ -487,7 +487,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
                GLfloat r = span->tex[u][2];
                GLfloat q = span->tex[u][3];
                GLuint i;
-               if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled ||
+               if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled ||
                    ctx->ShaderObjects._FragmentShaderPresent) {
                   /* do perspective correction but don't divide s, t, r by q */
                   const GLfloat dwdx = span->dwdx;
@@ -546,7 +546,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
       if (obj) {
          const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
          needLambda = (obj->MinFilter != obj->MagFilter)
-            || ctx->FragmentProgram._Active;
+            || ctx->FragmentProgram._Enabled;
          texW = (GLfloat) img->WidthScale;
          texH = (GLfloat) img->HeightScale;
       }
@@ -571,7 +571,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
          GLfloat r = span->tex[0][2];
          GLfloat q = span->tex[0][3];
          GLuint i;
-         if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled ||
+         if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled ||
              ctx->ShaderObjects._FragmentShaderPresent) {
             /* do perspective correction but don't divide s, t, r by q */
             const GLfloat dwdx = span->dwdx;
@@ -623,7 +623,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
          GLfloat r = span->tex[0][2];
          GLfloat q = span->tex[0][3];
          GLuint i;
-         if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled ||
+         if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled ||
              ctx->ShaderObjects._FragmentShaderPresent) {
             /* do perspective correction but don't divide s, t, r by q */
             const GLfloat dwdx = span->dwdx;
@@ -1120,7 +1120,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
    const GLbitfield origInterpMask = span->interpMask;
    const GLbitfield origArrayMask = span->arrayMask;
    const GLboolean deferredTexture = !(ctx->Color.AlphaEnabled ||
-                                       ctx->FragmentProgram._Active ||
+                                       ctx->FragmentProgram._Enabled ||
                                        ctx->ShaderObjects._FragmentShaderPresent);
 
    ASSERT(span->primitive == GL_POINT  ||  span->primitive == GL_LINE ||
@@ -1205,7 +1205,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
       }
       else
 #endif
-      if (ctx->FragmentProgram._Active) {
+      if (ctx->FragmentProgram._Enabled) {
          /* frag prog may need Z values */
          if (span->interpMask & SPAN_Z)
             _swrast_span_interpolate_z(ctx, span);
@@ -1292,7 +1292,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
       }
       else
 #endif
-      if (ctx->FragmentProgram._Active)
+      if (ctx->FragmentProgram._Enabled)
          _swrast_exec_fragment_program( ctx, span );
       else if (ctx->ATIFragmentShader._Enabled)
          _swrast_exec_fragment_shader( ctx, span );
index 440345fb1265de07493d1794a56a496824b58d07..5a1fc8aec176b8379dfdc6cacb2793a0aaa8a192 100644 (file)
@@ -1073,7 +1073,7 @@ _swrast_choose_triangle( GLcontext *ctx )
          }
       }
 
-      if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Active ||
+      if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Enabled ||
           ctx->ATIFragmentShader._Enabled || ctx->ShaderObjects._FragmentShaderPresent) {
          /* Ugh, we do a _lot_ of tests to pick the best textured tri func */
          const struct gl_texture_object *texObj2D;
@@ -1089,7 +1089,7 @@ _swrast_choose_triangle( GLcontext *ctx )
 
          /* First see if we can use an optimized 2-D texture function */
          if (ctx->Texture._EnabledCoordUnits == 0x1
-             && !ctx->FragmentProgram._Active
+             && !ctx->FragmentProgram._Enabled
              && !ctx->ATIFragmentShader._Enabled
              && !ctx->ShaderObjects._FragmentShaderPresent
              && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT