Mesa's Virgl Preparing To Transition To Using NIR Over TGSI
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.
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.
5 Comments