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_context.c | |
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_context.c')
-rw-r--r-- | src/mesa/vbo/vbo_context.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index ada78ffd63b..cc6aada8610 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -234,6 +234,23 @@ _vbo_DestroyContext(struct gl_context *ctx) } +const struct gl_array_attributes * +_vbo_current_attrib(const struct gl_context *ctx, gl_vert_attrib attr) +{ + const struct vbo_context *vbo = vbo_context_const(ctx); + const gl_vertex_processing_mode vmp = ctx->VertexProgram._VPMode; + return &vbo->current[_vbo_attribute_alias_map[vmp][attr]]; +} + + +const struct gl_vertex_buffer_binding * +_vbo_current_binding(const struct gl_context *ctx) +{ + const struct vbo_context *vbo = vbo_context_const(ctx); + return &vbo->binding; +} + + /* * Helper function for _vbo_draw_indirect below that additionally takes a zero * initialized array of _mesa_prim scratch space memory as the last argument. |