[vlc-devel] [PATCH] direct3d11: don't allocate NV12/P010 textures with odd sizes

Steve Lhomme robux4 at gmail.com
Wed Sep 28 08:26:31 CEST 2016


On Tue, Sep 27, 2016 at 11:25 PM,  <remi at remlab.net> wrote:
> Hello,
>
> Le 27 sept. 2016 08:37, Steve Lhomme <robux4 at videolabs.io> a écrit :
>>
>> fixes #17419
>> ---
>> modules/video_output/win32/direct3d11.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/modules/video_output/win32/direct3d11.c
>> b/modules/video_output/win32/direct3d11.c
>> index c6da0b5..16412db 100644
>> --- a/modules/video_output/win32/direct3d11.c
>> +++ b/modules/video_output/win32/direct3d11.c
>> @@ -1704,6 +1704,11 @@ static int AllocQuad(vout_display_t *vd, const
>> video_format_t *fmt, d3d_quad_t *
>>          if ( i_extra )
>>              texDesc.Height -= p_chroma_desc->p[plane].h.den /
>> p_chroma_desc->p[plane].h.num - i_extra;
>>      }
>> +    if (texDesc.Format == DXGI_FORMAT_NV12 || texDesc.Format ==
>> DXGI_FORMAT_P010)
>> +    {
>> +        texDesc.Width  &= ~1;
>> +        texDesc.Height &= ~1;
>> +    }
>
> Rounding down? What happens to the last row/column??

Yes, I think it's better than a green or distorted line. Also in most
cases that would result in that extra line at the bottom while the
sides are already black. It would feel like the screen area is not
filled properly.

>>      hr = ID3D11Device_CreateTexture2D(sys->d3ddevice, &texDesc, NULL,
>> &quad->pTexture);
>>      if (FAILED(hr)) {
>> --
>> 2.8.2
>>
>> _______________________________________________
>> 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