Mesa (master): vbo: move attribute type assignment

Brian Paul brianp at kemper.freedesktop.org
Thu Oct 20 15:49:49 UTC 2016


Module: Mesa
Branch: master
Commit: 1098e6957c2e740afc2a471223aae2fec46a2582
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1098e6957c2e740afc2a471223aae2fec46a2582

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Oct 13 14:43:36 2016 -0600

vbo: move attribute type assignment

If the attribute type is changing, we would have found that earlier in
the ATTR_UNION() macro and would have called vbo_exec_fixup_vertex().
So move the assignment into that function so we don't do it every time.

No Piglit regressions.

Reviewed-by: Charmaine Lee <charmainel at vmware.com>

---

 src/mesa/vbo/vbo_exec_api.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index c0a5bc0..b191a94 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -423,6 +423,7 @@ vbo_exec_fixup_vertex(struct gl_context *ctx, GLuint attr,
    }
 
    exec->vtx.active_sz[attr] = newSize;
+   exec->vtx.attrtype[attr] = newType;
 
    /* Does setting NeedFlush belong here?  Necessitates resetting
     * vtxfmt on each flush (otherwise flags won't get reset
@@ -479,7 +480,7 @@ do {									\
       if (N>1) dest[1] = V1;						\
       if (N>2) dest[2] = V2;						\
       if (N>3) dest[3] = V3;						\
-      exec->vtx.attrtype[A] = T;					\
+      assert(exec->vtx.attrtype[A] == T);                               \
    }									\
 									\
    if ((A) == 0) {							\




More information about the mesa-commit mailing list