draw: Remove DRAW_PIPE_MAX_VERTICES and DRAW_PIPE_FLAG_MASK.

The higher bits of draw elements are no longer used for the stipple or
edge flags.
This commit is contained in:
Chia-I Wu 2010-08-07 21:02:13 +08:00
parent a072f0e186
commit c3fee80f2b
6 changed files with 19 additions and 30 deletions

View File

@ -380,7 +380,7 @@ static void gs_tri_adj(struct draw_geometry_shader *shader,
#define FUNC gs_run_elts
#define LOCAL_VARS const ushort *elts = input_prims->elts;
#define GET_ELT(idx) (elts[idx] & ~DRAW_PIPE_FLAG_MASK)
#define GET_ELT(idx) (elts[idx])
#include "draw_gs_tmp.h"

View File

@ -173,27 +173,23 @@ static void do_triangle( struct draw_context *draw,
#define TRIANGLE(flags,i0,i1,i2) \
do { \
assert(!((i1) & DRAW_PIPE_FLAG_MASK)); \
assert(!((i2) & DRAW_PIPE_FLAG_MASK)); \
do_triangle( draw, \
flags, \
verts + stride * (i0 & ~DRAW_PIPE_FLAG_MASK), \
verts + stride * (i0), \
verts + stride * (i1), \
verts + stride * (i2) ); \
} while (0)
#define LINE(flags,i0,i1) \
do { \
assert(!((i1) & DRAW_PIPE_FLAG_MASK)); \
do_line( draw, \
flags, \
verts + stride * (i0 & ~DRAW_PIPE_FLAG_MASK), \
verts + stride * (i0), \
verts + stride * (i1) ); \
} while (0)
#define POINT(i0) \
do { \
assert(!((i0) & DRAW_PIPE_FLAG_MASK)); \
do_point( draw, verts + stride * (i0) ); \
} while (0)
@ -247,8 +243,7 @@ void draw_pipeline_run( struct draw_context *draw,
unsigned max_index = 0x0, i;
/* find the largest element index */
for (i = 0; i < count; i++) {
unsigned int index = (prim_info->elts[start + i]
& ~DRAW_PIPE_FLAG_MASK);
unsigned int index = prim_info->elts[start + i];
if (index > max_index)
max_index = index;
}

View File

@ -373,21 +373,15 @@ void draw_pipeline_destroy( struct draw_context *draw );
/* We use the top few bits in the elts[] parameter to convey a little
* API information. This limits the number of vertices we can address
* to only 4096 -- if that becomes a problem, we can switch to 32-bit
* draw indices.
*
* These flags expected at first vertex of lines & triangles when
* unfilled and/or line stipple modes are operational.
/*
* These flags are used by the pipeline when unfilled and/or line stipple modes
* are operational.
*/
#define DRAW_PIPE_MAX_VERTICES (0x1<<12)
#define DRAW_PIPE_EDGE_FLAG_0 (0x1<<12)
#define DRAW_PIPE_EDGE_FLAG_1 (0x2<<12)
#define DRAW_PIPE_EDGE_FLAG_2 (0x4<<12)
#define DRAW_PIPE_EDGE_FLAG_ALL (0x7<<12)
#define DRAW_PIPE_RESET_STIPPLE (0x8<<12)
#define DRAW_PIPE_FLAG_MASK (0xf<<12)
#define DRAW_PIPE_EDGE_FLAG_0 0x1
#define DRAW_PIPE_EDGE_FLAG_1 0x2
#define DRAW_PIPE_EDGE_FLAG_2 0x4
#define DRAW_PIPE_EDGE_FLAG_ALL 0x7
#define DRAW_PIPE_RESET_STIPPLE 0x8
void draw_pipeline_run( struct draw_context *draw,
const struct draw_vertex_info *vert,

View File

@ -112,11 +112,11 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
gs_out_prim,
max_vertices );
*max_vertices = MAX2( *max_vertices,
DRAW_PIPE_MAX_VERTICES );
*max_vertices = MAX2( *max_vertices, 4096 );
}
else {
*max_vertices = DRAW_PIPE_MAX_VERTICES;
/* limit max fetches by limiting max_vertices */
*max_vertices = 4096;
}
/* return even number */

View File

@ -118,11 +118,11 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
out_prim,
max_vertices );
*max_vertices = MAX2( *max_vertices,
DRAW_PIPE_MAX_VERTICES );
*max_vertices = MAX2( *max_vertices, 4096 );
}
else {
*max_vertices = DRAW_PIPE_MAX_VERTICES;
/* limit max fetches by limiting max_vertices */
*max_vertices = 4096;
}
/* return even number */

View File

@ -225,7 +225,7 @@ static void so_tri(struct pt_so_emit *so, int i0, int i1, int i2)
#define FUNC so_run_elts
#define LOCAL_VARS const ushort *elts = input_prims->elts;
#define GET_ELT(idx) (elts[start + (idx)] & ~DRAW_PIPE_FLAG_MASK)
#define GET_ELT(idx) (elts[start + (idx)])
#include "draw_so_emit_tmp.h"