mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-01 15:26:09 +00:00
Fix excessive latency with Vulkan video decoding on Nvidia
For yet unknown reasons, high frame queue delay leads to massive decode latency.
This commit is contained in:
parent
1caee721e8
commit
f786e94c7b
@ -661,11 +661,16 @@ void PlVkRenderer::waitToRender()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef Q_OS_WIN32
|
||||||
// With libplacebo's Vulkan backend, all swap_buffers does is wait for queued
|
// 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
|
// 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
|
// it lets us wait to select a queued frame for rendering until we know that we
|
||||||
// can present without blocking in renderFrame().
|
// can present without blocking in renderFrame().
|
||||||
|
//
|
||||||
|
// NB: This seems to cause performance problems with the Windows display stack
|
||||||
|
// (particularly on Nvidia) so we will only do this for non-Windows platforms.
|
||||||
pl_swapchain_swap_buffers(m_Swapchain);
|
pl_swapchain_swap_buffers(m_Swapchain);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Handle the swapchain being resized
|
// Handle the swapchain being resized
|
||||||
int vkDrawableW, vkDrawableH;
|
int vkDrawableW, vkDrawableH;
|
||||||
@ -818,6 +823,12 @@ void PlVkRenderer::renderFrame(AVFrame *frame)
|
|||||||
goto UnmapExit;
|
goto UnmapExit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN32
|
||||||
|
// On Windows, we swap buffers here instead of waitToRender()
|
||||||
|
// to avoid some performance problems on Nvidia GPUs.
|
||||||
|
pl_swapchain_swap_buffers(m_Swapchain);
|
||||||
|
#endif
|
||||||
|
|
||||||
UnmapExit:
|
UnmapExit:
|
||||||
// Delete any textures that need to be destroyed
|
// Delete any textures that need to be destroyed
|
||||||
for (pl_tex texture : texturesToDestroy) {
|
for (pl_tex texture : texturesToDestroy) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user