Move vkAcquireNextImageKHR() into waitToRender() so it can overlap with new frame arrival

This commit is contained in:
Cameron Gutman committed 2023-12-17 16:47:38 -06:00
1 parent 708bec2937
commit 058739321c
2 files changed
+52 -13

No files matched your search

@@ -14,6 +14,8 @@ public:
virtual bool prepareDecoderContext(AVCodecContext* context, AVDictionary** options) override;
virtual void renderFrame(AVFrame* frame) override;
virtual bool testRenderFrame(AVFrame* frame) override;
virtual void waitToRender() override;
virtual void cleanupRenderContext() override;
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
virtual int getRendererAttributes() override;
virtual int getDecoderCapabilities() override;
@@ -49,6 +51,10 @@ private:
pl_tex m_Textures[PL_MAX_PLANES] = {};
pl_color_space m_LastColorspace = {};
// Pending swapchain state shared between waitToRender(), renderFrame(), and cleanupRenderContext()
pl_swapchain_frame m_SwapchainFrame = {};
bool m_HasPendingSwapchainFrame = false;
// Overlay state
SDL_SpinLock m_OverlayLock = 0;
struct {