mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-15 15:58:13 +00:00
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.
This commit is contained in:

committed by
Sam Lantinga

parent
3448273be1
commit
650ba8f3ec
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user