mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Vulkan: Set a flag to resize the swap chain when presenting fails
Drivers can return VK_ERROR_OUT_OF_DATE_KHR from vkQueuePresentKHR, and we should resize the image in this case, as well as when getting it back from vkAcquireNextImageKHR.
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "Common/BlockingLoop.h"
|
||||
#include "Common/Flag.h"
|
||||
#include "Common/Semaphore.h"
|
||||
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
@ -78,6 +79,8 @@ public:
|
||||
|
||||
void ExecuteCommandBuffer(bool submit_off_thread, bool wait_for_completion);
|
||||
|
||||
// Was the last present submitted to the queue a failure? If so, we must recreate our swapchain.
|
||||
bool DidLastPresentFail() { return m_present_failed_flag.TestAndClear(); }
|
||||
// Schedule a vulkan resource for destruction later on. This will occur when the command buffer
|
||||
// is next re-used, and the GPU has finished working with the specified resource.
|
||||
void DeferBufferDestruction(VkBuffer object);
|
||||
@ -144,6 +147,7 @@ private:
|
||||
};
|
||||
std::deque<PendingCommandBufferSubmit> m_pending_submits;
|
||||
std::mutex m_pending_submit_lock;
|
||||
Common::Flag m_present_failed_flag;
|
||||
bool m_use_threaded_submission = false;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user