summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_context.c
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-03-19 14:44:15 -0600
committerBrian <brian@yutani.localnet.net>2007-03-19 14:44:15 -0600
commitfdcbbeb55ecafe119bb98dcedb8492416f5bc966 (patch)
treec39087bb49af6924ea2cdfff1941ed804fc2879f /src/mesa/tnl/t_context.c
parente348016253582e6a31f7ee7149ff4999de33642d (diff)
Properly compute render_inputs_bitset when using a vertex program/shader.
This fixes a performance regression introduced early in glsl-compiler-1 work.
Diffstat (limited to 'src/mesa/tnl/t_context.c')
-rw-r--r--src/mesa/tnl/t_context.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 3b2f91acba..f665485f42 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -150,13 +150,19 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
(ctx->VertexProgram._Enabled && ctx->VertexProgram.PointSizeEnabled))
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POINTSIZE );
-#if 1 /* XXX NEW_SLANG */
- RENDERINPUTS_SET_RANGE( tnl->render_inputs_bitset,
- _TNL_FIRST_GENERIC, _TNL_LAST_GENERIC );
-#else
- if (ctx->ShaderObjects._VertexShaderPresent || ctx->ShaderObjects._FragmentShaderPresent)
- RENDERINPUTS_SET_RANGE( tnl->render_inputs_bitset, _TNL_FIRST_GENERIC, _TNL_LAST_GENERIC );
-#endif
+ /* check for varying vars which are written by the vertex program */
+ {
+ struct gl_vertex_program *vp = ctx->VertexProgram._Current;
+ if (vp) {
+ GLuint i;
+ for (i = 0; i < MAX_VARYING; i++) {
+ if (vp->Base.OutputsWritten & (1 << (VERT_RESULT_VAR0 + i))) {
+ RENDERINPUTS_SET(tnl->render_inputs_bitset,
+ _TNL_ATTRIB_GENERIC(i));
+ }
+ }
+ }
+ }
}