python: Handle null state.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 19 Aug 2008 18:11:36 +0000 (19:11 +0100)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 19 Aug 2008 20:35:06 +0000 (21:35 +0100)
src/gallium/state_trackers/python/p_context.i

index 535783b6413c7a70ea5055ab2e9947c67a039647..496f738ad54b5d3dafdceaa826fbfe7edf5d4e6a 100644 (file)
@@ -68,6 +68,11 @@ struct st_context {
    void set_fragment_shader( const struct pipe_shader_state *state ) {
       void *fs;
       
+      if(!state) {
+         cso_set_fragment_shader_handle($self->cso, NULL);
+         return;
+      }
+      
       fs = $self->pipe->create_fs_state($self->pipe, state);
       if(!fs)
          return;
@@ -82,6 +87,11 @@ struct st_context {
    void set_vertex_shader( const struct pipe_shader_state *state ) {
       void *vs;
       
+      if(!state) {
+         cso_set_vertex_shader_handle($self->cso, NULL);
+         return;
+      }
+      
       vs = $self->pipe->create_vs_state($self->pipe, state);
       if(!vs)
          return;