I’m adding support for hardware accelerated decoding through D3D11 for the new HEVC profiles added in recent drivers, supporting 4:4:4 (and 4:2:2) in my application.
I’m using shaders to process the decoded video, and as such I’m creating a SRV (Shader Resource View) of the video surfaces, as instructed in the D3D11 documentation as DXGI_FORMAT_R8G8B8A8_UNORM for AYUV, DXGI_FORMAT_R10G10B10A2_UNORM for Y410 and DXGI_FORMAT_R16G16B16A16_UNORM for Y416.
Unfortunately, the resulting image shows various levels of corruption. For AYUV some minor corruption can be observed, while for Y410/Y416 the image looks as its tiled wrong, and the mapping does not apply untiling operations.
Here is an example of how a Y410 image looks:
The same process works for NV12/P010/P016 for 4:2:0 video (with different SRV types, of course). I am unable to test 4:2:2 video formats, due to the required hardware support.
For clarity, the process is as follows:
D3D11 Decode → Create SRV of the video texture → render using shaders to the display
I have tried copying the image from the decoder first, and creating an SRV on that, with no difference. Copying onto a CPU-mappable texture and downloading to system memory first does however produce a correct image.
I have been developing and testing on a 4090 with the most recent drivers, 576.80 GRD as of writing.