aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_array.c32
-rw-r--r--src/mesa/state_tracker/st_extensions.c2
2 files changed, 34 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c
index 0b5909ba11a..1faf72b0db5 100644
--- a/src/mesa/state_tracker/st_atom_array.c
+++ b/src/mesa/state_tracker/st_atom_array.c
@@ -149,6 +149,38 @@ st_setup_arrays(struct st_context *st,
st->draw_needs_minmax_index =
(userbuf_attribs & ~_mesa_draw_nonzero_divisor_bits(ctx)) != 0;
+ if (vao->IsDynamic) {
+ while (mask) {
+ const gl_vert_attrib attr = u_bit_scan(&mask);
+ const struct gl_array_attributes *const attrib =
+ _mesa_draw_array_attrib(vao, attr);
+ const struct gl_vertex_buffer_binding *const binding =
+ &vao->BufferBinding[attrib->BufferBindingIndex];
+ const unsigned bufidx = (*num_vbuffers)++;
+
+ /* Set the vertex buffer. */
+ if (binding->BufferObj) {
+ struct st_buffer_object *stobj = st_buffer_object(binding->BufferObj);
+
+ vbuffer[bufidx].buffer.resource = stobj ? stobj->buffer : NULL;
+ vbuffer[bufidx].is_user_buffer = false;
+ vbuffer[bufidx].buffer_offset = binding->Offset +
+ attrib->RelativeOffset;
+ } else {
+ vbuffer[bufidx].buffer.user = attrib->Ptr;
+ vbuffer[bufidx].is_user_buffer = true;
+ vbuffer[bufidx].buffer_offset = 0;
+ }
+ vbuffer[bufidx].stride = binding->Stride; /* in bytes */
+
+ /* Set the vertex element. */
+ init_velement(vp, velements->velems, &attrib->Format, 0,
+ binding->InstanceDivisor, bufidx,
+ input_to_index[attr]);
+ }
+ return;
+ }
+
while (mask) {
/* The attribute index to start pulling a binding */
const gl_vert_attrib i = ffs(mask) - 1;
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 386b035a052..5ddb55f053d 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -583,6 +583,8 @@ void st_init_limits(struct pipe_screen *screen,
c->MultiDrawWithUserIndices =
screen->get_param(screen, PIPE_CAP_DRAW_INFO_START_WITH_USER_INDICES);
+ c->AllowDynamicVAOFastPath = true;
+
c->glBeginEndBufferSize =
screen->get_param(screen, PIPE_CAP_GL_BEGIN_END_BUFFER_SIZE);
}