Add opt-in for Vulkan rendering for SDR content with PREFER_VULKAN=1

This commit is contained in:
Cameron Gutman 2023-12-13 01:03:27 -06:00
parent aac5ad3fd0
commit 333d97160e

View file

@ -330,6 +330,21 @@ bool FFmpegVideoDecoder::createFrontendRenderer(PDECODER_PARAMETERS params, bool
delete m_FrontendRenderer;
m_FrontendRenderer = nullptr;
}
#endif
}
else
{
#ifdef HAVE_LIBPLACEBO_VULKAN
if (qgetenv("PREFER_VULKAN") == "1") {
if (m_BackendRenderer->getRendererType() != IFFmpegRenderer::RendererType::Vulkan) {
m_FrontendRenderer = new PlVkRenderer(m_BackendRenderer);
if (m_FrontendRenderer->initialize(params)) {
return true;
}
delete m_FrontendRenderer;
m_FrontendRenderer = nullptr;
}
}
#endif
}