draw: Remove unnecessary vertex flag ANDs.
authorChia-I Wu <olv@lunarg.com>
Wed, 4 Aug 2010 06:37:40 +0000 (14:37 +0800)
committerChia-I Wu <olv@lunarg.com>
Fri, 6 Aug 2010 05:39:37 +0000 (13:39 +0800)
Vertex flags are a contract between vcache and the pipeline.  They are
set only for the first vertex of a primitive.

src/gallium/auxiliary/draw/draw_pipe.c

index 3421b826d9d1f7b8498140b27771d3b3d19e830a..070ac803c85c8a3fc81cb7f577c7301c5da5aa93 100644 (file)
@@ -179,18 +179,17 @@ static void do_triangle( struct draw_context *draw,
    do_triangle( draw,                                          \
                 i0,  /* flags */                               \
                 verts + stride * (i0 & ~DRAW_PIPE_FLAG_MASK),  \
-                verts + stride * (i1 & ~DRAW_PIPE_FLAG_MASK),  \
-                verts + stride * (i2 & ~DRAW_PIPE_FLAG_MASK) )
+                verts + stride * (i1),                         \
+                verts + stride * (i2) )
 
 #define LINE(flags,i0,i1)                                      \
    do_line( draw,                                              \
             i0, /* flags */                                    \
             verts + stride * (i0 & ~DRAW_PIPE_FLAG_MASK),      \
-            verts + stride * (i1 & ~DRAW_PIPE_FLAG_MASK) )
+            verts + stride * (i1) )
 
 #define POINT(i0)                               \
-   do_point( draw,                              \
-             verts + stride * (i0 & ~DRAW_PIPE_FLAG_MASK) )
+   do_point( draw, verts + stride * (i0) )
 
 #define GET_ELT(idx) (elts[idx])
 
@@ -268,22 +267,19 @@ void draw_pipeline_run( struct draw_context *draw,
  * This code is for non-indexed (aka linear) rendering (no elts).
  */
 
-#define TRIANGLE(flags,i0,i1,i2)                                 \
-   do_triangle( draw,                                            \
-                flags,  /* flags */                              \
-                verts + stride * ((i0) & ~DRAW_PIPE_FLAG_MASK),  \
-                verts + stride * ((i1) & ~DRAW_PIPE_FLAG_MASK),  \
-                verts + stride * ((i2) & ~DRAW_PIPE_FLAG_MASK))
+#define TRIANGLE(flags,i0,i1,i2)       \
+   do_triangle( draw, flags,           \
+                verts + stride * (i0), \
+                verts + stride * (i1), \
+                verts + stride * (i2) )
 
-#define LINE(flags,i0,i1)                                   \
-   do_line( draw,                                           \
-            flags,                                          \
-            verts + stride * ((i0) & ~DRAW_PIPE_FLAG_MASK), \
-            verts + stride * ((i1) & ~DRAW_PIPE_FLAG_MASK))
+#define LINE(flags,i0,i1)              \
+   do_line( draw, flags,               \
+            verts + stride * (i0),     \
+            verts + stride * (i1) )
 
-#define POINT(i0)                               \
-   do_point( draw,                              \
-             verts + stride * ((i0) & ~DRAW_PIPE_FLAG_MASK) )
+#define POINT(i0)                      \
+   do_point( draw, verts + stride * (i0) )
 
 
 #define GET_ELT(idx) (idx)