From a3271b3f73d40dbbfa9e733498b7ded8810a6d17 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 14 Jul 2021 15:01:32 +1000 Subject: [PATCH] lvp: fixup multi draw memcpys This doesn't fix the tests but it fixes a bunch of valgrind uninitialised value warnings Fixes: f99f7c06e71d ("lavapipe: implement multidraw ext") Reviewed-By: Mike Blumenkrantz Reviewed-By: Joshua Ashton Part-of: --- src/gallium/frontends/lavapipe/lvp_cmd_buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c b/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c index c1e7fee..c62765c 100644 --- a/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c +++ b/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c @@ -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) -- 2.7.4