summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_context.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-04-17 23:44:32 +0100
committerKeith Whitwell <[email protected]>2008-04-18 10:48:54 +0100
commita773f06e969a3992451dd7fe6fd55ea96b2774fa (patch)
tree7b8f2ef0bf53da7312c8a89774a5159a87c90e76 /src/gallium/auxiliary/draw/draw_context.c
parent01b6354e72a84f8c3c22be1f77eab8d9c05920a3 (diff)
draw: split off all the extra functionality in the vertex shader
This will at least allow us to make the initial gains to get decent vertex performance much more quickly & with higher confidence of getting it right. At some later point can look again at code-generating all the fetch/cliptest/viewport extras in the same block as the vertex shader. For now, just need to get some decent baseline performance.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_context.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 9b2dcc0b572..4838b68ed17 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -110,6 +110,12 @@ struct draw_context *draw_create( void )
tgsi_exec_machine_init(&draw->machine);
+ /* FIXME: give this machine thing a proper constructor:
+ */
+ draw->machine.Inputs = align_malloc(PIPE_MAX_ATTRIBS * sizeof(struct tgsi_exec_vector), 16);
+ draw->machine.Outputs = align_malloc(PIPE_MAX_ATTRIBS * sizeof(struct tgsi_exec_vector), 16);
+
+
if (!draw_pt_init( draw ))
goto fail;
@@ -155,8 +161,13 @@ void draw_destroy( struct draw_context *draw )
if (draw->pipeline.rasterize)
draw->pipeline.rasterize->destroy( draw->pipeline.rasterize );
+ if (draw->machine.Inputs)
+ align_free(draw->machine.Inputs);
+ if (draw->machine.Outputs)
+ 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. */
@@ -265,6 +276,7 @@ draw_set_vertex_elements(struct draw_context *draw,
draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
memcpy(draw->vertex_element, elements, count * sizeof(elements[0]));
+ draw->nr_vertex_elements = count;
}
@@ -463,15 +475,3 @@ boolean draw_get_edgeflag( struct draw_context *draw,
return 1;
}
-
-#if 0
-/* Crufty init function. Fix me.
- */
-boolean draw_init_machine( struct draw_context *draw )
-{
- ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_MAX_ATTRIBS);
- ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_MAX_ATTRIBS);
- machine->Inputs = ALIGN16_ASSIGN(inputs);
- machine->Outputs = ALIGN16_ASSIGN(outputs);
-}
-#endif