Reviewing Timur's blog:
Previously, I gave you an introduction to mesh/task shaders and wrote up some details about how mesh shaders are implemented in the driver. But I left out the important details of how task shaders (aka. amplification shaders) work in the driver. In this post, I aim to give you some details about...
timur.hu
The relevant details here are that most of the hard work is implemented in the firmware (good news, because that means I don’t have to implement it), and that task shaders are executed on an async compute queue and that the driver now has to submit compute and graphics work in parallel.
Keep in mind that the API hides this detail and pretends that the mesh shading pipeline is just another graphics pipeline that the application can submit to a graphics queue. So, once again we have a mismatch between the API programming model and what the HW actually does.
Task (amplification shaders) don't map to AMD hardware on RDNA2. They basically make them work on an async compute queue and there's firmware changes to handle the dispatch. I would guess RDNA1 is obviously missing the necessary firmware updates, but that's likely because RDNA1 can't support mesh shaders anyway, and the only purpose of task shaders is to launch mesh shaders.
In the previous post I gave a brief introduction on what mesh and task shaders are from the perspective of application developers. Now it’s time to dive deeper and talk about how mesh shaders are implemented in a Vulkan driver on AMD HW. Note that everything I discuss here is based on my...
timur.hu
NGG (Next Generation Geometry) is the technology that is responsible for any vertex and geometry processing in RDNA GPUs (with some
caveats). Also known as “primitive shader”, the main innovations of NGG are:
- Shaders are aware of not only vertices, but also primitives(this is why they are called primitive shader).
- The output topology is entirely up to the shader, meaning that it can createoutput vertices and primitives with an arbitrary topology regarless of its input.
- On RDNA2 and newer, per-primitive output attributes are also supported.
So change here to support mesh shader's on RDNA is per-primitive output attributes.
From the DF interview with Remedy:
Mesh shaders were picked just because of nicely uniform support on the platforms, on the console platforms, and the pc that we're running. And then the fact that it's possible to build more granular culling ... So it was kind of natural to take that as the basic building block going forward, and it's also supported on the current generation consoles so that's kind of like the low end for, or the baseline, for the stuff that we do now since the previous generation was cropped out.
Playstation is actually very close to pc specs, so I don't think we did anything specific to meshlets really. The meshlet sizes are slightly different on platforms, but that's basically conversion time stuff, so not really. Obviously there's been a lot of platform specific optimizations, but those are not so much specific to Playstation, Xbox or AMD or Nvidia, but they are kind of like general optimizations that help usually everything on all of the platforms, and some of them happen to work a bit better on some platform than other ones.
What I'm getting from this is the APIs that Sony provides are essentially very close as a mesh shader implementation such that they had a general solution that worked across all of the platforms to the point that they didn't have to do different optimizations for each platform.
So my conclusion from this is the playstation 5 likely has the RDNA2 changes to support mesh shaders, because otherwise it would require a tailored solution. In terms of task shader (amplification shader) support, RDNA2 on pc and xbox doesn't map it well in hardware either. It's compute shaders dispatched by firmware made to work like task shaders. Maybe PS5 doesn't have that firmware update. Maybe it does. But I'm not really seeing anything that would tell me the PS5 isn't capable, and since it most likely has the mesh shader changes it probably has the firmware changes for task shaders too.
Edit ** It's either that or RDNA1's NGG is so close RDNA2's that they can essentially implement the same thing, and there was some small technicality that prevented them from complying with the spec on PC. Or they had no way to reliably push the firmware change for amplification to gpus that were already sold. The most likely conclusion, for me, is that these gpus are practically the same. It's APUs for consoles launching at almost the same time from the same vendor, with the same CPU family, and likely the same gpu family **
When Sony talked about the PS5 hardware they likely discussed it in terms of NGG and primitive shaders, because that's how the hardware is actually implemented (on PC, Xbox and Playstation). They're not likely to talk about "mesh shaders" because that was a Microsoft API concept that was actually modelled closer to Nvidia hardware. Sony's API on the other hand sounds like it has shaders that function so similarly to PC mesh shaders that you can build a generalized solution that works for both. They might call it primitive shaders or something, but the ergonomics of the API sound lke they're almost the same. It's close enough that Remedy is calling it mesh shaders, calling it uniform support and saying it didn't require specific optimization.