diff options
author | Mathias Fröhlich <[email protected]> | 2018-03-04 18:15:53 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-03-10 07:33:51 +0100 |
commit | 64d2a20480547d5897fd9d7b8fd306f2625138cb (patch) | |
tree | 15d831310fe0a2e2ff7d3c58eac8fceecc738f15 /src/mesa/vbo/vbo_exec.c | |
parent | d62f0df3541ab9ee7a4999f0ecedc52f8d1ab8cc (diff) |
mesa: Make gl_vertex_array contain pointers to first order VAO members.
Instead of keeping a copy of the vertex array content in
struct gl_vertex_array only keep pointers to the first order
information originaly in the VAO.
For that represent the current values by struct gl_array_attributes
and struct gl_vertex_buffer_binding.
v2: Change comments.
Remove gl... prefix from variables except in the i965 directory where
it was like that before. Reindent because of that.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_exec.c')
-rw-r--r-- | src/mesa/vbo/vbo_exec.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c index 69a150c78b7..c0b0a11fe51 100644 --- a/src/mesa/vbo/vbo_exec.c +++ b/src/mesa/vbo/vbo_exec.c @@ -267,11 +267,14 @@ update_vao_inputs(struct gl_context *ctx, /* Fill in the client arrays from the VAO */ const GLubyte *const map = _mesa_vao_attribute_map[vao->_AttributeMapMode]; - const struct gl_vertex_array *array = vao->_VertexArray; - const struct gl_vertex_array **iarray = &inputs->inputs[0]; + const struct gl_array_attributes *attribs = &vao->VertexAttrib[0]; + const struct gl_vertex_buffer_binding *bindings = &vao->BufferBinding[0]; while (enable) { const int attr = u_bit_scan(&enable); - iarray[attr] = &array[map[attr]]; + struct gl_vertex_array *input = &inputs->inputs[attr]; + const struct gl_array_attributes *attrib = &attribs[map[attr]]; + input->VertexAttrib = attrib; + input->BufferBinding = &bindings[attrib->BufferBindingIndex]; } } @@ -294,12 +297,13 @@ update_current_inputs(struct gl_context *ctx, mask |= current & VERT_BIT_MAT_ALL; struct vbo_context *vbo = vbo_context(ctx); - const struct gl_vertex_array *const currval = &vbo->currval[0]; - const struct gl_vertex_array **iarray = &inputs->inputs[0]; + const struct gl_array_attributes *const currval = &vbo->current[0]; const GLubyte *const map = _vbo_attribute_alias_map[mode]; while (mask) { const int attr = u_bit_scan(&mask); - iarray[attr] = &currval[map[attr]]; + struct gl_vertex_array *input = &inputs->inputs[attr]; + input->VertexAttrib = &currval[map[attr]]; + input->BufferBinding = &vbo->binding; } inputs->current = current; |