Mesa (master): vbo: add assertion in ATTR_UNION macro

Brian Paul brianp at kemper.freedesktop.org
Tue Oct 13 14:58:04 UTC 2015


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

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Oct 12 10:53:59 2015 -0600

vbo: add assertion in ATTR_UNION macro

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

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

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 9de2886..3943523 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -423,6 +423,9 @@ vbo_exec_fixup_vertex(struct gl_context *ctx, GLuint attr, GLuint newSize, GLenu
 do {									\
    struct vbo_exec_context *exec = &vbo_context(ctx)->exec;		\
    int sz = (sizeof(C) / sizeof(GLfloat));                              \
+                                                                        \
+   assert(sz == 1 || sz == 2);                                          \
+                                                                        \
    if (unlikely(!(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT))) {     \
       vbo_exec_BeginVertices(ctx);					\
    }									\




More information about the mesa-commit mailing list