summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
index 1ea59ea222c..63cf610ecad 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
@@ -96,15 +96,14 @@ lp_sampler_static_state(struct lp_sampler_static_state *state,
const struct pipe_sampler_view *view,
const struct pipe_sampler_state *sampler)
{
- const struct pipe_resource *texture = view->texture;
+ const struct pipe_resource *texture;
memset(state, 0, sizeof *state);
- if(!texture)
+ if (!sampler || !view || !view->texture)
return;
- if(!sampler)
- return;
+ texture = view->texture;
/*
* We don't copy sampler state over unless it is actually enabled, to avoid