summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-08-07 02:14:50 -0600
committerChia-I Wu <olv@lunarg.com>2010-08-07 02:14:50 +0800
commit6ae39f6dca8f0968902642f04f1deb6f573edb6d (patch)
tree8d849e4d241f44d51d8bf14ab1eb8ae70839dfec /src/gallium/auxiliary/draw
parent27041d7cb3faeaed483538a228573466363ec1c7 (diff)
draw: Assert that only the first vetex may have flags set.
642d5ba79abc6a231a5fdabb3454b9b082b0d7f8 removed flags masking for vertices other than the first one. Add assertions to be on the safe side.
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe.c b/src/gallium/auxiliary/draw/draw_pipe.c
index 070ac803c8..58995e0724 100644
--- a/src/gallium/auxiliary/draw/draw_pipe.c
+++ b/src/gallium/auxiliary/draw/draw_pipe.c
@@ -175,21 +175,31 @@ static void do_triangle( struct draw_context *draw,
* higher bits of i0. Otherwise, flags do not matter.
*/
-#define TRIANGLE(flags,i0,i1,i2) \
- do_triangle( draw, \
- i0, /* flags */ \
- verts + stride * (i0 & ~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) )
+#define TRIANGLE(flags,i0,i1,i2) \
+ do { \
+ assert(!((i1) & DRAW_PIPE_FLAG_MASK)); \
+ assert(!((i2) & DRAW_PIPE_FLAG_MASK)); \
+ do_triangle( draw, \
+ i0, /* flags */ \
+ verts + stride * (i0 & ~DRAW_PIPE_FLAG_MASK), \
+ verts + stride * (i1), \
+ verts + stride * (i2) ); \
+ } while (0)
+
+#define LINE(flags,i0,i1) \
+ do { \
+ assert(!((i1) & DRAW_PIPE_FLAG_MASK)); \
+ do_line( draw, \
+ i0, /* flags */ \
+ verts + stride * (i0 & ~DRAW_PIPE_FLAG_MASK), \
+ verts + stride * (i1) ); \
+ } while (0)
#define POINT(i0) \
- do_point( draw, verts + stride * (i0) )
+ do { \
+ assert(!((i0) & DRAW_PIPE_FLAG_MASK)); \
+ do_point( draw, verts + stride * (i0) ); \
+ } while (0)
#define GET_ELT(idx) (elts[idx])