}
-static void gamma_check_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
-}
-
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
-}
-
-
const struct tnl_pipeline_stage _gamma_render_stage =
{
"gamma render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
- dtr, /* destructor */
- gamma_check_render, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
gamma_run_render /* run */
};
}
-static void i810_check_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
-}
-
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
-}
-
const struct tnl_pipeline_stage _i810_render_stage =
{
"i810 render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
- dtr, /* destructor */
- i810_check_render, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
i810_run_render /* run */
};
}
-static void i830_check_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
-}
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
-}
-
-
const struct tnl_pipeline_stage _i830_render_stage =
{
"i830 render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
- dtr, /* destructor */
- i830_check_render, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
i830_run_render /* run */
};
return GL_FALSE; /* finished the pipe */
}
-
-static void intel_check_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
-}
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
-}
-
-
const struct tnl_pipeline_stage _intel_render_stage =
{
"intel render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
- dtr, /* destructor */
- intel_check_render, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
intel_run_render /* run */
};
}
-static void mga_check_render( GLcontext *ctx, struct tnl_pipeline_stage *stage )
-{
- stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
-}
-
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
-}
-
-
const struct tnl_pipeline_stage _mga_render_stage =
{
"mga render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
- dtr, /* destructor */
- mga_check_render, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
mga_run_render /* run */
};
return GL_FALSE;
r200ReleaseArrays( ctx, ~0 /* stage->changed_inputs */ );
- r200EmitArrays( ctx, stage->inputs );
+ r200EmitArrays( ctx, tnl->render_inputs );
rmesa->tcl.Elts = VB->Elts;
-static void r200_check_tcl_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint inputs = VERT_BIT_POS;
- GLuint unit;
-
- /* Validate state:
- */
- if (rmesa->NewGLState)
- r200ValidateState( ctx );
-
- if (ctx->RenderMode == GL_RENDER) {
- /* Make all this event-driven:
- */
- if (ctx->Light.Enabled) {
- inputs |= VERT_BIT_NORMAL;
-
- if (1 || ctx->Light.ColorMaterialEnabled) {
- inputs |= VERT_BIT_COLOR0;
- }
- }
- else {
- inputs |= VERT_BIT_COLOR0;
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- inputs |= VERT_BIT_COLOR1;
- }
- }
-
- if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
- inputs |= VERT_BIT_FOG;
- }
-
- for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
- if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- if (rmesa->TexGenNeedNormals[unit]) {
- inputs |= VERT_BIT_NORMAL;
- }
- inputs |= VERT_BIT_TEX(unit);
- }
- }
-
- stage->inputs = inputs;
- stage->active = 1;
- }
- else
- stage->active = 0;
-}
-
-static void r200_init_tcl_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- stage->check = r200_check_tcl_render;
- stage->check( ctx, stage );
-}
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
-}
-
-
/* Initial state for tcl stage.
*/
const struct tnl_pipeline_stage _r200_tcl_stage =
{
"r200 render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_LIGHT|
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, NULL, /* changed_inputs, private */
- dtr, /* destructor */
- r200_init_tcl_render, /* check - initially set to alloc data */
+ NULL, /* private */
+ NULL,
+ NULL,
+ NULL,
r200_run_tcl_render /* run */
};
tnl_render_func *tab = TAG(render_tab_verts);
GLuint i;
- if (rmesa->swtcl.indexed_verts.buf && (!VB->Elts || stage->changed_inputs))
+ if (rmesa->swtcl.indexed_verts.buf)
RELEASE_ELT_VERTS();
if (rmesa->swtcl.RenderIndex != 0 ||
-static void radeon_check_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
-}
-
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
-}
-
const struct tnl_pipeline_stage _radeon_render_stage =
{
"radeon render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, NULL, /* changed_inputs, private */
- dtr, /* destructor */
- radeon_check_render, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
radeon_run_render /* run */
};
return GL_TRUE;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
- if (!(ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_RECT_BIT))
- continue;
-
- if (stage->changed_inputs & VERT_BIT_TEX(i)) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_RECT_BIT) {
struct gl_texture_object *texObj = ctx->Texture.Unit[i].CurrentRect;
struct gl_texture_image *texImage = texObj->Image[0][texObj->BaseLevel];
const GLfloat iw = 1.0/texImage->Width;
out[j][1] = in[1] * ih;
in = (GLfloat *)((GLubyte *)in + instride);
}
- }
- VB->TexCoordPtr[i] = &store->texcoord[i];
+ VB->TexCoordPtr[i] = &store->texcoord[i];
+ }
}
return GL_TRUE;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
_mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
- /* Now run the stage.
- */
- stage->run = run_texrect_stage;
- return stage->run( ctx, stage );
-}
-
-
-static void check_texrect( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- GLuint flags = 0;
-
- if (ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_RECT_BIT)
- flags |= VERT_BIT_TEX0;
-
- if (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_RECT_BIT)
- flags |= VERT_BIT_TEX1;
-
- stage->inputs = flags;
- stage->outputs = flags;
- stage->active = (flags != 0);
+ return GL_TRUE;
}
-
static void free_texrect_data( struct tnl_pipeline_stage *stage )
{
struct texrect_stage_data *store = TEXRECT_STAGE_DATA(stage);
}
}
-
const struct tnl_pipeline_stage _radeon_texrect_stage =
{
"radeon texrect stage", /* name */
- _NEW_TEXTURE, /* check_state */
- _NEW_TEXTURE, /* run_state */
- GL_TRUE, /* active? */
- 0, /* inputs */
- 0, /* outputs */
- 0, /* changed_inputs */
- NULL, /* private data */
- free_texrect_data, /* destructor */
- check_texrect, /* check */
- alloc_texrect_data, /* run -- initially set to init */
+ NULL,
+ alloc_texrect_data,
+ free_texrect_data,
+ NULL,
+ run_texrect_stage
};
if (VB->Count == 0)
return GL_FALSE;
- radeonReleaseArrays( ctx, stage->changed_inputs );
- radeonEmitArrays( ctx, stage->inputs );
+ radeonReleaseArrays( ctx, ~0 );
+ radeonEmitArrays( ctx, tnl->render_inputs );
rmesa->tcl.Elts = VB->Elts;
-static void radeon_check_tcl_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint inputs = VERT_BIT_POS;
-
- if (ctx->RenderMode == GL_RENDER) {
- /* Make all this event-driven:
- */
- if (ctx->Light.Enabled) {
- inputs |= VERT_BIT_NORMAL;
-
- if (1 || ctx->Light.ColorMaterialEnabled) {
- inputs |= VERT_BIT_COLOR0;
- }
- }
- else {
- inputs |= VERT_BIT_COLOR0;
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- inputs |= VERT_BIT_COLOR1;
- }
- }
-
- if (ctx->Texture.Unit[0]._ReallyEnabled) {
- if (ctx->Texture.Unit[0].TexGenEnabled) {
- if (rmesa->TexGenNeedNormals[0]) {
- inputs |= VERT_BIT_NORMAL;
- }
- } else {
- inputs |= VERT_BIT_TEX0;
- }
- }
-
- if (ctx->Texture.Unit[1]._ReallyEnabled) {
- if (ctx->Texture.Unit[1].TexGenEnabled) {
- if (rmesa->TexGenNeedNormals[1]) {
- inputs |= VERT_BIT_NORMAL;
- }
- } else {
- inputs |= VERT_BIT_TEX1;
- }
- }
-
- stage->inputs = inputs;
- stage->active = 1;
- }
- else
- stage->active = 0;
-}
-
-static void radeon_init_tcl_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- stage->check = radeon_check_tcl_render;
- stage->check( ctx, stage );
-}
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
-}
-
-
/* Initial state for tcl stage.
*/
const struct tnl_pipeline_stage _radeon_tcl_stage =
{
"radeon render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_LIGHT|
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, NULL, /* changed_inputs, private */
- dtr, /* destructor */
- radeon_init_tcl_render, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
radeon_run_tcl_render /* run */
};
}
-static void s3v_check_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0;
-
- DEBUG(("s3v_check_render\n"));
-
- if (ctx->RenderMode == GL_RENDER) {
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- DEBUG(("DD_SEPARATE_SPECULAR\n"));
- inputs |= VERT_BIT_COLOR1;
- }
-
- if (ctx->Texture.Unit[0]._ReallyEnabled) {
- DEBUG(("ctx->Texture.Unit[0]._ReallyEnabled\n"));
- inputs |= VERT_BIT_TEX(0);
- }
-
- if (ctx->Texture.Unit[1]._ReallyEnabled) {
- DEBUG(("ctx->Texture.Unit[1]._ReallyEnabled\n"));
- inputs |= VERT_BIT_TEX(1);
- }
-
- if (ctx->Fog.Enabled) {
- DEBUG(("ctx->Fog.Enabled\n"));
- inputs |= VERT_BIT_FOG;
- }
- }
-
- stage->inputs = inputs;
- vmesa->SetupNewInputs = inputs;
-}
-
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
- /* hack to silence a compiler warning */
- (void) &s3v_validate_render;
-}
-
const struct tnl_pipeline_stage _s3v_render_stage =
{
"s3v render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
- dtr, /* destructor */
- s3v_check_render, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
s3v_run_render /* run */
};
GLboolean valid;
GLuint i;
- if (savageHaveIndexedVerts(imesa) && (!VB->Elts || stage->changed_inputs))
+ if (savageHaveIndexedVerts(imesa))
savageReleaseIndexedVerts(imesa);
if (imesa->savageScreen->chipset < S3_SAVAGE4 &&
return GL_FALSE; /* finished the pipe */
}
-static void savage_check_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
- stage->active = SAVAGE_CONTEXT(ctx)->enable_fastpath;
-}
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
- (void)stage;
-}
-
struct tnl_pipeline_stage _savage_render_stage =
{
"savage render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
- dtr, /* destructor */
- savage_check_render, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
savage_run_render /* run */
};
/* Pipeline stage for texture coordinate normalization */
/**********************************************************************/
struct texnorm_stage_data {
+ GLboolean active;
GLvector4f texcoord[MAX_TEXTURE_UNITS];
};
struct vertex_buffer *VB = &tnl->vb;
GLuint i;
- if (imesa->Fallback)
+ if (imesa->Fallback || !store->active)
return GL_TRUE;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
- if (!(stage->inputs & stage->changed_inputs & VERT_BIT_TEX(i)) ||
- VB->TexCoordPtr[i]->size == 4)
+ if (VB->TexCoordPtr[i]->size == 4)
/* Never try to normalize homogenous tex coords! */
continue;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
_mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
-
- /* Now run the stage.
- */
- stage->run = run_texnorm_stage;
- return stage->run( ctx, stage );
+
+ return GL_TRUE;
}
-static void check_texnorm( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
+static void validate_texnorm( GLcontext *ctx,
+ struct tnl_pipeline_stage *stage )
{
+ struct texnorm_stage_data *store = TEXNORM_STAGE_DATA(stage);
GLuint flags = 0;
if (((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
(ctx->Texture.Unit[1]._Current->WrapT == GL_REPEAT)))
flags |= VERT_BIT_TEX1;
- stage->inputs = flags;
- stage->outputs = flags;
- stage->active = (flags != 0);
+ store->active = (flags != 0);
}
static void free_texnorm_data( struct tnl_pipeline_stage *stage )
struct tnl_pipeline_stage _savage_texnorm_stage =
{
"savage texture coordinate normalization stage", /* name */
- _NEW_TEXTURE, /* check_state */
- _NEW_TEXTURE, /* run_state */
- GL_TRUE, /* active? */
- 0, /* inputs */
- 0, /* outputs */
- 0, /* changed_inputs */
NULL, /* private data */
- free_texnorm_data, /* destructor */
- check_texnorm, /* check */
alloc_texnorm_data, /* run -- initially set to init */
+ free_texnorm_data, /* destructor */
+ validate_texnorm,
+ run_texnorm_stage
};
return GL_FALSE; /* finished the pipe */
}
-
-static void via_check_fastrender(GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
-}
-
-
-static void fastdtr(struct tnl_pipeline_stage *stage)
-{
- (void)stage;
-}
-
-
const struct tnl_pipeline_stage _via_fastrender_stage =
{
"via fast render",
- (_DD_NEW_SEPARATE_SPECULAR |
- _NEW_TEXTURE|
- _NEW_FOG|
- _NEW_RENDERMODE), /* re-check (new inputs) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
- fastdtr, /* destructor */
- via_check_fastrender, /* check - initially set to alloc data */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
via_run_fastrender /* run */
};