Mesa (master): gallium/cso: check for set_vertex_sampler_views != NULL before calling it

Brian Paul brianp at kemper.freedesktop.org
Fri Jul 2 14:09:36 UTC 2010


Module: Mesa
Branch: master
Commit: e845765f0f8791a0e6c2e54b91ebf9f0e831d19f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e845765f0f8791a0e6c2e54b91ebf9f0e831d19f

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jul  2 08:07:34 2010 -0600

gallium/cso: check for set_vertex_sampler_views != NULL before calling it

Not all drivers implement this method.
Fixes regression reported by Chris Rankin and bug 28889.

---

 src/gallium/auxiliary/cso_cache/cso_context.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 2a85fe3..c1662df 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -290,7 +290,8 @@ void cso_release_all( struct cso_context *ctx )
       ctx->pipe->bind_vs_state( ctx->pipe, NULL );
       ctx->pipe->bind_vertex_elements_state( ctx->pipe, NULL );
       ctx->pipe->set_fragment_sampler_views(ctx->pipe, 0, NULL);
-      ctx->pipe->set_vertex_sampler_views(ctx->pipe, 0, NULL);
+      if (ctx->pipe->set_vertex_sampler_views)
+         ctx->pipe->set_vertex_sampler_views(ctx->pipe, 0, NULL);
    }
 
    for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {




More information about the mesa-commit mailing list