summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-03-13 14:34:35 -0600
committerBrian <[email protected]>2008-03-13 14:34:35 -0600
commit3faf6230ff4b63833c072ac7afeb43c25d3cba22 (patch)
tree9ef67cf5e3a60b343f1f48c109b7d06aa53ba8a3 /src/gallium
parent8b8c9acdb747499149e633179a8ad10b0e4206b1 (diff)
gallium: added draw_need_pipeline() predicate function
To test if we need any pipeline stage, or whether we can go into passthrough mode.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/draw/draw_validate.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_validate.c b/src/gallium/auxiliary/draw/draw_validate.c
index b43295b5860..602fa3429de 100644
--- a/src/gallium/auxiliary/draw/draw_validate.c
+++ b/src/gallium/auxiliary/draw/draw_validate.c
@@ -33,6 +33,59 @@
#include "draw_private.h"
+/**
+ * Check if we need any special pipeline stages, or whether prims/verts
+ * can go through untouched.
+ */
+boolean
+draw_need_pipeline(const struct draw_context *draw)
+{
+ /* clipping */
+ if (!draw->rasterizer->bypass_clipping)
+ return TRUE;
+
+ /* vertex shader */
+ if (!draw->rasterizer->bypass_vs)
+ return TRUE;
+
+ /* line stipple */
+ if (draw->rasterizer->line_stipple_enable && draw->line_stipple)
+ return TRUE;
+
+ /* wide lines */
+ if (draw->rasterizer->line_width > draw->wide_line_threshold)
+ return TRUE;
+
+ /* large points */
+ if (draw->rasterizer->point_size > draw->wide_point_threshold)
+ return TRUE;
+
+ /* AA lines */
+ if (draw->rasterizer->line_smooth && draw->pipeline.aaline)
+ return TRUE;
+
+ /* AA points */
+ if (draw->rasterizer->point_smooth && draw->pipeline.aapoint)
+ return TRUE;
+
+ /* polygon stipple */
+ if (draw->rasterizer->poly_stipple_enable && draw->pipeline.pstipple)
+ return TRUE;
+
+ /* polygon offset */
+ if (draw->rasterizer->offset_cw || draw->rasterizer->offset_ccw)
+ return TRUE;
+
+ /* two-side lighting */
+ if (draw->rasterizer->light_twoside)
+ return TRUE;
+
+ /* polygon cull */
+ if (draw->rasterizer->cull_mode)
+ return TRUE;
+
+ return FALSE;
+}
@@ -92,7 +145,7 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
next = draw->pipeline.wide_point;
}
- if (draw->rasterizer->line_stipple_enable) {
+ if (draw->rasterizer->line_stipple_enable && draw->line_stipple) {
draw->pipeline.stipple->next = next;
next = draw->pipeline.stipple;
precalc_flat = 1; /* only needed for lines really */