aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2018-02-28 04:28:29 +0100
committerRoland Scheidegger <[email protected]>2018-02-28 18:22:28 +0100
commit26103487b54a1c1121132cc040927619cce45262 (patch)
treeea2b5ed8800653414fe98d813d97d461829ea7b3
parentb923f21eaadb77ee70e1bf4c5e2f9aee2a5fa205 (diff)
softpipe: don't iterate through PIPE_MAX_SHADER_SAMPLER_VIEWS
We were setting view to NULL if the iteration was larger than i. But in fact if the view is NULL the code did nothing anyway... Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
-rw-r--r--src/gallium/drivers/softpipe/sp_state_sampler.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_sampler.c b/src/gallium/drivers/softpipe/sp_state_sampler.c
index c10fd918fd8..751eb76e84b 100644
--- a/src/gallium/drivers/softpipe/sp_state_sampler.c
+++ b/src/gallium/drivers/softpipe/sp_state_sampler.c
@@ -181,8 +181,8 @@ prepare_shader_sampling(
if (!num)
return;
- for (i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) {
- struct pipe_sampler_view *view = i < num ? views[i] : NULL;
+ for (i = 0; i < num; i++) {
+ struct pipe_sampler_view *view = views[i];
if (view) {
struct pipe_resource *tex = view->texture;