mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 10:40:59 +00:00
Swap buffers in waitToRender() instead of renderFrame()
This commit is contained in:
@@ -593,6 +593,12 @@ bool PlVkRenderer::isSurfacePresentationSupportedByPhysicalDevice(VkPhysicalDevi
|
||||
|
||||
void PlVkRenderer::waitToRender()
|
||||
{
|
||||
// With libplacebo's Vulkan backend, all swap_buffers does is wait for queued
|
||||
// presents to finish. This happens to be exactly what we want to do here, since
|
||||
// it lets us wait to select a queued frame for rendering until we know that we
|
||||
// can present without blocking in renderFrame().
|
||||
pl_swapchain_swap_buffers(m_Swapchain);
|
||||
|
||||
// Handle the swapchain being resized
|
||||
int vkDrawableW, vkDrawableH;
|
||||
SDL_Vulkan_GetDrawableSize(m_Window, &vkDrawableW, &vkDrawableH);
|
||||
@@ -755,7 +761,6 @@ void PlVkRenderer::renderFrame(AVFrame *frame)
|
||||
SDL_PushEvent(&event);
|
||||
goto UnmapExit;
|
||||
}
|
||||
pl_swapchain_swap_buffers(m_Swapchain);
|
||||
|
||||
UnmapExit:
|
||||
// Delete any textures that need to be destroyed
|
||||
|
||||
Reference in New Issue
Block a user