diff options
author | Brian Paul <[email protected]> | 2015-10-27 13:50:10 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2015-10-28 11:03:27 -0600 |
commit | 2bf224b3f96f926ba442d2b33a6f50d33e31cee0 (patch) | |
tree | 328be218b2f256f9034319cb749744c92513fc6f /src/mesa | |
parent | 8e9c3070bf45cd33a77537c6769d422d2c9fa8c3 (diff) |
vbo: replace assertion with conditional in vbo_compute_max_verts()
With just the right sequence of per-vertex commands and state changes,
it's possible for this assertion to fail (such as with viewperf11's
lightwave-06-1 test). Instead of asserting, return 0 so that the
caller knows the VBO is full and needs to be flushed.
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/vbo/vbo_context.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h index e6b9d890d5f..6293a8b9edc 100644 --- a/src/mesa/vbo/vbo_context.h +++ b/src/mesa/vbo/vbo_context.h @@ -207,7 +207,8 @@ vbo_compute_max_verts(const struct vbo_exec_context *exec) { unsigned n = (VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / (exec->vtx.vertex_size * sizeof(GLfloat)); - assert(n > 0); + if (n == 0) + return 0; /* Subtract one so we're always sure to have room for an extra * vertex for GL_LINE_LOOP -> GL_LINE_STRIP conversion. */ |