Skip to content

ac,radeonsi: redesigned primitive discard compute shader, NGG and ac_surface improvements

Marek Olšák requested to merge mareko/mesa:amd-prim-discard-and-stuff into main

Most of this MR is about the primitive discard compute shader. The new version is simplified and optimized. Since the GDS codepath that preserved the primitive order was too unstable, all GDS codepaths were removed (removing primitive restart support with it), the gfx7 support was removed from it, the triangle fan support was removed, and only the simple memory-based approach remained.

It's very close to being enabled by default. It's a straightforward culling shader that uses atomic_add to append indices into an index buffer, not preserving the primitive order. Both VertexID and InstanceID are preserved for the vertex shader that follows since both IDs come from the generated index buffer. It can be enabled for applications that have more than 70% invisible primitives and that don't care about the order in which primitives are drawn, though performance numbers from real apps are unknown at this point.

ac_surface has a modifier change. VS and NGG have small improvements.

Merge request reports