From b0d331c7ae576151ba70c870f2c4838df53a199b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Fr=C3=B6hlich?= Date: Tue, 13 Mar 2018 09:12:48 +0100 Subject: [PATCH] vbo: Attempt to fix Bug 105471. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathias Fröhlich --- src/mesa/vbo/vbo_split_copy.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 09b5b3b651..96828a073f 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -63,6 +63,7 @@ struct copy_context { struct { GLuint attr; GLuint size; + const struct gl_vertex_array *array; const GLubyte *src_ptr; struct gl_vertex_buffer_binding dstbinding; @@ -258,7 +259,7 @@ elt(struct copy_context *copy, GLuint elt_idx) GLuint i; for (i = 0; i < copy->nr_varying; i++) { - const struct gl_vertex_array *srcarray = ©->array[i]; + const struct gl_vertex_array *srcarray = copy->varying[i].array; const struct gl_vertex_buffer_binding* srcbinding = srcarray->BufferBinding; const GLubyte *srcptr @@ -449,6 +450,7 @@ replay_init(struct copy_context *copy) GLuint j = copy->nr_varying++; copy->varying[j].attr = i; + copy->varying[j].array = ©->array[i]; copy->varying[j].size = attr_size(attrib); copy->vertex_size += attr_size(attrib); @@ -520,7 +522,7 @@ replay_init(struct copy_context *copy) /* Setup new vertex arrays to point into the output buffer: */ for (offset = 0, i = 0; i < copy->nr_varying; i++) { - const struct gl_vertex_array *src = ©->array[i]; + const struct gl_vertex_array *src = copy->varying[i].array; const struct gl_array_attributes *srcattr = src->VertexAttrib; struct gl_vertex_array *dst = ©->dstarray[i]; struct gl_vertex_buffer_binding *dstbind = ©->varying[i].dstbinding; @@ -576,7 +578,7 @@ replay_finish(struct copy_context *copy) /* Unmap VBO's */ for (i = 0; i < copy->nr_varying; i++) { struct gl_buffer_object *vbo = - copy->array[i].BufferBinding->BufferObj; + copy->varying[i].array->BufferBinding->BufferObj; if (_mesa_is_bufferobj(vbo) && _mesa_bufferobj_mapped(vbo, MAP_INTERNAL)) ctx->Driver.UnmapBuffer(ctx, vbo, MAP_INTERNAL); } -- 2.14.3