summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r200/r200_tcl.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2005-05-13 09:15:50 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2005-05-13 09:15:50 +0000
commit846eb333aee2eeece35a6ec2f8ac8b40e99c5fcd (patch)
treee6a3b05f5d56361ecf221accad229f694cb57786 /src/mesa/drivers/dri/r200/r200_tcl.c
parentc9a69a69689e0cc26fb4708f7f76ab632af88eca (diff)
Calculate render inputs for tcl stage correctly (hint: they aren't the
same as tnl->render_inputs). Fixes recent tcl problems.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_tcl.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_tcl.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c
index 335af12594..fbce05f928 100644
--- a/src/mesa/drivers/dri/r200/r200_tcl.c
+++ b/src/mesa/drivers/dri/r200/r200_tcl.c
@@ -370,6 +370,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
r200ContextPtr rmesa = R200_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
+ GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0;
GLuint i;
/* TODO: separate this from the swtnl pipeline
@@ -383,8 +384,38 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
if (VB->Count == 0)
return GL_FALSE;
+ /* Validate state:
+ */
+ if (rmesa->NewGLState)
+ r200ValidateState( ctx );
+
+ /* NOTE: inputs != tnl->render_inputs - these are the untransformed
+ * inputs.
+ */
+ if (ctx->Light.Enabled) {
+ inputs |= VERT_BIT_NORMAL;
+ if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
+ inputs |= VERT_BIT_COLOR1;
+ }
+ }
+
+ if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
+ inputs |= VERT_BIT_FOG;
+ }
+
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled) {
+ if (rmesa->TexGenNeedNormals[i]) {
+ inputs |= VERT_BIT_NORMAL;
+ }
+ inputs |= VERT_BIT_TEX(i);
+ }
+ }
+
+ /* Do the actual work:
+ */
r200ReleaseArrays( ctx, ~0 /* stage->changed_inputs */ );
- r200EmitArrays( ctx, tnl->render_inputs );
+ r200EmitArrays( ctx, inputs );
rmesa->tcl.Elts = VB->Elts;