Fix issue with semaphore being reused to early
This commit is contained in:
@@ -43,6 +43,8 @@ namespace openVulkanoCpp
|
||||
vk::PresentModeKHR presentMode;
|
||||
vk::Viewport fullscreenViewport;
|
||||
vk::Rect2D fullscreenScissor;
|
||||
std::vector<vk::Semaphore> imageAvailableSemaphores;
|
||||
uint32_t currentSemaphoreId = 0;
|
||||
bool useVsync = false;
|
||||
|
||||
#ifdef __APPLE__
|
||||
@@ -54,7 +56,6 @@ namespace openVulkanoCpp
|
||||
|
||||
public:
|
||||
vk::SwapchainKHR swapChain;
|
||||
vk::Semaphore imageAvailableSemaphore;
|
||||
|
||||
SwapChain() = default;
|
||||
~SwapChain() override { if (device) SwapChain::Close(); }
|
||||
@@ -105,12 +106,14 @@ namespace openVulkanoCpp
|
||||
return images.size();
|
||||
}
|
||||
|
||||
vk::Semaphore& GetCurrentSemaphore() { return imageAvailableSemaphores[currentSemaphoreId]; }
|
||||
|
||||
private:
|
||||
void CreateSwapChain(vk::Extent2D size);
|
||||
|
||||
void CreateSwapChainImages();
|
||||
|
||||
void DestroySwapChain() const;
|
||||
void DestroySwapChain();
|
||||
|
||||
protected:
|
||||
vk::Format FindColorFormat() override
|
||||
|
||||
Reference in New Issue
Block a user