[Mesa-dev] [PATCH] st/mesa: remove extra calculation of sampler count

Timothy Arceri t_arceri at yahoo.com.au
Tue May 20 00:08:02 PDT 2014


This code was introduced in 5b542681dc05b8b9eba677ee74323ac0ff85a5f0 to fix https://bugs.freedesktop.org/show_bug.cgi?id=53617 however llvmpipe (and others) no longer return early if the count doesnt include old views as of around 177c9be61535a66607e0de9b0ecf00c8d5d451ac. 
Also I believe 2355a6441435b8e66a032c44f0794066338e30a3 passes the correct count but from a better location anyway.

Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
---
 src/mesa/state_tracker/st_atom_texture.c | 11 ++---------
 1 file 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 afc6d9d..2ce88e0 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -354,7 +354,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;
@@ -383,16 +383,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);
 }
 
-- 
1.9.0



More information about the mesa-dev mailing list