1bdeb961bd
Port from radeonsi. Cull primitive after GS thread and before final vertex/primitive export. GS culling is like VS/TES culling which read out saved vertex positions of a primitive from LDS then call the primitive culling algorithm to check whether it's visiable or not, only passed primitives will be exported. Unlike the VS/TES culling that read vertex index of a primitive from VGPRs as shader args, GS will set a primitive complete flag for each last vertex of a primitive in LDS, so that vertex thread know the previous 1/2/3 vertex can form a primitive and do primitive culling. Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>