Encoding desktop duplication with NvEncoderD3D11 without having to copy?

Hi, i’m currently trying make an improvement of this sample for my project :

Since DXGI captures in a BGRA format and NvEnc can encode this format, i got rid of the color conversion.

But a thing is bothering me,


I was thinking why should we copy a texture we already have, so in order to optimize it, instead of doing
DXGI capture Texture → Copy into the texture that NvEnc will encode → Encode, why should I not do this :

So I did and called NvEncoder’s GetNextInputFrame() right before capture with DXGI, then immediatly encode it, but the video produced is completely black.

Is DXGI setting a TextureDesc incompatible with the encoding ?

Is there 0 way to get rid of the copy ?