24 Years After The ATI R300 Launched, Open-Source R300 Driver Continues With Big Rework
([Radeon] 4 Hours Ago
R300 Gallium3D)
- Reference: 0001636390
- News link: https://www.phoronix.com/news/R300-Gallium3D-No-TGSI-Part-1
- Source link:
While there has been [1]talk of potentially branching off the older Mesa graphics drivers , the ATI R300 Gallium3D driver just won't die yet. The R300 Gallium3D driver for supporting ATI R300 through R500 graphics cards saw a big rework merged today in restructuring the driver's intemediate representation (IR) handling.
Independent open-source contributor Pavel Ondračka continues working on the R300g driver and he's been pursuing a big undertaking to get rid of TGSI usage and replace it with NIR. TGSI is the original Gallium3D intermediate representation started by Tungsten Graphics back in the day but all of the modern Mesa drivers have since transitioned to using the better NIR intermediate representation. Pavel is working on the big task of adapting R300g to use NIR directly without the sidestep through TGSI.
This undertaking was originally reported on Phoronix [2]earlier this month but the exciting milestone today is that the initial merge has landed for Mesa 26.2. Pavel explained in the [3]part one merge request :
"Here goes the first part of removing TGSI from r300 doing the heavy lifting for everything except for the draw swtcl paths. Lots of this have been sitting in a branch for over a year, waiting for a final push by Mike's yearly drop-the-old-stuff rant. This MR is not technically introducing a NIR-based backend, that actually sort of happened some time ago already with !23437 (merged). At that time I was looking to move a lot of lowering from the backend to NIR and while custom finalize_nir offered some options, the fixed pass order in ntt had a lot of limitations. I tried few more approaches but in the end just mostly copied ntt to the r300, removed some unneeded parts and than over time heavily tweaked the NIR passes and added new HW-specific ones. However, the final translation still was NIR->TGSI->RC. So in general most of this series is just boring removal of technical debt which I was not skilled/motivated enough to do initially. The backend IR (before pair translation) is mostly 1:1 match for TGSI anyway with just some extra hw specific stuff, like constant swizzles, per-channel negate, etc. so while this is a quite a large diff, its mostly kind of boring replacement of TGSI ureg_* parts with corresponding pieces from the backend. Codex was used for most of the later search-and-replace-like patches."
Fun seeing ChatGPT's Codex helping out in working on these patches for more than two decade old GPUs.
The journey of this TGSI gutting for R300g isn't yet over but great seeing it continue closer to the finish line. Pavel's ongoing work can be found via the [4]r300_no_tgsi Git branch .
[1] https://www.phoronix.com/news/Mesa-Considering-Amber-2
[2] https://www.phoronix.com/news/R300g-Code-Cleanup-2026
[3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41577
[4] https://gitlab.freedesktop.org/ondracka/mesa/-/commits/r300_no_tgsi
Independent open-source contributor Pavel Ondračka continues working on the R300g driver and he's been pursuing a big undertaking to get rid of TGSI usage and replace it with NIR. TGSI is the original Gallium3D intermediate representation started by Tungsten Graphics back in the day but all of the modern Mesa drivers have since transitioned to using the better NIR intermediate representation. Pavel is working on the big task of adapting R300g to use NIR directly without the sidestep through TGSI.
This undertaking was originally reported on Phoronix [2]earlier this month but the exciting milestone today is that the initial merge has landed for Mesa 26.2. Pavel explained in the [3]part one merge request :
"Here goes the first part of removing TGSI from r300 doing the heavy lifting for everything except for the draw swtcl paths. Lots of this have been sitting in a branch for over a year, waiting for a final push by Mike's yearly drop-the-old-stuff rant. This MR is not technically introducing a NIR-based backend, that actually sort of happened some time ago already with !23437 (merged). At that time I was looking to move a lot of lowering from the backend to NIR and while custom finalize_nir offered some options, the fixed pass order in ntt had a lot of limitations. I tried few more approaches but in the end just mostly copied ntt to the r300, removed some unneeded parts and than over time heavily tweaked the NIR passes and added new HW-specific ones. However, the final translation still was NIR->TGSI->RC. So in general most of this series is just boring removal of technical debt which I was not skilled/motivated enough to do initially. The backend IR (before pair translation) is mostly 1:1 match for TGSI anyway with just some extra hw specific stuff, like constant swizzles, per-channel negate, etc. so while this is a quite a large diff, its mostly kind of boring replacement of TGSI ureg_* parts with corresponding pieces from the backend. Codex was used for most of the later search-and-replace-like patches."
Fun seeing ChatGPT's Codex helping out in working on these patches for more than two decade old GPUs.
The journey of this TGSI gutting for R300g isn't yet over but great seeing it continue closer to the finish line. Pavel's ongoing work can be found via the [4]r300_no_tgsi Git branch .
[1] https://www.phoronix.com/news/Mesa-Considering-Amber-2
[2] https://www.phoronix.com/news/R300g-Code-Cleanup-2026
[3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41577
[4] https://gitlab.freedesktop.org/ondracka/mesa/-/commits/r300_no_tgsi