struct vertex_header {
unsigned clipmask:12;
unsigned edgeflag:1;
- unsigned pad:19;
+ unsigned pad:3;
+ unsigned vertex_id:16;
float clip[4];
};
/* XXX This is too large */
-#define MAX_VERTEX_SIZE ((2 + TGSI_ATTRIB_MAX) * 4 * sizeof(float))
+#define MAX_VERTEX_SIZE ((2 + PIPE_MAX_SHADER_OUTPUTS) * 4 * sizeof(float))
struct {
struct draw_stage *first; /**< one of the following */
+ struct draw_stage *validate;
+
/* stages (in logical order) */
struct draw_stage *feedback;
struct draw_stage *flatshade;
struct draw_stage *twoside;
struct draw_stage *offset;
struct draw_stage *unfilled;
- struct draw_stage *setup; /* aka render/rasterize */
+ struct draw_stage *rasterize;
} pipeline;
/* pipe state that we need: */
uint attrib_front0, attrib_back0;
uint attrib_front1, attrib_back1;
- unsigned nr_vertices;
-
+ unsigned drawing;
unsigned prim; /**< current prim type: PIPE_PRIM_x */
unsigned reduced_prim;
- struct vertex_header *(*get_vertex)( struct draw_context *draw,
- unsigned i );
/* Post-tnl vertex cache:
*/
unsigned idx[VCACHE_SIZE + VCACHE_OVERFLOW];
struct vertex_header *vertex[VCACHE_SIZE + VCACHE_OVERFLOW];
unsigned overflow;
+
+ struct vertex_header *(*get_vertex)( struct draw_context *draw,
+ unsigned i );
} vcache;
/* Vertex shader queue:
extern struct draw_stage *draw_clip_stage( struct draw_context *context );
extern struct draw_stage *draw_flatshade_stage( struct draw_context *context );
extern struct draw_stage *draw_cull_stage( struct draw_context *context );
+extern struct draw_stage *draw_validate_stage( struct draw_context *context );
extern void draw_free_tmps( struct draw_stage *stage );
extern int draw_vertex_cache_check_space( struct draw_context *draw,
unsigned nr_verts );
-extern void draw_vertex_cache_validate( struct draw_context *draw );
extern void draw_vertex_cache_invalidate( struct draw_context *draw );
extern void draw_vertex_cache_unreference( struct draw_context *draw );
+extern void draw_vertex_cache_reset_vertex_ids( struct draw_context *draw );
+
extern void draw_vertex_shader_queue_flush( struct draw_context *draw );
unsigned count );
+#define DRAW_FLUSH_PRIM_QUEUE 0x1
+#define DRAW_FLUSH_VERTEX_CACHE_INVALIDATE 0x2
+#define DRAW_FLUSH_DRAW 0x4
+
+
+void draw_do_flush( struct draw_context *draw,
+ unsigned flags );
+
+
+
+
/**
* Get a writeable copy of a vertex.
* \param stage drawing stage info
{
struct vertex_header *tmp = stage->tmp[idx];
memcpy(tmp, vert, stage->draw->vertex_info.size * sizeof(float) );
+ tmp->vertex_id = ~0;
return tmp;
}