nvk: Re-initialize dynamic_graphics_state.vi when recycling
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 31 Jan 2023 02:11:54 +0000 (20:11 -0600)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:31:57 +0000 (21:31 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/vulkan/nvk_cmd_buffer.c

index 8d55f68..c43013f 100644 (file)
@@ -279,6 +279,10 @@ nvk_AllocateCommandBuffers(VkDevice _device,
          if (init_result != VK_SUCCESS)
             result = init_result;
 
+         /* Re-initializing the command buffer resets this pointer */
+         cmd_buffer->vk.dynamic_graphics_state.vi =
+            &cmd_buffer->state.gfx._dynamic_vi;
+
          pCommandBuffers[i] = nvk_cmd_buffer_to_handle(cmd_buffer);
       } else {
          result = nvk_create_cmd_buffer(device, pool, pAllocateInfo->level, &pCommandBuffers[i]);