Fix render worker reuse and stabilize out-of-process video rendering

This commit is contained in:
2026-07-13 10:19:30 +08:00
parent 30e7153154
commit f6211f97a5
28 changed files with 1918 additions and 386 deletions
+11 -1
View File
@@ -97,7 +97,12 @@ bool DynamicRenderer::Load()
return false;
}
handle_ = create_(this->parent());
// Pass this (rather than this->parent()) so the backend renderer becomes a
// child QObject of the adapter. That ensures it follows DynamicRenderer when
// the latter is moved to the render thread; otherwise it stays in the thread
// where Load() was called and every GL operation is rejected as "wrong
// thread", producing a black screen.
handle_ = create_(this);
if (!handle_) {
library_.unload();
return false;
@@ -319,6 +324,11 @@ bool DynamicRenderer::IsOpenGL() const
return backend_ == QStringLiteral("opengl");
}
bool DynamicRenderer::IsVulkan() const
{
return backend_ == QStringLiteral("vulkan");
}
// Dispatches a shader blit to the loaded backend.
void DynamicRenderer::Blit(QVariant shader, AcceleratedJob &job,
Texture *destination, VideoParams destination_params,