vbo: fix VBO optimization regression

The optimization in change 8e4efdc895 ("vbo: optimize some display
list drawing") missed the loopback case.  This is used when the
glBegin/End primitive doesn't have a uniform set of vertex attributes.
The new Piglit gl-1.0-dlist-materials test hits this.

So check the aligned_vertex_buffer_offset(list) value and adjust the
buffer offset accordingly.

We also need to remove the 'start == 0' assertion in the loopback
code since it no longer applies.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
Brian Paul
2018-01-17 15:15:54 -07:00
parent 26bde1e354
commit 9e6efdd177
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -240,8 +240,11 @@ loopback_vertex_list(struct gl_context *ctx,
list->vertex_store->bufferobj,
MAP_INTERNAL);
unsigned buffer_offset =
aligned_vertex_buffer_offset(list) ? 0 : list->buffer_offset;
vbo_loopback_vertex_list(ctx,
(const GLfloat *)(buffer + list->buffer_offset),
(const GLfloat *) (buffer + buffer_offset),
list->attrsz,
list->prims,
list->prim_count,
+3 -3
View File
@@ -107,17 +107,17 @@ loopback_prim(struct gl_context *ctx,
GLuint k;
if (0)
printf("loopback prim %s(%s,%s) verts %d..%d\n",
printf("loopback prim %s(%s,%s) verts %d..%d vsize %d\n",
_mesa_lookup_prim_by_nr(prim->mode),
prim->begin ? "begin" : "..",
prim->end ? "end" : "..",
start, end);
start, end,
vertex_size);
if (prim->begin) {
CALL_Begin(GET_DISPATCH(), (prim->mode));
}
else {
assert(start == 0);
start += wrap_count;
}