mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-09 09:48:43 +00:00
Swap buffers in waitToRender() instead of renderFrame()
This commit is contained in:
parent
9ed8252cc6
commit
bb8e229814
1 changed files with 6 additions and 1 deletions
|
@ -593,6 +593,12 @@ bool PlVkRenderer::isSurfacePresentationSupportedByPhysicalDevice(VkPhysicalDevi
|
||||||
|
|
||||||
void PlVkRenderer::waitToRender()
|
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
|
// Handle the swapchain being resized
|
||||||
int vkDrawableW, vkDrawableH;
|
int vkDrawableW, vkDrawableH;
|
||||||
SDL_Vulkan_GetDrawableSize(m_Window, &vkDrawableW, &vkDrawableH);
|
SDL_Vulkan_GetDrawableSize(m_Window, &vkDrawableW, &vkDrawableH);
|
||||||
|
@ -755,7 +761,6 @@ void PlVkRenderer::renderFrame(AVFrame *frame)
|
||||||
SDL_PushEvent(&event);
|
SDL_PushEvent(&event);
|
||||||
goto UnmapExit;
|
goto UnmapExit;
|
||||||
}
|
}
|
||||||
pl_swapchain_swap_buffers(m_Swapchain);
|
|
||||||
|
|
||||||
UnmapExit:
|
UnmapExit:
|
||||||
// Delete any textures that need to be destroyed
|
// Delete any textures that need to be destroyed
|
||||||
|
|
Loading…
Reference in a new issue