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/main/varray.h | |
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/main/varray.h')
-rw-r--r-- | src/mesa/main/varray.h | 49 |
1 files changed, 13 insertions, 36 deletions
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index b65b82cea7d..77027be8002 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -48,37 +48,6 @@ _mesa_vertex_attrib_address(const struct gl_array_attributes *array, } -/** - * Sets the fields in a gl_vertex_array to values derived from a - * gl_array_attributes and a gl_vertex_buffer_binding. - */ -static inline void -_mesa_update_vertex_array(struct gl_context *ctx, - struct gl_vertex_array *dst, - const struct gl_array_attributes *attribs, - const struct gl_vertex_buffer_binding *binding) -{ - if (attribs->Enabled) { - dst->Size = attribs->Size; - dst->Type = attribs->Type; - dst->Format = attribs->Format; - dst->StrideB = binding->Stride; - dst->Ptr = _mesa_vertex_attrib_address(attribs, binding); - dst->Normalized = attribs->Normalized; - dst->Integer = attribs->Integer; - dst->Doubles = attribs->Doubles; - dst->InstanceDivisor = binding->InstanceDivisor; - dst->_ElementSize = attribs->_ElementSize; - _mesa_reference_buffer_object(ctx, &dst->BufferObj, binding->BufferObj); - } else { - /* Disabled arrays shall not be consumed */ - dst->Size = 0; - dst->Ptr = NULL; - _mesa_reference_buffer_object(ctx, &dst->BufferObj, NULL); - } -} - - static inline bool _mesa_attr_zero_aliases_vertex(const struct gl_context *ctx) { @@ -91,7 +60,7 @@ _mesa_attr_zero_aliases_vertex(const struct gl_context *ctx) */ static inline void _mesa_set_drawing_arrays(struct gl_context *ctx, - const struct gl_vertex_array **arrays) + const struct gl_vertex_array *arrays) { if (ctx->Array._DrawArrays != arrays) { ctx->Array._DrawArrays = arrays; @@ -495,10 +464,18 @@ extern void GLAPIENTRY _mesa_VertexArrayBindingDivisor(GLuint vaobj, GLuint bindingIndex, GLuint divisor); -extern void -_mesa_copy_vertex_array(struct gl_context *ctx, - struct gl_vertex_array *dst, - struct gl_vertex_array *src); + +/** + * Shallow copy one vertex array to another. + */ +static inline void +_mesa_copy_vertex_array(struct gl_vertex_array *dst, + const struct gl_vertex_array *src) +{ + dst->VertexAttrib = src->VertexAttrib; + dst->BufferBinding = src->BufferBinding; +} + extern void _mesa_copy_vertex_attrib_array(struct gl_context *ctx, |