summaryrefslogtreecommitdiff
path: root/src/mesa/vbo/vbo_save_draw.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-10-03 17:30:59 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-10-03 17:30:59 +0100
commit1680ef869625dc1fe9cf481b180382a34e0738e7 (patch)
treed1dff512846aaba0cf337043dd8fd00504fb5de3 /src/mesa/vbo/vbo_save_draw.c
parentd63a36ef3a4dd9cef1273fac5949e587c42813b5 (diff)
mesa: avoid generating constant vertex attributes in fixedfunc programs
Keep track of enabled/active vertex attributes. Keep track of potential vertex program outputs. When generating fragment program, replace references to fragment attributes which are effectively non-varying and non-computed passthrough attributes with references to the new CURRENT_ATTRIB tracked state value. Only downside is slight ugliness in VBO code where we need to validate state twice in succession.
Diffstat (limited to 'src/mesa/vbo/vbo_save_draw.c')
-rw-r--r--src/mesa/vbo/vbo_save_draw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 4c97acddb9..b015bf2786 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -118,6 +118,7 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
GLuint data = node->buffer_offset;
const GLuint *map;
GLuint attr;
+ GLuint varying_inputs = 0;
/* Install the default (ie Current) attributes first, then overlay
* all active ones.
@@ -167,8 +168,11 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
assert(arrays[attr].BufferObj->Name);
data += node->attrsz[src] * sizeof(GLfloat);
+ varying_inputs |= 1<<attr;
}
}
+
+ _mesa_set_varying_vp_inputs( ctx, varying_inputs );
}
static void vbo_save_loopback_vertex_list( GLcontext *ctx,