lvp: fixup multi draw memcpys

This doesn't fix the tests but it fixes a bunch of valgrind
uninitialised value warnings

Fixes: f99f7c06e7 ("lavapipe: implement multidraw ext")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-By: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11870>
(cherry picked from commit a3271b3f73)
This commit is contained in:
Dave Airlie 2021-07-14 15:01:32 +10:00 committed by Dylan Baker
parent 0ca42c89e7
commit 7d2802b80c
2 changed files with 3 additions and 3 deletions

View file

@ -256,7 +256,7 @@
"description": "lvp: fixup multi draw memcpys",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "f99f7c06e71d6194d4206bde58a8acb5a42d90ed"
},

View file

@ -522,7 +522,7 @@ VKAPI_ATTR void VKAPI_CALL lvp_CmdDrawMultiEXT(
else {
unsigned i = 0;
vk_foreach_multi_draw(draw, i, pVertexInfo, drawCount, stride)
memcpy(cmd->u.draw.draws, draw, sizeof(struct pipe_draw_start_count_bias));
memcpy(&cmd->u.draw.draws[i], draw, sizeof(struct VkMultiDrawInfoEXT));
}
cmd_buf_queue(cmd_buffer, cmd);
@ -808,7 +808,7 @@ VKAPI_ATTR void VKAPI_CALL lvp_CmdDrawMultiIndexedEXT(
else {
unsigned i = 0;
vk_foreach_multi_draw_indexed(draw, i, pIndexInfo, drawCount, stride)
memcpy(cmd->u.draw_indexed.draws, draw, sizeof(struct pipe_draw_start_count_bias));
memcpy(&cmd->u.draw_indexed.draws[i], draw, sizeof(struct pipe_draw_start_count_bias));
}
/* only the first member is read if vertex_offset_changes is true */
if (pVertexOffset)