draw: fix base vertex bug

Move the assignment of draw->start_index into the num_draws loop
in draw_pt_arrays() so that it's updated for each primitive we're
drawing.  Previously, it was only set once to the 0th primitive's
start index.

This fixes incorrect gl_BaseVertex values when using
vkCmdDrawMultiEXT() with more than one VkMultiDrawInfoEXT item.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19039>
This commit is contained in:
Brian Paul 2022-10-11 11:51:57 -06:00 committed by Marge Bot
parent 4314949277
commit 0c87909bcf

View file

@ -154,6 +154,8 @@ draw_pt_arrays(struct draw_context *draw,
draw->pt.user.eltBias = 0;
}
draw->start_index = draw_info[i].start;
if (count >= first)
frontend->run(frontend, draw_info[i].start, count);
@ -603,7 +605,6 @@ draw_vbo(struct draw_context *draw,
}
draw->pt.max_index = index_limit - 1;
draw->start_index = use_draws[0].start;
/*
* TODO: We could use draw->pt.max_index to further narrow