summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Fröhlich <mathias.froehlich@web.de>2018-03-13 09:12:48 +0100
committerMathias Fröhlich <mathias.froehlich@web.de>2018-03-15 06:11:57 +0100
commit98f35ad63c23805c32654843f55208e675d4e4db (patch)
tree7a160f5dafea78de168fb54e836d908ecdf88d33
parent361f79c97f6eb4bfdb2162672d2ca8f3c486f22c (diff)
vbo: Correctly handle source arrays in vbo_split_copy.
The original approach did optimize away a bit too many fields. Restablish the pointer into the original array and correctly feed that one. Reviewed-by: Brian Paul <brianp@vmware.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105471 Fixes: 64d2a20480547d5897fd9d7b8fd306f2625138cb mesa: Make gl_vertex_array contain pointers to first order VAO members. Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
-rw-r--r--src/mesa/vbo/vbo_split_copy.c8
1 files 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 = &copy->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 = &copy->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 = &copy->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 = &copy->dstarray[i];
struct gl_vertex_buffer_binding *dstbind = &copy->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);
}