S_028810_DX_RASTERIZATION_KILL(state->rasterizer_discard) |
S_028810_DX_LINEAR_ATTR_CLIP_ENA(1);
+ if (rs->rasterizer_discard) {
+ rs->ngg_cull_flags = SI_NGG_CULL_FRONT_FACE | SI_NGG_CULL_BACK_FACE;
+ rs->ngg_cull_flags_y_inverted = rs->ngg_cull_flags;
+ } else {
+ /* Polygon mode can't use view and small primitive culling,
+ * because it draws points or lines where the culling depends
+ * on the point or line width.
+ */
+ if (!rs->polygon_mode_enabled) {
+ rs->ngg_cull_flags |= SI_NGG_CULL_VIEW_SMALLPRIMS;
+ rs->ngg_cull_flags_y_inverted |= SI_NGG_CULL_VIEW_SMALLPRIMS;
+ }
+
+ if (rs->cull_front) {
+ rs->ngg_cull_flags |= SI_NGG_CULL_FRONT_FACE;
+ rs->ngg_cull_flags_y_inverted |= SI_NGG_CULL_BACK_FACE;
+ }
+
+ if (rs->cull_back) {
+ rs->ngg_cull_flags |= SI_NGG_CULL_BACK_FACE;
+ rs->ngg_cull_flags_y_inverted |= SI_NGG_CULL_FRONT_FACE;
+ }
+ }
+
si_pm4_set_reg(
pm4, R_0286D4_SPI_INTERP_CONTROL_0,
S_0286D4_FLAT_SHADE_ENA(1) | S_0286D4_PNT_SPRITE_ENA(state->point_quad_rasterization) |
unsigned pa_cl_clip_cntl;
float line_width;
float max_point_size;
+ unsigned ngg_cull_flags : 8;
+ unsigned ngg_cull_flags_y_inverted : 8;
unsigned sprite_coord_enable : 8;
unsigned clip_plane_enable : 8;
unsigned half_pixel_center : 1;
total_direct_count > hw_vs->ngg_cull_nonindexed_fast_launch_vert_threshold &&
prim & ((1 << PIPE_PRIM_TRIANGLES) |
(1 << PIPE_PRIM_TRIANGLE_STRIP))))) {
- uint8_t ngg_culling = 0;
-
- if (rs->rasterizer_discard) {
- ngg_culling |= SI_NGG_CULL_FRONT_FACE | SI_NGG_CULL_BACK_FACE;
- } else {
- /* Polygon mode can't use view and small primitive culling,
- * because it draws points or lines where the culling depends
- * on the point or line width.
- */
- if (!rs->polygon_mode_enabled)
- ngg_culling |= SI_NGG_CULL_VIEW_SMALLPRIMS;
-
- if (sctx->viewport0_y_inverted ? rs->cull_back : rs->cull_front)
- ngg_culling |= SI_NGG_CULL_FRONT_FACE;
- if (sctx->viewport0_y_inverted ? rs->cull_front : rs->cull_back)
- ngg_culling |= SI_NGG_CULL_BACK_FACE;
- }
+ uint8_t ngg_culling = sctx->viewport0_y_inverted ? rs->ngg_cull_flags_y_inverted :
+ rs->ngg_cull_flags;
/* Use NGG fast launch for certain primitive types.
* A draw must have at least 1 full primitive.