vbo: add assertion in ATTR_UNION macro
authorBrian Paul <brianp@vmware.com>
Mon, 12 Oct 2015 16:53:59 +0000 (10:53 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 13 Oct 2015 14:28:23 +0000 (08:28 -0600)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/vbo/vbo_exec_api.c

index 9de2886c499e3a748099cb273cb1d7b4e53b3955..3943523b7026a974824344eb2a6978ce705a7e36 100644 (file)
@@ -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);                                     \
    }                                                                   \