[vlc-commits] qt: don't use SHARED_NTHANDLE on platforms that don't support it
Pierre Lamot
git at videolan.org
Thu Aug 20 10:20:53 CEST 2020
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Jun 11 17:54:43 2020 +0200| [2f376305e8e989364a9e001ab3c5858e565e57d5] | committer: Pierre Lamot
qt: don't use SHARED_NTHANDLE on platforms that don't support it
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2f376305e8e989364a9e001ab3c5858e565e57d5
---
modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp b/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
index 68bc8662e9..fcf567efa5 100644
--- a/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
+++ b/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
@@ -430,6 +430,10 @@ bool CompositorDCompositionUISurface::updateSharedTexture(int width, int height)
try
{
releaseSharedTexture();
+
+ D3D11_FEATURE_DATA_D3D11_OPTIONS d3d11Options;
+ HRESULT checkFeatureHR = m_d3dDevice->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS, &d3d11Options, sizeof(d3d11Options));
+
/* interim texture */
D3D11_TEXTURE2D_DESC texDesc = { };
texDesc.MipLevels = 1;
@@ -442,7 +446,10 @@ bool CompositorDCompositionUISurface::updateSharedTexture(int width, int height)
texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
texDesc.Height = height;
texDesc.Width = width;
- texDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED | D3D11_RESOURCE_MISC_SHARED_NTHANDLE;
+ if (SUCCEEDED(checkFeatureHR) && d3d11Options.ExtendedResourceSharing) //D3D11.1 feature
+ texDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED | D3D11_RESOURCE_MISC_SHARED_NTHANDLE;
+ else
+ texDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED;
HR(m_d3dDevice->CreateTexture2D( &texDesc, NULL, &m_d3dInterimTexture ), "create texture");
More information about the vlc-commits
mailing list