draw: Do not run full pipeline when flatshade_first for point primitives.
authorMichal Krol <michal@tungstengraphics.com>
Sun, 30 Mar 2008 21:21:20 +0000 (23:21 +0200)
committerMichal Krol <michal@tungstengraphics.com>
Sun, 30 Mar 2008 21:21:20 +0000 (23:21 +0200)
src/gallium/auxiliary/draw/draw_prim.c
src/gallium/auxiliary/draw/draw_pt.c
src/gallium/auxiliary/draw/draw_validate.c

index 404c28d76a1098509ebfaf0dd6c8360e3be263a2..ddcde01d9a2e41cc5298822680bd2ddf0213538b 100644 (file)
@@ -594,7 +594,6 @@ draw_arrays(struct draw_context *draw, unsigned prim,
 
    /* drawing done here: */
    if (!draw->rasterizer->bypass_vs ||
-       (draw->rasterizer->flatshade && draw->rasterizer->flatshade_first) ||
        !draw_pt_arrays(draw, prim, start, count)) {
       /* we have to run the whole pipeline */
       draw_prim(draw, prim, start, count);
index 3ec31ec25f3040875d1a29f4e61cc8dc321dab22..fc9304197a9ffe65c449eb4eb406f8e59b825fcd 100644 (file)
@@ -36,6 +36,9 @@
 #include "draw/draw_pt.h"
 
 
+/* XXX: Shouldn't those two functions below use the '>' operator???
+ */
+
 static boolean too_many_verts( struct draw_context *draw,
                                unsigned verts )
 {
index e163e078f0f28b0f3657e69451a2e42e23f2e6e8..ad43f06f73fa46f1dc2488199c99c3d3b1c048c7 100644 (file)
@@ -76,6 +76,10 @@ draw_need_pipeline(const struct draw_context *draw,
       /* AA lines */
       if (draw->rasterizer->line_smooth && draw->pipeline.aaline)
          return TRUE;
+
+      /* first-vertex driven flatshading */
+      if (draw->rasterizer->flatshade && draw->rasterizer->flatshade_first)
+         return TRUE;
    }
 
    if (points(prim))
@@ -112,6 +116,10 @@ draw_need_pipeline(const struct draw_context *draw,
       /* two-side lighting */
       if (draw->rasterizer->light_twoside)
          return TRUE;
+
+      /* first-vertex driven flatshading */
+      if (draw->rasterizer->flatshade && draw->rasterizer->flatshade_first)
+         return TRUE;
    }
 
    /* polygon cull - this is difficult - hardware can cull just fine