From 1d40d53e03d33e0595016a95d645bd489ee95365 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 6 Jan 2022 15:58:17 +0200 Subject: [PATCH] anv: don't leave anv_batch fields undefined Because the extend_cb vfunc is not initialized, there is a risk that the emission code calls into a random pointer. Signed-off-by: Lionel Landwerlin Cc: mesa-stable Reviewed-by: Rohan Garg Part-of: --- src/intel/vulkan/genX_state.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/genX_state.c b/src/intel/vulkan/genX_state.c index 7177b9c136c..e2ec6ffc823 100644 --- a/src/intel/vulkan/genX_state.c +++ b/src/intel/vulkan/genX_state.c @@ -159,11 +159,12 @@ static VkResult init_render_queue_state(struct anv_queue *queue) { struct anv_device *device = queue->device; - struct anv_batch batch; - uint32_t cmds[64]; - batch.start = batch.next = cmds; - batch.end = (void *) cmds + sizeof(cmds); + struct anv_batch batch = { + .start = cmds, + .next = cmds, + .end = (void *) cmds + sizeof(cmds), + }; anv_batch_emit(&batch, GENX(PIPELINE_SELECT), ps) { #if GFX_VER >= 9