st/mesa: simplify prepare_indexed_draw

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
This commit is contained in:
Marek Olšák 2022-12-11 18:51:11 -05:00
parent 8bcdcc8b23
commit 124d2762db

View file

@ -117,16 +117,14 @@ prepare_indexed_draw(/* pass both st and ctx to reduce dereferences */
const struct pipe_draw_start_count_bias *draws,
unsigned num_draws)
{
if (info->index_size) {
/* Get index bounds for user buffers. */
if (!info->index_bounds_valid &&
st->draw_needs_minmax_index) {
/* Return if this fails, which means all draws have count == 0. */
if (!vbo_get_minmax_indices_gallium(ctx, info, draws, num_draws))
return false;
/* Get index bounds for user buffers. */
if (info->index_size && !info->index_bounds_valid &&
st->draw_needs_minmax_index) {
/* Return if this fails, which means all draws have count == 0. */
if (!vbo_get_minmax_indices_gallium(ctx, info, draws, num_draws))
return false;
info->index_bounds_valid = true;
}
info->index_bounds_valid = true;
}
return true;
}