Copying nvdecoder output to DXGI surface

Hello,

I’d like to use the capability of Direct2D to draw a NV12 DXGI-backed image directly.

How to copy the output from NVDEC (through cuvidMapVideoFrame) to a DXGI surface ?

Obviously, cuGraphicsD3D11RegisterResource does not work. Is there an alternative interop mapping function for DXGI resource? (for use with cuMemcpy2D.)

Thanks,
Pascal

I found the way: Create a NV12 Direct3D 11 texture. Query texture for IDXGISurface. Create a Direct2D image source with ID2DDeviceContext2::CreateImageSourceFromDxgi. Register the D3D11 texture with CUDA. Copy the decoder output to the Direct3D texture with cuMemcpy2DAsync (3-planes, see sample from NVDEC sdk.)

1 Like

Nice! Thank you for sharing!

And a very warm welcome to the NVIDIA developer forums @pascal.binggeli!

Could you show the code that copy multi plane data to a ID3D11 texture? I have the problem that same as this page.

Hi @zgzf1001, welcome to the NVIDIA developer forums!

It might be that @pascal.binggeli does not follow this topic any longer. But tagging him could help, let’s see.