summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-03-09 20:17:02 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2008-03-09 20:23:05 +0000
commitaff4cf19a753baf0428d2bf53614900e5afea8a3 (patch)
treeed44d02f15313fb699a6be1980367664555ed08a /src/gallium
parentd8d6569e288fe3324473fb19ade798502dfbba8e (diff)
draw: cope with binding NULL vertex shader (on context delete, for instance)
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/draw/draw_vertex_shader.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vertex_shader.c b/src/gallium/auxiliary/draw/draw_vertex_shader.c
index 1e95355555..133418baca 100644
--- a/src/gallium/auxiliary/draw/draw_vertex_shader.c
+++ b/src/gallium/auxiliary/draw/draw_vertex_shader.c
@@ -110,13 +110,20 @@ draw_bind_vertex_shader(struct draw_context *draw,
struct draw_vertex_shader *dvs)
{
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
+
+ if (dvs)
+ {
+ draw->vertex_shader = dvs;
+ draw->num_vs_outputs = dvs->info.num_outputs;
- draw->vertex_shader = dvs;
- draw->num_vs_outputs = dvs->info.num_outputs;
+ tgsi_exec_machine_init(&draw->machine);
- tgsi_exec_machine_init(&draw->machine);
-
- dvs->prepare( dvs, draw );
+ dvs->prepare( dvs, draw );
+ }
+ else {
+ draw->vertex_shader = NULL;
+ draw->num_vs_outputs = 0;
+ }
}