How to display raw ID3D11Texture2D using Direct3D 11?

i use ffmpeg and Direct3D 11 for decoding task and the frame i get is in type of ID3D11Texture2D and i want to display it directly without making CPU overhead so i decided to use DirectX API itself for displaying it but i dont know how to do

The standard approach is to render a "quad" - two triangles in a rectangle shape - with the texture bound over the whole output surface, though you could probably use more modern approaches to directly copy the buffer nowadays. Either way, this requires a lot of machinery: creating a device adapter, context, surface, swap chain, and for a quad vertex buffers, vertex and pixel shaders (all with the simplest "pass-through" versions though).

If you want to go that path, D3D docs have a bunch of "how-to's" to get you off the ground - you need only a few of them but it's still pretty arduous.

There's a few examples of using direct3d 12 raw in Rust, which should be able to use that texture too, but that's a lot more complicated an API, so beware.

You could also try a higher level graphics crate like WGPU and import the texture, but it's fundamentally the same ideas and resources, plus the fiddly code to get the resource imported.