From 642d5ba79abc6a231a5fdabb3454b9b082b0d7f8 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 4 Aug 2010 14:37:40 +0800 Subject: [PATCH] draw: Remove unnecessary vertex flag ANDs. 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 | 34 ++++++++++++-------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe.c b/src/gallium/auxiliary/draw/draw_pipe.c index 3421b826d9d..070ac803c85 100644 --- a/src/gallium/auxiliary/draw/draw_pipe.c +++ b/src/gallium/auxiliary/draw/draw_pipe.c @@ -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) -- 2.30.2