radeonsi: unify how ngg_cull_flags are set

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13811>
This commit is contained in:
Marek Olšák 2021-11-07 15:49:19 -05:00 committed by Marge Bot
parent a818f7b686
commit 881c459191
2 changed files with 11 additions and 12 deletions

View File

@ -278,7 +278,7 @@ enum
SI_VS_BLIT_SGPRS_POS_TEXCOORD = 9,
};
#define SI_NGG_CULL_ENABLED (1 << 0) /* this implies W, view.xy, and small prim culling */
#define SI_NGG_CULL_TRIANGLES (1 << 0) /* this implies W, view.xy, and small prim culling */
#define SI_NGG_CULL_BACK_FACE (1 << 1) /* back faces */
#define SI_NGG_CULL_FRONT_FACE (1 << 2) /* front faces */
#define SI_NGG_CULL_LINES (1 << 3) /* the primitive type is lines */

View File

@ -960,18 +960,17 @@ static void *si_create_rs_state(struct pipe_context *ctx, const struct pipe_rast
S_028810_DX_RASTERIZATION_KILL(state->rasterizer_discard) |
S_028810_DX_LINEAR_ATTR_CLIP_ENA(1);
if (rs->rasterizer_discard) {
rs->ngg_cull_flags_tris = rs->ngg_cull_flags_tris_y_inverted = SI_NGG_CULL_ENABLED |
SI_NGG_CULL_FRONT_FACE |
SI_NGG_CULL_BACK_FACE;
rs->ngg_cull_flags_lines = SI_NGG_CULL_ENABLED |
SI_NGG_CULL_LINES;
} else {
rs->ngg_cull_flags_tris = rs->ngg_cull_flags_tris_y_inverted = SI_NGG_CULL_ENABLED;
rs->ngg_cull_flags_lines = SI_NGG_CULL_ENABLED |
SI_NGG_CULL_LINES |
(!rs->perpendicular_end_caps ? SI_NGG_CULL_SMALL_LINES_DIAMOND_EXIT : 0);
rs->ngg_cull_flags_tris = SI_NGG_CULL_TRIANGLES;
rs->ngg_cull_flags_tris_y_inverted = rs->ngg_cull_flags_tris;
rs->ngg_cull_flags_lines = SI_NGG_CULL_LINES |
(!rs->perpendicular_end_caps ? SI_NGG_CULL_SMALL_LINES_DIAMOND_EXIT : 0);
if (rs->rasterizer_discard) {
rs->ngg_cull_flags_tris |= SI_NGG_CULL_FRONT_FACE |
SI_NGG_CULL_BACK_FACE;
rs->ngg_cull_flags_tris_y_inverted = rs->ngg_cull_flags_tris;
} else {
bool cull_front, cull_back;
if (!state->front_ccw) {