keeping things safe: sanity check back
[mesa.git] / src / mesa / tnl / t_vb_render.c
index ec0d11bf84cc8a806638fab1c7c02b396131c484..1c5016896833c50ceaec8780027a1c4b53d41430 100644 (file)
@@ -45,7 +45,7 @@
 #include "macros.h"
 #include "imports.h"
 #include "mtypes.h"
-
+#include "nvfragprog.h"
 #include "math/m_matrix.h"
 #include "math/m_xform.h"
 
@@ -304,7 +304,7 @@ static GLboolean run_render( GLcontext *ctx,
 
    do
    {
-      GLint i;
+      GLuint i;
 
       for (i = 0 ; i < VB->PrimitiveCount ; i++)
       {
@@ -342,38 +342,7 @@ static GLboolean run_render( GLcontext *ctx,
  */
 static void check_render( GLcontext *ctx, struct tnl_pipeline_stage *stage )
 {
-   GLuint inputs = _TNL_BIT_POS;
-   GLuint i;
-
-   if (ctx->Visual.rgbMode) {
-      inputs |= _TNL_BIT_COLOR0;
-
-      if (NEED_SECONDARY_COLOR(ctx))
-        inputs |= _TNL_BIT_COLOR1;
-
-      if (ctx->Texture._EnabledCoordUnits) {
-        for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
-           if (ctx->Texture._EnabledCoordUnits & (1 << i))
-              inputs |= _TNL_BIT_TEX(i);
-        }
-      }
-   }
-   else {
-      inputs |= _TNL_BIT_INDEX;
-   }
-
-   /* How do drivers turn this off?
-    */
-   if (ctx->Fog.Enabled)
-      inputs |= _TNL_BIT_FOG;
-
-   if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL)
-      inputs |= _TNL_BIT_EDGEFLAG;
-
-   if (ctx->RenderMode==GL_FEEDBACK)
-      inputs |= _TNL_BITS_TEX_ANY;
-
-   stage->inputs = inputs;
+   stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
 }