Skip to content

radv/radeonsi: Use NIR barycentric interpolation intrinsics

Connor Abbott requested to merge cwabbott0/mesa:radv-radeonsi-bary into master

A while back, we added some nice NIR intrinsics to model how many GPU's, including AMD ones, do interpolation, that allow the driver to not have to implement interpolateAt* separately among other things. However, both radv and radeonsi/nir still do all their i/o handling via variables, so they didn't use it. This series moves both drivers to using nir_lower_io, for now just for FS inputs, so that we can use them. This also eliminates some driver-specific bits from the NIR->LLVM pass, as input handling is mostly done in common ac code. There were several bits needed, some of which are nice cleanups on their own:

  • The input attachment code in radv was doing a varying load while translating NIR->LLVM, which isn't easy with the new scheme, so we reuse the anv code to lower it in NIR instead (patches by @daniel-schuermann, I just added one small warning fix).
  • radv wasn't using the fragcoord sysval, manually filling out the varying instead, so we add an option to vtn just like the one for GLSL and make radv use it.
  • Move various useful passes to common NIR code so that radv can use them, and fix issues discovered along the way due to the way we want to use them on AMD.
  • Finally, switch over radv and radeonsi and remove the old code.

Merge request reports