From 124d2762db492dc3e347591553214658c63c3e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 11 Dec 2022 18:51:11 -0500 Subject: [PATCH] st/mesa: simplify prepare_indexed_draw Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mesa/state_tracker/st_draw.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 0728d497986..3da818d0ac7 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -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; }