summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_vb_fog.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-04-22 12:51:19 +0000
committerKeith Whitwell <[email protected]>2005-04-22 12:51:19 +0000
commit6f973f33679e034b7cb63806f1ddfabdbdd70123 (patch)
tree31580bc32d1b87a3dddd8f7c8bc5f404b407c637 /src/mesa/tnl/t_vb_fog.c
parent6a13c7da4c79f7e811fbddc68f59441070ff0cc8 (diff)
Simplify the pipeline_stage structure
- remove input/output fields, input tracking removed. - remove state fields, the validate function now called on every statechange. - add an explicit 'create' function. Add in code to build vertex program to implement current t&l state. Still disabled, but turn on with a #define in t_vp_build.h.
Diffstat (limited to 'src/mesa/tnl/t_vb_fog.c')
-rw-r--r--src/mesa/tnl/t_vb_fog.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c
index 8eb1f78dc7f..91c3591f5bf 100644
--- a/src/mesa/tnl/t_vb_fog.c
+++ b/src/mesa/tnl/t_vb_fog.c
@@ -148,9 +148,10 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
struct fog_stage_data *store = FOG_STAGE_DATA(stage);
GLvector4f *input;
- if (stage->changed_inputs == 0)
+ if (!ctx->Fog.Enabled || ctx->VertexProgram._Enabled)
return GL_TRUE;
+
if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) {
/* Fog is computed from vertex or fragment Z values */
/* source = VB->ObjPtr or VB->EyePtr coords */
@@ -213,17 +214,6 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
}
-static void
-check_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
-{
- stage->active = ctx->Fog.Enabled && !ctx->VertexProgram._Enabled;
-
- if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT)
- stage->inputs = _TNL_BIT_POS;
- else
- stage->inputs = _TNL_BIT_FOG;
-}
-
/* Called the first time stage->run() is invoked.
*/
@@ -243,10 +233,7 @@ alloc_fog_data(GLcontext *ctx, struct tnl_pipeline_stage *stage)
if (!inited)
init_static_data();
- /* Now run the stage.
- */
- stage->run = run_fog_stage;
- return stage->run( ctx, stage );
+ return GL_TRUE;
}
@@ -265,14 +252,9 @@ free_fog_data(struct tnl_pipeline_stage *stage)
const struct tnl_pipeline_stage _tnl_fog_coordinate_stage =
{
"build fog coordinates", /* name */
- _NEW_FOG|_NEW_PROGRAM, /* check_state */
- _NEW_FOG, /* run_state */
- GL_FALSE, /* active? */
- 0, /* inputs */
- _TNL_BIT_FOG, /* outputs */
- 0, /* changed_inputs */
NULL, /* private_data */
+ alloc_fog_data, /* dtr */
free_fog_data, /* dtr */
- check_fog_stage, /* check */
- alloc_fog_data /* run -- initially set to init. */
+ NULL, /* check */
+ run_fog_stage /* run -- initially set to init. */
};