mesa/draw: drop the multi draw with indices fallback.
Gallium drivers don't need this. v2: drop some more code Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14261>
This commit is contained in:
parent
d17f45df1a
commit
87cc3ee964
|
@ -981,48 +981,40 @@ _mesa_draw_gallium_fallback(struct gl_context *ctx,
|
|||
ib.index_size_shift = util_logbase2(index_size);
|
||||
|
||||
/* Single draw or a fallback for user indices. */
|
||||
if (num_draws == 1 ||
|
||||
(info->index_size && info->has_user_indices &&
|
||||
!ctx->Const.MultiDrawWithUserIndices)) {
|
||||
for (unsigned i = 0; i < num_draws; i++) {
|
||||
if (!draws[i].count)
|
||||
continue;
|
||||
if (num_draws == 1) {
|
||||
if (!draws[0].count)
|
||||
return;
|
||||
|
||||
if (index_size) {
|
||||
ib.count = draws[i].count;
|
||||
if (index_size) {
|
||||
ib.count = draws[0].count;
|
||||
|
||||
if (info->has_user_indices) {
|
||||
ib.obj = NULL;
|
||||
/* User indices require start to be added here if
|
||||
* Const.MultiDrawWithUserIndices is false.
|
||||
*/
|
||||
ib.ptr = (const char*)info->index.user +
|
||||
draws[i].start * index_size;
|
||||
} else {
|
||||
ib.obj = info->index.gl_bo;
|
||||
ib.ptr = NULL;
|
||||
}
|
||||
if (info->has_user_indices) {
|
||||
ib.obj = NULL;
|
||||
ib.ptr = (const char*)info->index.user;
|
||||
} else {
|
||||
ib.obj = info->index.gl_bo;
|
||||
ib.ptr = NULL;
|
||||
}
|
||||
|
||||
struct _mesa_prim prim;
|
||||
prim.mode = info->mode;
|
||||
prim.begin = 1;
|
||||
prim.end = 1;
|
||||
prim.start = index_size && info->has_user_indices ? 0 : draws[i].start;
|
||||
prim.count = draws[i].count;
|
||||
prim.basevertex = index_size ? draws[i].index_bias : 0;
|
||||
prim.draw_id = drawid_offset + (info->increment_draw_id ? i : 0);
|
||||
|
||||
if (!index_size) {
|
||||
min_index = draws[i].start;
|
||||
max_index = draws[i].start + draws[i].count - 1;
|
||||
}
|
||||
|
||||
st_feedback_draw_vbo(ctx, &prim, 1, index_size ? &ib : NULL,
|
||||
index_bounds_valid, info->primitive_restart,
|
||||
info->restart_index, min_index, max_index,
|
||||
info->instance_count, info->start_instance);
|
||||
}
|
||||
|
||||
struct _mesa_prim prim;
|
||||
prim.mode = info->mode;
|
||||
prim.begin = 1;
|
||||
prim.end = 1;
|
||||
prim.start = draws[0].start;
|
||||
prim.count = draws[0].count;
|
||||
prim.basevertex = index_size ? draws[0].index_bias : 0;
|
||||
prim.draw_id = drawid_offset;
|
||||
|
||||
if (!index_size) {
|
||||
min_index = draws[0].start;
|
||||
max_index = draws[0].start + draws[0].count - 1;
|
||||
}
|
||||
|
||||
st_feedback_draw_vbo(ctx, &prim, 1, index_size ? &ib : NULL,
|
||||
index_bounds_valid, info->primitive_restart,
|
||||
info->restart_index, min_index, max_index,
|
||||
info->instance_count, info->start_instance);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -4295,9 +4295,6 @@ struct gl_constants
|
|||
/** 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;
|
||||
|
||||
/** Whether out-of-order draw (Begin/End) optimizations are allowed. */
|
||||
bool AllowDrawOutOfOrder;
|
||||
|
||||
|
|
|
@ -633,7 +633,6 @@ void st_init_limits(struct pipe_screen *screen,
|
|||
c->VertexBufferOffsetIsInt32 =
|
||||
screen->get_param(screen, PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET);
|
||||
|
||||
c->MultiDrawWithUserIndices = true;
|
||||
c->AllowDynamicVAOFastPath =
|
||||
screen->get_param(screen, PIPE_CAP_ALLOW_DYNAMIC_VAO_FASTPATH);
|
||||
|
||||
|
|
Loading…
Reference in New Issue