summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2014-06-07 12:02:56 +1000
committerTimothy Arceri <[email protected]>2014-06-07 12:21:19 +1000
commit1454f894ff0df7eb3021584f0d1c1baa70444da5 (patch)
treeeb7bcd58d8a98e1012a1a89b6c867d0c9f5b608d
parentd588a4919b732246b7aa26685ef65545929a4f7b (diff)
st/mesa: remove extra calculation of sampler count
This code was originally introduced to fix https://bugs.freedesktop.org/show_bug.cgi?id=53617. The comment says you need to pass NULL in order to unref old views however cso_set_sampler_views() already takes care of old views with the second for loop. Also as of 2355a6441435b8e66a032c44f0794066338e30a3 cso_set_sampler_views() passes the max of the old and new views to the driver for all state trackers making this code obsolete. Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index 928a4ffd2a3..e2d26ee246a 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -358,7 +358,7 @@ update_textures(struct st_context *st,
{
const GLuint old_max = *num_textures;
GLbitfield samplers_used = prog->SamplersUsed;
- GLuint unit, new_count;
+ GLuint unit;
if (samplers_used == 0x0 && old_max == 0)
return;
@@ -387,16 +387,9 @@ update_textures(struct st_context *st,
pipe_sampler_view_reference(&(sampler_views[unit]), sampler_view);
}
- /* Ex: if old_max = 3 and *num_textures = 1, we need to pass an
- * array of views={X, NULL, NULL} to unref the old texture views
- * at positions [1] and [2].
- */
- new_count = MAX2(*num_textures, old_max);
- assert(new_count <= max_units);
-
cso_set_sampler_views(st->cso_context,
shader_stage,
- new_count,
+ *num_textures,
sampler_views);
}