summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2010-06-15 06:12:56 -0400
committerZack Rusin <zackr@vmware.com>2010-06-15 09:12:19 -0400
commit92e521a79982f19279f72c34772d33c9c28e2bed (patch)
tree42dd783e186dedb23e4bf8cabeedb9e424d0a3dc /src
parentb85a361ccbac956d2842251395c048a4b3f4c440 (diff)
softpipe/gs: fix a crash when a gs isn't present
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_sampler.c36
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 );
}
}