mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 08:20:12 +01:00
mediafoundation: Allocate pro-rated buffer sizes for multi-slice encoding
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37982>
This commit is contained in:
parent
b454c35318
commit
4f7aa40222
1 changed files with 5 additions and 1 deletions
|
|
@ -560,7 +560,11 @@ CDX12EncHMFT::PrepareForEncode( IMFSample *pSample, LPDX12EncodeContext *ppDX12E
|
|||
if( m_EncoderCapabilities.m_HWSupportSlicedFences.bits.multiple_buffers_required )
|
||||
{
|
||||
// Buffer byte size for sliced buffers + notifications with multiple individual buffers per slice
|
||||
templ.width0 = m_uiMaxOutputBitstreamSize;
|
||||
// Try a rough estimation of per slice bitstream size as: frame_size / num slices
|
||||
// Be careful with the allocation size of slice buffers, when the number of slices is high
|
||||
// and we run in LowLatency = 0, we can start thrashing when trying to MakeResident lots
|
||||
// of big allocations in short amounts of time (num slices x num in flight frames)
|
||||
templ.width0 = (m_uiMaxOutputBitstreamSize / num_output_buffers);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue