ASSIGN_4V( draw->plane[5], 0, 0, -1, 1 ); /* mesa's a bit wonky */
draw->nr_planes = 6;
- /* Statically allocate maximum sized vertices for the cache - could be cleverer...
- */
- {
- char *tmp = align_malloc(VS_QUEUE_LENGTH * MAX_VERTEX_ALLOCATION, 16);
- if (!tmp)
- goto fail;
-
- draw->vs.vertex_cache = tmp;
- }
-
/* these defaults are oriented toward the needs of softpipe */
draw->wide_point_threshold = 1000000.0; /* infinity */
draw->wide_line_threshold = 1.0;
align_free(draw->machine.Outputs);
tgsi_exec_machine_free_data(&draw->machine);
-
- if (draw->vs.vertex_cache)
- align_free( draw->vs.vertex_cache ); /* Frees all the vertices. */
-
/* Not so fast -- we're just borrowing this at the moment.
*
if (draw->render)
{
assert(count <= PIPE_MAX_ATTRIBS);
- draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
-
memcpy(draw->vertex_buffer, buffers, count * sizeof(buffers[0]));
draw->nr_vertex_buffers = count;
}
{
assert(count <= PIPE_MAX_ATTRIBS);
- draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
-
memcpy(draw->vertex_element, elements, count * sizeof(elements[0]));
draw->nr_vertex_elements = count;
}
draw_set_mapped_vertex_buffer(struct draw_context *draw,
unsigned attr, const void *buffer)
{
- draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
draw->user.vbuffer[attr] = buffer;
}
draw_set_mapped_constant_buffer(struct draw_context *draw,
const void *buffer)
{
- draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
draw->user.constants = buffer;
}
/* Support prototype passthrough path:
*/
struct {
- unsigned prim; /* XXX: to be removed */
- unsigned hw_vertex_size; /* XXX: to be removed */
-
struct {
struct draw_pt_middle_end *opt[PT_MAX_MIDDLE];
} middle;
/** TGSI program interpreter runtime state */
struct tgsi_exec_machine machine;
- /* Vertex fetch internal state
- */
- struct {
- const ubyte *src_ptr[PIPE_MAX_ATTRIBS];
- unsigned pitch[PIPE_MAX_ATTRIBS];
- fetch_func fetch[PIPE_MAX_ATTRIBS];
- unsigned nr_attrs;
- full_fetch_func fetch_func;
- pt_fetch_func pt_fetch;
- } vertex_fetch;
-
- /* Post-tnl vertex cache:
- */
- struct {
- unsigned referenced; /**< bitfield */
-
- struct {
- unsigned in; /* client array element */
- unsigned out; /* index in vs queue/array */
- } idx[VCACHE_SIZE + VCACHE_OVERFLOW];
-
- unsigned overflow;
-
- /** To find space in the vertex cache: */
- struct vertex_header *(*get_vertex)( struct draw_context *draw,
- unsigned i );
- } vcache;
-
- /* Vertex shader queue:
- */
- struct {
- unsigned elts[VS_QUEUE_LENGTH]; /**< index into the user's vertex arrays */
- char *vertex_cache;
- unsigned queue_nr;
- unsigned post_nr;
- } vs;
-
- /* Prim pipeline queue:
- */
- struct {
- /* Need to queue up primitives until their vertices have been
- * transformed by a vs queue flush.
- */
- struct prim_header queue[PRIM_QUEUE_LENGTH];
- unsigned queue_nr;
- } pq;
-
-
/* This (and the tgsi_exec_machine struct) probably need to be moved somewhere private.
*/
struct gallivm_cpu_engine *engine;
void draw_pt_reset_vertex_ids( struct draw_context *draw );
-#define DRAW_FLUSH_SHADER_QUEUE 0x1 /* sized not to overflow, never raised */
-#define DRAW_FLUSH_PRIM_QUEUE 0x2
-#define DRAW_FLUSH_VERTEX_CACHE 0x4
#define DRAW_FLUSH_STATE_CHANGE 0x8
#define DRAW_FLUSH_BACKEND 0x10
return result;
}
-static INLINE struct vertex_header *
-draw_header_from_block(char *block, int size, int num)
-{
- return (struct vertex_header*)(block + num * size);
-}
#endif /* DRAW_PRIVATE_H */