diff --git a/src/mbgl/vulkan/renderable_resource.cpp b/src/mbgl/vulkan/renderable_resource.cpp index eb46f5deb..5174c6415 100644 --- a/src/mbgl/vulkan/renderable_resource.cpp +++ b/src/mbgl/vulkan/renderable_resource.cpp @@ -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)); }