}
}
+/* Set the primitive type seen by the rasterizer. GS and tessellation affect this. */
+static inline void
+si_set_rasterized_prim(struct si_context *sctx, enum pipe_prim_type rast_prim)
+{
+ if (rast_prim != sctx->current_rast_prim) {
+ if (util_prim_is_points_or_lines(sctx->current_rast_prim) !=
+ util_prim_is_points_or_lines(rast_prim))
+ si_mark_atom_dirty(sctx, &sctx->atoms.s.guardband);
+
+ sctx->current_rast_prim = rast_prim;
+ sctx->do_update_shaders = true;
+ }
+}
#define PRINT_ERR(fmt, args...) \
fprintf(stderr, "EE %s:%d %s - " fmt, __FILE__, __LINE__, __func__, ##args)
rast_prim = prim;
}
- if (rast_prim != sctx->current_rast_prim) {
- if (util_prim_is_points_or_lines(sctx->current_rast_prim) !=
- util_prim_is_points_or_lines(rast_prim))
- si_mark_atom_dirty(sctx, &sctx->atoms.s.guardband);
-
- sctx->current_rast_prim = rast_prim;
- sctx->do_update_shaders = true;
- }
+ si_set_rasterized_prim(sctx, rast_prim);
}
if (IS_DRAW_VERTEX_STATE) {
static void si_update_rasterized_prim(struct si_context *sctx)
{
- enum pipe_prim_type rast_prim;
-
if (sctx->shader.gs.cso) {
/* Only possibilities: POINTS, LINE_STRIP, TRIANGLES */
- rast_prim = sctx->shader.gs.cso->rast_prim;
+ si_set_rasterized_prim(sctx, sctx->shader.gs.cso->rast_prim);
} else if (sctx->shader.tes.cso) {
/* Only possibilities: POINTS, LINE_STRIP, TRIANGLES */
- rast_prim = sctx->shader.tes.cso->rast_prim;
+ si_set_rasterized_prim(sctx, sctx->shader.tes.cso->rast_prim);
} else {
- /* Determined by draw calls. */
- return;
- }
-
- if (rast_prim != sctx->current_rast_prim) {
- if (util_prim_is_points_or_lines(sctx->current_rast_prim) !=
- util_prim_is_points_or_lines(rast_prim))
- si_mark_atom_dirty(sctx, &sctx->atoms.s.guardband);
-
- sctx->current_rast_prim = rast_prim;
+ /* The rasterized prim is determined by draw calls. */
}
}