cso: check if pipe_context::bind_vertex_sampler_states is non-null
authorBrian Paul <brianp@vmware.com>
Wed, 2 Dec 2009 19:24:24 +0000 (12:24 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 2 Dec 2009 19:24:27 +0000 (12:24 -0700)
Fixes segfaults upon exit when the CSO module is releasing its objects.

src/gallium/auxiliary/cso_cache/cso_context.c

index b6f7b883224f4fcfa0958c86df3eb10e2ade3eb2..80bd0c91db0c145fa72894854d0e44ba2a08d387 100644 (file)
@@ -260,7 +260,8 @@ void cso_release_all( struct cso_context *ctx )
       ctx->pipe->bind_blend_state( ctx->pipe, NULL );
       ctx->pipe->bind_rasterizer_state( ctx->pipe, NULL );
       ctx->pipe->bind_fragment_sampler_states( ctx->pipe, 0, NULL );
-      ctx->pipe->bind_vertex_sampler_states(ctx->pipe, 0, NULL);
+      if (ctx->pipe->bind_vertex_sampler_states)
+         ctx->pipe->bind_vertex_sampler_states(ctx->pipe, 0, NULL);
       ctx->pipe->bind_depth_stencil_alpha_state( ctx->pipe, NULL );
       ctx->pipe->bind_fs_state( ctx->pipe, NULL );
       ctx->pipe->bind_vs_state( ctx->pipe, NULL );