vbuffer.is_user_buffer = !!low_addr; /* if NULL, then unbind */
vbuffer.buffer_offset = 0;
vbuffer.stride = stride;
+
+ if (low_addr)
+ st->draw_needs_minmax_index = true;
}
set_vertex_attribs(st, &vbuffer, num_inputs ? 1 : 0,
vbuffer[bufidx].buffer.user = array->Ptr;
vbuffer[bufidx].is_user_buffer = true;
vbuffer[bufidx].buffer_offset = 0;
+
+ if (!array->InstanceDivisor)
+ st->draw_needs_minmax_index = true;
}
}
unsigned num_inputs;
st->vertex_array_out_of_memory = FALSE;
+ st->draw_needs_minmax_index = false;
/* No drawing has been done yet, so do nothing. */
if (!arrays)
* on glViewpport calls, this is set via a option.
*/
boolean invalidate_on_gl_viewport;
-
+ boolean draw_needs_minmax_index;
boolean vertex_array_out_of_memory;
/* Some state is contained in constant objects.
#include "cso_cache/cso_context.h"
-/**
- * This is very similar to vbo_all_varyings_in_vbos() but we are
- * only interested in per-vertex data. See bug 38626.
- */
-static GLboolean
-all_varyings_in_vbos(const struct gl_vertex_array *arrays[])
-{
- GLuint i;
-
- for (i = 0; i < VERT_ATTRIB_MAX; i++)
- if (arrays[i]->StrideB &&
- !arrays[i]->InstanceDivisor &&
- !_mesa_is_bufferobj(arrays[i]->BufferObj))
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
/**
* Set the restart index.
*/
{
struct st_context *st = st_context(ctx);
struct pipe_draw_info info;
- const struct gl_vertex_array **arrays = ctx->Array._DrawArrays;
unsigned i;
unsigned start = 0;
struct gl_buffer_object *bufobj = ib->obj;
/* Get index bounds for user buffers. */
- if (!index_bounds_valid)
- if (!all_varyings_in_vbos(arrays))
- vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index,
- nr_prims);
+ if (!index_bounds_valid && st->draw_needs_minmax_index) {
+ vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index,
+ nr_prims);
+ }
info.index_size = ib->index_size;
info.min_index = min_index;