This fixes a buffer corruption bug with glMultiDrawElementsEXT(): the
offset for the source index buffer is reset for each draw_multi slot,
copying only the first `dr` values to each slot's index buffer.
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18189>
return;
int total_offset = 0;
+ unsigned offset = 0;
while (num_draws) {
struct tc_batch *next = &tc->batch_slots[tc->next];
p->num_draws = dr;
/* Upload index buffers. */
- for (unsigned i = 0, offset = 0; i < dr; i++) {
+ for (unsigned i = 0; i < dr; i++) {
unsigned count = draws[i + total_offset].count;
if (!count) {