[vlc-devel] [PATCH 03/16] qt: don't use SHARED_NTHANDLE on platforms that don't support it

Pierre Lamot pierre at videolabs.io
Thu Aug 6 16:48:01 CEST 2020


On 2020-08-06 16:24, Steve Lhomme wrote:
> On 2020-08-06 9:43, Pierre Lamot wrote:
>> ---
>>   .../maininterface/compositor_dcomp_uisurface.cpp | 16 
>> ++++++++++++++--
>>   1 file changed, 14 insertions(+), 2 deletions(-)
>> 
>> diff --git 
>> a/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp 
>> b/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
>> index 68bc8662e9..6ff742c59d 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;
>> @@ -439,10 +443,18 @@ bool 
>> CompositorDCompositionUISurface::updateSharedTexture(int width, int 
>> height)
>>           texDesc.Usage = D3D11_USAGE_DEFAULT;
>>           texDesc.CPUAccessFlags = 0;
>>           texDesc.ArraySize = 1;
>> -        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.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
>> +            texDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED | 
>> D3D11_RESOURCE_MISC_SHARED_NTHANDLE;
>> +        }
>> +        else
>> +        {
>> +            texDesc.Format = DXGI_FORMAT_R8G8B8A8_UINT;
> 
> Why is the format different here ?

After re-reading the doc, it looks like I miss interpreted it (D3D11.1 
warranties that DXGI_FORMAT_R8G8B8A8_UNORM will work doesn't means that 
the format should not be used in 11.0). Thanks for pointing that out.

>> +            texDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED;
>> +        }
>>             HR(m_d3dDevice->CreateTexture2D( &texDesc, NULL, 
>> &m_d3dInterimTexture ), "create texture");
>>   -- 2.25.1
>> 
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list