gallium/u_threaded: convert dividing by index_size to a bit shift
authorMarek Olšák <marek.olsak@amd.com>
Wed, 26 Feb 2020 20:10:47 +0000 (15:10 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Feb 2020 00:53:45 +0000 (00:53 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>

src/gallium/auxiliary/util/u_threaded_context.c

index c1f74e70e32c11bdadddc079d1f9cf10bf8f4d98..30790949336317260248c9abe399931392fff30b 100644 (file)
@@ -2110,7 +2110,7 @@ tc_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info)
       memcpy(&p->draw, info, sizeof(*info));
       p->draw.has_user_indices = false;
       p->draw.index.resource = buffer;
-      p->draw.start = offset / index_size;
+      p->draw.start = offset >> util_logbase2(index_size);
    } else {
       /* Non-indexed call or indexed with a real index buffer. */
       struct tc_full_draw_info *p = tc_add_draw_vbo(_pipe, indirect != NULL);