Microsoft Lands VA-API To Direct3D 12 H.264 Video Encode/Decode In Mesa

Written by Michael Larabel in Microsoft on 17 May 2022 at 08:32 PM EDT. 24 Comments
MICROSOFT
Microsoft has made a lot of interesting developments and maneuvers over the past number of months for leveraging open-source Mesa for use by Windows Subsystem for Linux (WSL) and supporting various Khronos APIs atop Direct3D 12 for use when native drivers are lacking on Windows. This work so far has been focused on OpenGL, OpenCL, and Vulkan but Microsoft has now even implemented Direct3D 12 video API support within Mesa and leverages the VA-API state tracker support within Mesa.

Simply put, this latest effort allows WSL GUI applications like media players to enjoy hardware video acceleration. Within the code merged to mainline for Mesa 22.2, D3D12 video APIs have been implemented and relevant VA-API entry points for H.264 encode/decode. Thus Linux video players / multimedia software supporting the Video Acceleration API (VA-API) will "magically" be able to enjoy Direct3D 12 video acceleration when running within WSL(2).

This is quite a win for those wanting more robust GUI software support within the Windows Subsystem for Linux confines and further cements VA-API as the dominant Linux video API. While there is an experimental, independent VA-API implementation over NVIDIA's NVDEC, VA-API doesn't have support across the board for all GPUs/drivers, so this support atop Direct3D 12 video technically makes it more robust on Windows than Linux itself. Granted, at least for the moment it's limited to the H.264 codec but this current code is designed to be extensible to support more video codecs moving forward.

Microsoft engineers worked on this D3D12 video support and Gallium3D video acceleration front-end changes themselves and successfully tested VA-API usage with FFmpeg encode/decode/transcode and with the MPlayer-forked MPV and vaah264 under WSL with X11 windowing support enabled. It's also possible they may support NVIDIA Video Decode and Presentation API for Unix (VDPAU) as another supported implementation atop D3D12 video with some Gallium3D VDPAU changes also staged as part of this merge, but the initial focus appears to be on the VA-API interface.


This effort has been ongoing for a number of months with back in November I wrote about Microsoft eyeing Direct3D 12 video acceleration for Mesa. Now the initial working code is finally ready and mainlined.

More technical details for those interested via this merge request that a short time ago landed in Mesa 22.2. This is beneficial for WSL as outlined but for native, bare metal Linux users this 11.3k lines of new code in Mesa will likely be of little use.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week