1
0
mirror of https://github.com/microsoft/DirectXTex synced 2025-01-14 11:30:18 +00:00

ScreenGrab: Fixed computing for NV11 which requires width multiple of 4, but height can be odd

This commit is contained in:
walbourn_cp 2014-02-14 12:56:11 -08:00
parent 9b334ab768
commit b67a8ef792

View File

@ -507,9 +507,9 @@ static void GetSurfaceInfo( _In_ size_t width,
} }
else if ( fmt == DXGI_FORMAT_NV11 ) else if ( fmt == DXGI_FORMAT_NV11 )
{ {
rowBytes = ( ( width + 1 ) >> 1 ) * 2; rowBytes = ( ( width + 3 ) >> 2 ) * 4;
numBytes = rowBytes * ( ( height + 1 ) >> 1 ) * 4;
numRows = height * 2; // Direct3D makes this simplifying assumption, although it is larger than the 4:1:1 data numRows = height * 2; // Direct3D makes this simplifying assumption, although it is larger than the 4:1:1 data
numBytes = rowBytes * numRows;
} }
else if (planar) else if (planar)
{ {