summaryrefslogtreecommitdiff
path: root/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-02-02 16:33:08 -0700
committerBrian Paul <brianp@vmware.com>2009-02-02 16:51:45 -0700
commitdea0d4d56326f148a42c766bdbaf1b5bb247cc59 (patch)
tree001cb5e05a1a279cf00e4fd993d1d8cb8222df91 /src/mesa/vbo/vbo_exec_api.c
parent1cb7cd1292dc8592d4912194d91355eb61361be5 (diff)
mesa: fix GLSL issue preventing use of all 16 generic vertex attributes
Only 15 actually worked before since we always reserved generic[0] as an alias for vertex position. The case of vertex attribute 0 is tricky. The spec says that there is no aliasing between generic vertex attributes 0..MAX_VERTEX_ATTRIBS-1 and the conventional attributes. But it also says that calls to glVertexAttrib(0, v) are equivalent to glVertex(v). The distinction seems to be in glVertex-mode versus vertex array mode. So update the VBO code so that if the shader uses generic[0] but not gl_Vertex, route the attribute data set with glVertex() to go to shader input generic[0]. No change needed for the glDrawArrays/Elements() path. This is a potentially risky change so regressions are possible. All the usual tests seem OK though.
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index d48f5230cb..f6daa253fd 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -148,11 +148,14 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec )
/* Note: the exec->vtx.current[i] pointers point into the
* ctx->Current.Attrib and ctx->Light.Material.Attrib arrays.
*/
+ if (exec->vtx.attrptr[i]) {
+
COPY_CLEAN_4V(current,
exec->vtx.attrsz[i],
exec->vtx.attrptr[i]);
-
+ }
+
/* Given that we explicitly state size here, there is no need
* for the COPY_CLEAN above, could just copy 16 bytes and be
* done. The only problem is when Mesa accesses ctx->Current