summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-03-24 10:16:49 -0600
committerBrian <brian@yutani.localnet.net>2007-03-24 10:16:49 -0600
commitb50b036ffb795a12106bd59b1a08b0287a8b3388 (patch)
tree51ace1ddfed70852bb4ee8cba04552299cc08eac /src/mesa
parentdc3015f1574f26704c3498c56915b5570d777da4 (diff)
When computing render_inputs_bitset, omit primary color if we have a fragment program and it doesn't need FRAG_ATTRIB_COL0. Silences valgrind warnings.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/tnl/t_context.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index f665485f42..fa42a3df98 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -102,6 +102,8 @@ void
_tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
+ const struct gl_vertex_program *vp = ctx->VertexProgram._Current;
+ const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
if (new_state & (_NEW_HINT)) {
ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
@@ -118,7 +120,9 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
RENDERINPUTS_ZERO( tnl->render_inputs_bitset );
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS );
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 );
+ if (!fp || fp->Base.InputsRead & FRAG_BIT_COL0) {
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 );
+ }
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
if (ctx->Texture._EnabledCoordUnits & (1 << i)) {
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) );
@@ -151,15 +155,12 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POINTSIZE );
/* 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));
- }
+ 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));
}
}
}