draw: placeholder/prototype code for a passthrough draw path

This commit is contained in:
Keith Whitwell 2008-03-10 19:49:15 +00:00
parent d08cd68d3f
commit 297b3be25a
6 changed files with 52 additions and 0 deletions

View file

@ -4,6 +4,7 @@ include $(TOP)/configs/current
LIBNAME = draw
C_SOURCES = \
draw_passthrough.c \
draw_aaline.c \
draw_aapoint.c \
draw_clip.c \

View file

@ -16,6 +16,7 @@ draw = env.ConvenienceLibrary(
'draw_offset.c',
'draw_prim.c',
'draw_pstipple.c',
'draw_passthrough.c',
'draw_stipple.c',
'draw_twoside.c',
'draw_unfilled.c',

View file

@ -34,6 +34,7 @@
#include "pipe/p_util.h"
#include "draw_context.h"
#include "draw_private.h"
#include "draw_vbuf.h"
@ -114,6 +115,10 @@ void draw_destroy( struct draw_context *draw )
draw->pipeline.rasterize->destroy( draw->pipeline.rasterize );
tgsi_exec_machine_free_data(&draw->machine);
align_free( draw->vs.queue[0].vertex ); /* Frees all the vertices. */
if (draw->render)
draw->render->destroy( draw->render );
FREE( draw );
}
@ -349,3 +354,10 @@ void draw_reset_vertex_ids(struct draw_context *draw)
draw_vertex_cache_reset_vertex_ids(draw);
}
void draw_set_render( struct draw_context *draw,
struct vbuf_render *render )
{
draw->render = render;
}

View file

@ -168,4 +168,9 @@ unsigned draw_trim_prim( unsigned mode, unsigned count );
struct vbuf_render;
void draw_set_render( struct draw_context *draw,
struct vbuf_render *render );
#endif /* DRAW_CONTEXT_H */

View file

@ -162,8 +162,14 @@ typedef void (*full_fetch_func)( struct draw_context *draw,
const unsigned *elts,
unsigned count );
typedef void (*pt_fetch_func)( struct draw_context *draw,
float *out,
unsigned start,
unsigned count );
struct vbuf_render;
/**
* Private context for the drawing module.
*/
@ -191,6 +197,17 @@ struct draw_context
struct draw_stage *rasterize;
} pipeline;
struct vbuf_render *render;
/* Support prototype passthrough path:
*/
struct {
unsigned prim;
unsigned hw_vertex_size;
} pt;
/* pipe state that we need: */
const struct pipe_rasterizer_state *rasterizer;
struct pipe_viewport_state viewport;
@ -244,6 +261,7 @@ struct draw_context
fetch_func fetch[PIPE_ATTRIB_MAX];
unsigned nr_attrs;
full_fetch_func fetch_func;
pt_fetch_func pt_fetch;
} vertex_fetch;
/* Post-tnl vertex cache:
@ -331,6 +349,15 @@ struct tgsi_exec_machine;
extern void draw_update_vertex_fetch( struct draw_context *draw );
/* Prototype/hack
*/
boolean
draw_passthrough_arrays(struct draw_context *draw,
unsigned prim,
unsigned start,
unsigned count);
#define DRAW_FLUSH_SHADER_QUEUE 0x1 /* sized not to overflow, never raised */
#define DRAW_FLUSH_PRIM_QUEUE 0x2
#define DRAW_FLUSH_VERTEX_CACHE 0x4

View file

@ -85,6 +85,12 @@ struct vbuf_render {
const ushort *indices,
uint nr_indices );
/* Draw Arrays path too.
*/
void (*draw_arrays)( struct vbuf_render *,
unsigned start,
uint nr );
/**
* Called when vbuf is done with this set of vertices:
*/