diff options
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_sampler.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_sampler.c b/src/gallium/drivers/softpipe/sp_state_sampler.c index 09b0ffc1da..79d9516ad9 100644 --- a/src/gallium/drivers/softpipe/sp_state_sampler.c +++ b/src/gallium/drivers/softpipe/sp_state_sampler.c @@ -350,23 +350,27 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe) } } - for (i = 0; i <= softpipe->gs->max_sampler; i++) { - if (softpipe->geometry_samplers[i]) { - struct pipe_resource *texture = NULL; - - if (softpipe->geometry_sampler_views[i]) { - texture = softpipe->geometry_sampler_views[i]->texture; + if (softpipe->gs) { + for (i = 0; i <= softpipe->gs->max_sampler; i++) { + if (softpipe->geometry_samplers[i]) { + struct pipe_resource *texture = NULL; + + if (softpipe->geometry_sampler_views[i]) { + texture = softpipe->geometry_sampler_views[i]->texture; + } + + softpipe->tgsi.geom_samplers_list[i] = + get_sampler_varient( + i, + sp_sampler(softpipe->geometry_samplers[i]), + texture, + TGSI_PROCESSOR_GEOMETRY ); + + sp_sampler_varient_bind_texture( + softpipe->tgsi.geom_samplers_list[i], + softpipe->geometry_tex_cache[i], + texture ); } - - softpipe->tgsi.geom_samplers_list[i] = - get_sampler_varient( i, - sp_sampler(softpipe->geometry_samplers[i]), - texture, - TGSI_PROCESSOR_GEOMETRY ); - - sp_sampler_varient_bind_texture( softpipe->tgsi.geom_samplers_list[i], - softpipe->geometry_tex_cache[i], - texture ); } } |