}
}
- /* If the index buffer isn't in a VBO, then treating the application's
- * subranges of the index buffer as one large index buffer may lead to
- * us reading unmapped memory.
- */
- if (!_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj))
- fallback = GL_TRUE;
+ if (ctx->Const.MultiDrawWithUserIndices) {
+ /* Check whether prim[i].start would overflow. */
+ if (((max_index_ptr - min_index_ptr) >> ib.index_size_shift) > UINT_MAX)
+ fallback = GL_TRUE;
+ } else {
+ /* If the index buffer isn't in a VBO, then treating the application's
+ * subranges of the index buffer as one large index buffer may lead to
+ * us reading unmapped memory.
+ */
+ if (!_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj))
+ fallback = GL_TRUE;
+ }
if (!fallback) {
struct _mesa_prim *prim;
/** Whether the vertex buffer offset is a signed 32-bit integer. */
bool VertexBufferOffsetIsInt32;
+ /** Whether the driver can handle MultiDrawElements with non-VBO indices. */
+ bool MultiDrawWithUserIndices;
+
/** GL_ARB_gl_spirv */
struct spirv_supported_capabilities SpirVCapabilities;
c->VertexBufferOffsetIsInt32 =
screen->get_param(screen, PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET);
+
+ c->MultiDrawWithUserIndices =
+ screen->get_param(screen, PIPE_CAP_DRAW_INFO_START_WITH_USER_INDICES);
}