The RADV Driver Developer Experience Working With AMD's Next-Gen Geometry "NGG"
NGG can be used for vertex and geometry processing with RDNA/RDNA2 GPUs while with upcoming RDNA3 graphics, NGG will always be enabled. NGG was originally worked on for GFX9/Vega but reportedly too buggy / lack of performance uplift that it's only become viable with RDNA graphics.
The NGG pipeline with RDNA simplifies the hardware's operation albeit with increased driver complexity. This increased complexity has made NGG a challenge to implement for both RadeonSI OpenGL and RADV Vulkan, but especially the latter considering it's worked on by developers outside of AMD. Timur wrote about these NGG driver experiences in a personal blog post on Tuesday.
Interestingly, Timur has found little to no performance advantage with NGG initially, "We did some benchmarks when we switched RADV and ACO to use the new pipeline. We found no significant perf changes. At all. Considering all the hype we heard about NGG at the hardware launch, I was quite surprised. However, after I set the hype aside, it was quite self-explanatory. When we switched to NGG, we still compiled our shaders the same way as before, so even though we used the new geometry pipeline, we didn’t do anything to take advantage of its new capabilities. The actual perf improvement came after I also implemented shader-based culling."
NGG with shader culling has been a bigger hit and has seen performance improvements on RDNA2 to varying degrees with different samples and benchmarks. With RDNA1, the Valve developers haven't yet found any case where the NGG shader culling helps the performance and so haven't enabled it by default.
Learn more in this interesting and technical post over on Timur's blog.