diff options
author | Marek Olšák <marek.olsak@amd.com> | 2022-12-11 18:51:11 -0500 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2022-12-18 14:35:59 -0500 |
commit | 124d2762db492dc3e347591553214658c63c3e41 (patch) | |
tree | 754844b154d7c07a396fe5c7ec6b3c95e5bb5383 /src/mesa | |
parent | 8bcdcc8b237d487c632147bb63ace3d6b7234617 (diff) |
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>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 18 |
1 files changed, 8 insertions, 10 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; - - info->index_bounds_valid = true; - } + /* 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; } return true; } |