}
-static void vbuf_flush_indices( struct draw_stage *stage );
-static void vbuf_flush_vertices( struct draw_stage *stage );
-static void vbuf_alloc_vertices( struct draw_stage *stage );
+static void vbuf_flush_indices( struct vbuf_stage *vbuf );
+static void vbuf_flush_vertices( struct vbuf_stage *vbuf );
+static void vbuf_alloc_vertices( struct vbuf_stage *vbuf );
static INLINE boolean
check_space( struct vbuf_stage *vbuf, unsigned nr )
{
if (vbuf->nr_vertices + nr > vbuf->max_vertices ) {
- vbuf_flush_vertices(&vbuf->stage);
- vbuf_alloc_vertices(&vbuf->stage);
+ vbuf_flush_vertices(vbuf);
+ vbuf_alloc_vertices(vbuf);
}
if (vbuf->nr_indices + nr > vbuf->max_indices )
- vbuf_flush_indices(&vbuf->stage);
+ vbuf_flush_indices(vbuf);
}
* will be flushed if needed and a new one allocated.
*/
static void
-vbuf_set_prim( struct draw_stage *stage, uint newprim )
+vbuf_set_prim( struct vbuf_stage *vbuf, uint newprim )
{
- struct vbuf_stage *vbuf = vbuf_stage(stage);
const struct vertex_info *vinfo;
unsigned vertex_size;
vertex_size = vinfo->size * sizeof(float);
if (vertex_size != vbuf->vertex_size)
- vbuf_flush_vertices(stage);
+ vbuf_flush_vertices(vbuf);
vbuf->vinfo = vinfo;
vbuf->vertex_size = vertex_size;
if (!vbuf->vertices)
- vbuf_alloc_vertices(stage);
+ vbuf_alloc_vertices(vbuf);
}
vbuf_first_tri( struct draw_stage *stage,
struct prim_header *prim )
{
- vbuf_flush_indices( stage );
+ struct vbuf_stage *vbuf = vbuf_stage( stage );
+
+ vbuf_flush_indices( vbuf );
stage->tri = vbuf_tri;
- vbuf_set_prim(stage, PIPE_PRIM_TRIANGLES);
+ vbuf_set_prim(vbuf, PIPE_PRIM_TRIANGLES);
stage->tri( stage, prim );
}
vbuf_first_line( struct draw_stage *stage,
struct prim_header *prim )
{
- vbuf_flush_indices( stage );
+ struct vbuf_stage *vbuf = vbuf_stage( stage );
+
+ vbuf_flush_indices( vbuf );
stage->line = vbuf_line;
- vbuf_set_prim(stage, PIPE_PRIM_LINES);
+ vbuf_set_prim(vbuf, PIPE_PRIM_LINES);
stage->line( stage, prim );
}
vbuf_first_point( struct draw_stage *stage,
struct prim_header *prim )
{
- vbuf_flush_indices( stage );
+ struct vbuf_stage *vbuf = vbuf_stage( stage );
+
+ vbuf_flush_indices( vbuf );
stage->point = vbuf_point;
- vbuf_set_prim(stage, PIPE_PRIM_POINTS);
+ vbuf_set_prim(vbuf, PIPE_PRIM_POINTS);
stage->point( stage, prim );
}
static void
-vbuf_flush_indices( struct draw_stage *stage )
+vbuf_flush_indices( struct vbuf_stage *vbuf )
{
- struct vbuf_stage *vbuf = vbuf_stage( stage );
-
if(!vbuf->nr_indices)
return;
* we flush.
*/
static void
-vbuf_flush_vertices( struct draw_stage *stage )
+vbuf_flush_vertices( struct vbuf_stage *vbuf )
{
- struct vbuf_stage *vbuf = vbuf_stage( stage );
-
if(vbuf->vertices) {
- vbuf_flush_indices(stage);
+ vbuf_flush_indices(vbuf);
/* Reset temporary vertices ids */
if(vbuf->nr_vertices)
static void
-vbuf_alloc_vertices( struct draw_stage *stage )
+vbuf_alloc_vertices( struct vbuf_stage *vbuf )
{
- struct vbuf_stage *vbuf = vbuf_stage( stage );
-
assert(!vbuf->nr_indices);
assert(!vbuf->vertices);
static void
vbuf_flush( struct draw_stage *stage, unsigned flags )
{
- vbuf_flush_indices( stage );
+ struct vbuf_stage *vbuf = vbuf_stage( stage );
+
+ vbuf_flush_indices( vbuf );
stage->point = vbuf_first_point;
stage->line = vbuf_first_line;
stage->tri = vbuf_first_tri;
if (flags & DRAW_FLUSH_BACKEND)
- vbuf_flush_vertices( stage );
+ vbuf_flush_vertices( vbuf );
}