summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_context.c
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2008-04-12 21:52:46 -0400
committerKeith Whitwell <keith@tungstengraphics.com>2008-04-14 11:00:35 +0100
commit3f7a3dd58c0ce2719af83ff1d89a26185d08c04c (patch)
treeefc128ea3e61e6e8ec6d18786590a89761775ffa /src/gallium/auxiliary/draw/draw_context.c
parent808f968f3ad0cb32e86f517753d5715d00e9ec2c (diff)
Make shaders operate on a block of memory instead of arrays of vertex_header's
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_context.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index b3c65c90d6..cdca556fbd 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -86,14 +86,12 @@ struct draw_context *draw_create( void )
/* Statically allocate maximum sized vertices for the cache - could be cleverer...
*/
{
- uint i;
const unsigned size = (MAX_VERTEX_SIZE + 0x0f) & ~0x0f;
- char *tmp = align_malloc(Elements(draw->vs.queue) * size, 16);
+ char *tmp = align_malloc(VS_QUEUE_LENGTH * size, 16);
if (!tmp)
goto fail;
- for (i = 0; i < Elements(draw->vs.queue); i++)
- draw->vs.queue[i].vertex = (struct vertex_header *)(tmp + i * size);
+ draw->vs.vertex_cache = tmp;
}
draw->shader_queue_flush = draw_vertex_shader_queue_flush;
@@ -156,8 +154,8 @@ void draw_destroy( struct draw_context *draw )
tgsi_exec_machine_free_data(&draw->machine);
- if (draw->vs.queue[0].vertex)
- align_free( draw->vs.queue[0].vertex ); /* Frees all the vertices. */
+ 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.
*