ac/nir/ngg: support clipdist culling
Port from radeonsi. Besides vertex position based primitive culling, clipdist attribute can also be used to cull a primitive. Normally it's used by fixed-pipeline, but when NGG we can treate it as a culling condition to filter out invisible primitive before fixed-pipeline. There are two kinds of clipdist: 1. user define a clip plane explicitly by glClipPlane(), fixed-pipeline calculate with vertex position to get clipdist, then cull. This is the legacy way. 2. Now GLSL define gl_ClipDistance/gl_CullDiatance so that user can calculate clipdist in any way he like. This implementation support both way. 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>
This commit is contained in:
@@ -131,7 +131,9 @@ ac_nir_lower_ngg_nogs(nir_shader *shader,
|
||||
bool provoking_vtx_last,
|
||||
bool use_edgeflags,
|
||||
bool has_prim_query,
|
||||
uint32_t instance_rate_inputs);
|
||||
uint32_t instance_rate_inputs,
|
||||
uint32_t clipdist_enable_mask,
|
||||
uint32_t user_clip_plane_enable_mask);
|
||||
|
||||
void
|
||||
ac_nir_lower_ngg_gs(nir_shader *shader,
|
||||
|
Reference in New Issue
Block a user