Mesa's Virgl Preparing To Transition To Using NIR Over TGSI

Written by Michael Larabel in Virtualization on 20 February 2022 at 07:00 AM EST. 5 Comments
VIRTUALIZATION
Mesa's Virgl code as part of the Virgil 3D GPU project allows for OpenGL/3D acceleration within QEMU virtual machines with the driver calls then being passed onto the host GPU. Mesa's Virgl code to this stage has relied upon the Gallium3D TGSI intermediate representation while they are working on moving it to the modern and superior NIR.

This past week saw the old open-source NVIDIA NV30/NV40 driver code switch over to NIR instead of TGSI. That followed Radeon R300g switching to NIR at the end of last year. It's part of the trend of moving more of the older and smaller Mesa drivers onto NIR by using the NIR-to-TGSI code-path for ultimately getting back to TGSI for consumption by the drivers (for now to at least avoid rewriting their driver shader compiler back-ends) but in more optimized form. Using NIR allows for sharing more optimizations between drivers and the NIR generation is generally superior to that of TGSI, so it's an efficiency win for the drivers as well as consolidating more drivers onto the NIR-using code path for easier code maintenance moving forward. Mesa's Virgl is working to jump on this bandwagon.

Emma Anholt has been working on much of this NIR-to-TGSI adoption by the smaller/older drivers. This week she opened up a merge request, which has already landed in Mesa 22.1-devel, for getting more of the Virgl code ready for supporting the NIR-to-TGSI route.

That prep work includes changes to Virgl as well as a few to nir_to_tgsi for preparing the code for Virgl going with NIR-to-TGSI in a future commit.
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