d3d12: AV1 encode - Add lower resolution fallback check for uniform tile support

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
This commit is contained in:
Sil Vilerino 2023-09-18 19:31:51 -04:00 committed by Marge Bot
parent 1c1b890be3
commit c0e0c82979

View file

@ -370,6 +370,18 @@ d3d12_video_encode_supported_tile_structures(const D3D12_VIDEO_ENCODER_CODEC &co
sizeof(capDataTilesSupport));
}
// Try with lower resolution as fallback
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC fallbackRes = { 1920u, 1080u };
if(SUCCEEDED(hr) && !capDataTilesSupport.IsSupported && (fallbackRes.Width <= maxRes.Width)
&& (fallbackRes.Height <= maxRes.Height) ) {
auto oldRes = capDataTilesSupport.FrameResolution;
capDataTilesSupport.FrameResolution = fallbackRes;
hr = pD3D12VideoDevice->CheckFeatureSupport(D3D12_FEATURE_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG,
&capDataTilesSupport,
sizeof(capDataTilesSupport));
capDataTilesSupport.FrameResolution = oldRes;
}
if(SUCCEEDED(hr) && capDataTilesSupport.IsSupported)
supportedSliceStructures |= (PIPE_VIDEO_CAP_SLICE_STRUCTURE_POWER_OF_TWO_ROWS |
PIPE_VIDEO_CAP_SLICE_STRUCTURE_EQUAL_ROWS |