The simple_encode_d3d_async sample does
EncRequest.NumFrameSuggested = EncRequest.NumFrameSuggested + mfxEncParams.AsyncDepth;
to determine how many surfaces to create. But if you call QueryIOSurf with a larger AsyncDepth, it returns a larger NumFrameSuggested, suggesting it already accounts for AsyncDepth internally. In my testing, the original value of NumFrameSuggested is insufficient and makes my program run out of surfaces. Adding a single surface seems to fix this.
How many surfaces should I create?
Thanks so much for the suggesting and testing,
Our tutorial code was created a long time ago, so the API behavior might already be changed. We are in a process to update it and I will record this suggestion also validate it when we update.
So I think your suggestion should be correct for now.
I think not only documentation should be improved. It doesn't make sense to me that NumFrameSuggested varies between system memory and video memory. It could be a bug in the code.
Thanks so much,
We are developing new tutorial code and we will double check this during the development. Also please check our sample code for the correct usage since it is updated more frequently than the tutorial code.