Vulkan Renderer - closes #9385. When the vertex buffer size is exceeded, make sure to wait for outstanding work before resizing it. This fixes validation errors/crash found with using Imgui SDL3 renderer on Vulkan.

main
danginsburg 2024-04-01 09:19:58 -04:00 committed by Sam Lantinga
parent 3448273be1
commit 650ba8f3ec
1 changed files with 2 additions and 0 deletions

View File

@ -3146,6 +3146,8 @@ static SDL_bool VULKAN_UpdateVertexBuffer(SDL_Renderer *renderer,
} }
/* If the existing vertex buffer isn't big enough, we need to recreate a big enough one */ /* If the existing vertex buffer isn't big enough, we need to recreate a big enough one */
if (dataSizeInBytes > rendererData->vertexBuffers[vbidx].size) { if (dataSizeInBytes > rendererData->vertexBuffers[vbidx].size) {
VULKAN_IssueBatch(rendererData);
VULKAN_WaitForGPU(rendererData);
VULKAN_CreateVertexBuffer(rendererData, vbidx, dataSizeInBytes); VULKAN_CreateVertexBuffer(rendererData, vbidx, dataSizeInBytes);
} }