aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_vs.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-05-13 13:40:22 +0100
committerKeith Whitwell <[email protected]>2008-05-23 09:16:55 +0100
commit2f0d1396e4c1626b3b1ac799bd29e86a9530369e (patch)
tree656eee841d239090fea83a5b50a2f600568a4bdc /src/gallium/auxiliary/draw/draw_vs.c
parentb23706454bb165a62888d264e95a98a2e4cf139c (diff)
draw: move some state into a new 'vs' area
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c
index 03fe00a9510..4142dd95891 100644
--- a/src/gallium/auxiliary/draw/draw_vs.c
+++ b/src/gallium/auxiliary/draw/draw_vs.c
@@ -66,13 +66,13 @@ draw_bind_vertex_shader(struct draw_context *draw,
if (dvs)
{
- draw->vertex_shader = dvs;
- draw->num_vs_outputs = dvs->info.num_outputs;
+ draw->vs.vertex_shader = dvs;
+ draw->vs.num_vs_outputs = dvs->info.num_outputs;
dvs->prepare( dvs, draw );
}
else {
- draw->vertex_shader = NULL;
- draw->num_vs_outputs = 0;
+ draw->vs.vertex_shader = NULL;
+ draw->vs.num_vs_outputs = 0;
}
}
@@ -83,3 +83,30 @@ draw_delete_vertex_shader(struct draw_context *draw,
{
dvs->delete( dvs );
}
+
+
+
+boolean
+draw_vs_init( struct draw_context *draw )
+{
+ tgsi_exec_machine_init(&draw->vs.machine);
+ /* FIXME: give this machine thing a proper constructor:
+ */
+ draw->vs.machine.Inputs = align_malloc(PIPE_MAX_ATTRIBS * sizeof(struct tgsi_exec_vector), 16);
+ draw->vs.machine.Outputs = align_malloc(PIPE_MAX_ATTRIBS * sizeof(struct tgsi_exec_vector), 16);
+
+ return TRUE;
+}
+
+void
+draw_vs_destroy( struct draw_context *draw )
+{
+ if (draw->vs.machine.Inputs)
+ align_free(draw->vs.machine.Inputs);
+
+ if (draw->vs.machine.Outputs)
+ align_free(draw->vs.machine.Outputs);
+
+ tgsi_exec_machine_free_data(&draw->vs.machine);
+
+}