aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-08-28 17:13:11 -0600
committerBrian Paul <[email protected]>2013-08-29 07:29:31 -0600
commit4e7f1346aefe9d27b67b9f279ce7f1e772b390df (patch)
tree9949584bd9e5d6ea62010fc895c657107bccc54b /src/gallium/auxiliary/draw
parentaebd065a6493deb8df93d59b54452def207170fa (diff)
draw: fix point/line/triangle determination in draw_need_pipeline()
The previous point/line/triangle() functions didn't handle GS primitives. Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_validate.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_validate.c b/src/gallium/auxiliary/draw/draw_pipe_validate.c
index 3562acdbcdc..356f4d657aa 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_validate.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_validate.c
@@ -30,28 +30,13 @@
#include "util/u_memory.h"
#include "util/u_math.h"
+#include "util/u_prim.h"
#include "pipe/p_defines.h"
#include "draw_private.h"
#include "draw_pipe.h"
#include "draw_context.h"
#include "draw_vbuf.h"
-static boolean points( unsigned prim )
-{
- return (prim == PIPE_PRIM_POINTS);
-}
-
-static boolean lines( unsigned prim )
-{
- return (prim == PIPE_PRIM_LINES ||
- prim == PIPE_PRIM_LINE_STRIP ||
- prim == PIPE_PRIM_LINE_LOOP);
-}
-
-static boolean triangles( unsigned prim )
-{
- return prim >= PIPE_PRIM_TRIANGLES;
-}
/**
* Default version of a function to check if we need any special
@@ -66,6 +51,8 @@ draw_need_pipeline(const struct draw_context *draw,
const struct pipe_rasterizer_state *rasterizer,
unsigned int prim )
{
+ unsigned reduced_prim = u_reduced_prim(prim);
+
/* If the driver has overridden this, use that version:
*/
if (draw->render &&
@@ -80,8 +67,7 @@ draw_need_pipeline(const struct draw_context *draw,
* and triggering the pipeline, because we have to trigger the
* pipeline *anyway* if unfilled mode is active.
*/
- if (lines(prim))
- {
+ if (reduced_prim == PIPE_PRIM_LINES) {
/* line stipple */
if (rasterizer->line_stipple_enable && draw->pipeline.line_stipple)
return TRUE;
@@ -97,9 +83,7 @@ draw_need_pipeline(const struct draw_context *draw,
if (draw_current_shader_num_written_culldistances(draw))
return TRUE;
}
-
- if (points(prim))
- {
+ else if (reduced_prim == PIPE_PRIM_POINTS) {
/* large points */
if (rasterizer->point_size > draw->pipeline.wide_point_threshold)
return TRUE;
@@ -117,10 +101,7 @@ draw_need_pipeline(const struct draw_context *draw,
if (rasterizer->sprite_coord_enable && draw->pipeline.point_sprite)
return TRUE;
}
-
-
- if (triangles(prim))
- {
+ else if (reduced_prim == PIPE_PRIM_TRIANGLES) {
/* polygon stipple */
if (rasterizer->poly_stipple_enable && draw->pipeline.pstipple)
return TRUE;