Fix swapchain out of bounds (#3486)

This commit is contained in:
Adrian Cojocaru
2025-05-19 14:12:28 +03:00
committed by GitHub
parent 8e3899df39
commit fece07e303

View File

@@ -160,8 +160,8 @@ void SurfaceRenderableResource::initSwapchain(uint32_t w, uint32_t h) {
colorFormat = swapchainCreateInfo.imageFormat;
extent = swapchainCreateInfo.imageExtent;
swapchainSemaphores.reserve(swapchainImageCount);
for (uint32_t index = 0; index < swapchainImageCount; ++index) {
swapchainSemaphores.reserve(swapchainImages.size());
for (uint32_t index = 0; index < swapchainImages.size(); ++index) {
swapchainSemaphores.emplace_back(device->createSemaphoreUnique({}));
backend.setDebugName(swapchainSemaphores.back().get(), "SurfaceSemaphore_" + std::to_string(index));
}