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,23 +981,16 @@ _mesa_draw_gallium_fallback(struct gl_context *ctx,
|
||||||
ib.index_size_shift = util_logbase2(index_size);
|
ib.index_size_shift = util_logbase2(index_size);
|
||||||
|
|
||||||
/* Single draw or a fallback for user indices. */
|
/* Single draw or a fallback for user indices. */
|
||||||
if (num_draws == 1 ||
|
if (num_draws == 1) {
|
||||||
(info->index_size && info->has_user_indices &&
|
if (!draws[0].count)
|
||||||
!ctx->Const.MultiDrawWithUserIndices)) {
|
return;
|
||||||
for (unsigned i = 0; i < num_draws; i++) {
|
|
||||||
if (!draws[i].count)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (index_size) {
|
if (index_size) {
|
||||||
ib.count = draws[i].count;
|
ib.count = draws[0].count;
|
||||||
|
|
||||||
if (info->has_user_indices) {
|
if (info->has_user_indices) {
|
||||||
ib.obj = NULL;
|
ib.obj = NULL;
|
||||||
/* User indices require start to be added here if
|
ib.ptr = (const char*)info->index.user;
|
||||||
* Const.MultiDrawWithUserIndices is false.
|
|
||||||
*/
|
|
||||||
ib.ptr = (const char*)info->index.user +
|
|
||||||
draws[i].start * index_size;
|
|
||||||
} else {
|
} else {
|
||||||
ib.obj = info->index.gl_bo;
|
ib.obj = info->index.gl_bo;
|
||||||
ib.ptr = NULL;
|
ib.ptr = NULL;
|
||||||
|
@ -1008,21 +1001,20 @@ _mesa_draw_gallium_fallback(struct gl_context *ctx,
|
||||||
prim.mode = info->mode;
|
prim.mode = info->mode;
|
||||||
prim.begin = 1;
|
prim.begin = 1;
|
||||||
prim.end = 1;
|
prim.end = 1;
|
||||||
prim.start = index_size && info->has_user_indices ? 0 : draws[i].start;
|
prim.start = draws[0].start;
|
||||||
prim.count = draws[i].count;
|
prim.count = draws[0].count;
|
||||||
prim.basevertex = index_size ? draws[i].index_bias : 0;
|
prim.basevertex = index_size ? draws[0].index_bias : 0;
|
||||||
prim.draw_id = drawid_offset + (info->increment_draw_id ? i : 0);
|
prim.draw_id = drawid_offset;
|
||||||
|
|
||||||
if (!index_size) {
|
if (!index_size) {
|
||||||
min_index = draws[i].start;
|
min_index = draws[0].start;
|
||||||
max_index = draws[i].start + draws[i].count - 1;
|
max_index = draws[0].start + draws[0].count - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
st_feedback_draw_vbo(ctx, &prim, 1, index_size ? &ib : NULL,
|
st_feedback_draw_vbo(ctx, &prim, 1, index_size ? &ib : NULL,
|
||||||
index_bounds_valid, info->primitive_restart,
|
index_bounds_valid, info->primitive_restart,
|
||||||
info->restart_index, min_index, max_index,
|
info->restart_index, min_index, max_index,
|
||||||
info->instance_count, info->start_instance);
|
info->instance_count, info->start_instance);
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4295,9 +4295,6 @@ struct gl_constants
|
||||||
/** Whether the vertex buffer offset is a signed 32-bit integer. */
|
/** Whether the vertex buffer offset is a signed 32-bit integer. */
|
||||||
bool VertexBufferOffsetIsInt32;
|
bool VertexBufferOffsetIsInt32;
|
||||||
|
|
||||||
/** Whether the driver can handle MultiDrawElements with non-VBO indices. */
|
|
||||||
bool MultiDrawWithUserIndices;
|
|
||||||
|
|
||||||
/** Whether out-of-order draw (Begin/End) optimizations are allowed. */
|
/** Whether out-of-order draw (Begin/End) optimizations are allowed. */
|
||||||
bool AllowDrawOutOfOrder;
|
bool AllowDrawOutOfOrder;
|
||||||
|
|
||||||
|
|
|
@ -633,7 +633,6 @@ void st_init_limits(struct pipe_screen *screen,
|
||||||
c->VertexBufferOffsetIsInt32 =
|
c->VertexBufferOffsetIsInt32 =
|
||||||
screen->get_param(screen, PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET);
|
screen->get_param(screen, PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET);
|
||||||
|
|
||||||
c->MultiDrawWithUserIndices = true;
|
|
||||||
c->AllowDynamicVAOFastPath =
|
c->AllowDynamicVAOFastPath =
|
||||||
screen->get_param(screen, PIPE_CAP_ALLOW_DYNAMIC_VAO_FASTPATH);
|
screen->get_param(screen, PIPE_CAP_ALLOW_DYNAMIC_VAO_FASTPATH);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue