From e92a4f817d1f7a5094066e2a47a246fd5ccf94d6 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 13 Feb 2020 15:29:22 -0500 Subject: mesa: replace some index_size multiplications and divisions with shifts Acked-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Ian Romanick Part-of: --- src/mesa/vbo/vbo_minmax_index.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/vbo') diff --git a/src/mesa/vbo/vbo_minmax_index.c b/src/mesa/vbo/vbo_minmax_index.c index d1298dcdc3a..8cb5f3c0aeb 100644 --- a/src/mesa/vbo/vbo_minmax_index.c +++ b/src/mesa/vbo/vbo_minmax_index.c @@ -247,9 +247,9 @@ vbo_get_minmax_index(struct gl_context *ctx, GLuint i; GLintptr offset = 0; - indices = (char *) ib->ptr + prim->start * ib->index_size; + indices = (char *) ib->ptr + (prim->start << ib->index_size_shift); if (_mesa_is_bufferobj(ib->obj)) { - GLsizeiptr size = MIN2(count * ib->index_size, ib->obj->Size); + GLsizeiptr size = MIN2(count << ib->index_size_shift, ib->obj->Size); if (vbo_get_minmax_cached(ib->obj, ib->index_size, (GLintptr) indices, count, min_index, max_index)) -- cgit v1.2.3