panfrost: don't use index_bias if not indexed
authorMarek Olšák <marek.olsak@amd.com>
Sun, 22 Nov 2020 03:21:26 +0000 (22:21 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 5 Jan 2021 00:22:33 +0000 (19:22 -0500)
index_bias is undefined if index_size == 0.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>

src/gallium/drivers/panfrost/pan_context.c

index 66523bc..61838df 100644 (file)
@@ -518,7 +518,7 @@ panfrost_draw_vbo(
         panfrost_batch_set_requirements(batch);
 
         /* Take into account a negative bias */
-        ctx->vertex_count = draws[0].count + abs(info->index_bias);
+        ctx->vertex_count = draws[0].count + (info->index_size ? abs(info->index_bias) : 0);
         ctx->instance_count = info->instance_count;
         ctx->active_prim = info->mode;