diff options
author | Mathias Fröhlich <[email protected]> | 2018-04-01 20:18:36 +0200 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-05-10 07:06:15 +0200 |
commit | d1698d4311a63e1054e458ae1a27d7684595faee (patch) | |
tree | 6d73b27e4d4963a36db96f20472bc725c265309b /src/mesa/vbo/vbo_private.h | |
parent | fb4011ace9022e674639f2743272b7eba650cde3 (diff) |
mesa: Compute effective buffer bindings in the vao.
Compute VAO buffer binding information past the position/generic0 mapping.
Scan for duplicate buffer bindings and collapse them into derived
effective buffer binding index and effective attribute mask variables.
Provide a set of helper functions to access the distilled
information in the VAO. All of them prefixed with _mesa_draw_...
to indicate that they are meant to query draw information.
v2: Also group user space arrays containing interleaved arrays.
Add _Eff*Offset to be copied on attribute and binding copy.
Update comments.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_private.h')
-rw-r--r-- | src/mesa/vbo/vbo_private.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo_private.h b/src/mesa/vbo/vbo_private.h index 589c61d675e..b69f836aa0b 100644 --- a/src/mesa/vbo/vbo_private.h +++ b/src/mesa/vbo/vbo_private.h @@ -60,6 +60,13 @@ vbo_context(struct gl_context *ctx) } +static inline const struct vbo_context * +vbo_context_const(const struct gl_context *ctx) +{ + return ctx->vbo_context; +} + + /** * Array to apply the fixed function material aliasing map to * an attribute value used in vbo processing inputs to an attribute @@ -209,7 +216,12 @@ _vbo_set_attrib_format(struct gl_context *ctx, const GLboolean doubles = vbo_attrtype_to_double_flag(type); _mesa_update_array_format(ctx, vao, attr, size, type, GL_RGBA, GL_FALSE, integer, doubles, offset); - /* Ptr for userspace arrays */ + /* Ptr for userspace arrays. + * For updating the pointer we would need to add the vao->NewArrays flag + * to the VAO. But but that is done already unconditionally in + * _mesa_update_array_format called above. + */ + assert((vao->NewArrays | ~vao->_Enabled) & VERT_BIT(attr)); vao->VertexAttrib[attr].Ptr = ADD_POINTERS(buffer_offset, offset); } |