[vlc-commits] qt: fallback when d3dcompiler is missing when using DComp
Pierre Lamot
git at videolan.org
Thu Aug 20 10:20:55 CEST 2020
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Jun 18 16:36:36 2020 +0200| [e2b3bd965ae099f198c33b5ca7ebfa8cf7b8db79] | committer: Pierre Lamot
qt: fallback when d3dcompiler is missing when using DComp
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e2b3bd965ae099f198c33b5ca7ebfa8cf7b8db79
---
.../gui/qt/maininterface/compositor_dcomp_uisurface.cpp | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp b/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
index fcf567efa5..599d4b2fc3 100644
--- a/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
+++ b/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
@@ -114,12 +114,12 @@ public:
compile = nullptr;
}
- int init(vlc_object_t *obj)
+ bool init(vlc_object_t *obj)
{
m_compiler_dll = Direct3D11LoadShaderLibrary();
if (!m_compiler_dll) {
msg_Err(obj, "cannot load d3dcompiler.dll, aborting");
- return VLC_EGENERIC;
+ return false;
}
compile = (pD3DCompile)GetProcAddress(m_compiler_dll, "D3DCompile");
@@ -127,9 +127,9 @@ public:
msg_Err(obj, "Cannot locate reference to D3DCompile in d3dcompiler DLL");
FreeLibrary(m_compiler_dll);
m_compiler_dll = nullptr;
- return VLC_EGENERIC;
+ return false;
}
- return VLC_SUCCESS;
+ return true;
}
pD3DCompile compile = nullptr;
@@ -200,7 +200,11 @@ bool CompositorDCompositionUISurface::init()
m_uiWindow->setClearBeforeRendering(false);
m_d3dCompiler = std::make_shared<OurD3DCompiler>();
- m_d3dCompiler->init(VLC_OBJECT(m_intf));
+ ret = m_d3dCompiler->init(VLC_OBJECT(m_intf));
+ if (!ret) {
+ msg_Err(m_intf, "failed to initialize D3D compiler");
+ return false;
+ }
qreal dpr = m_rootWindow->devicePixelRatio();
ret = initialiseD3DSwapchain(dpr * m_rootWindow->width(), dpr * m_rootWindow->height());
More information about the vlc-commits
mailing list