[Mesa-dev] [PATCH] mesa: fix active sampler conflict validation for arrays

Timothy Arceri t_arceri at yahoo.com.au
Wed Jun 17 15:22:57 PDT 2015


The type stored in gl_uniform_storage is the type of a single array
element not the array type so size was always 1
---
 src/mesa/main/uniform_query.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

 Fixes new piglit test: http://lists.freedesktop.org/archives/piglit/2015-June/016270.html

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index cab5083..cd558ba 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -1101,15 +1101,14 @@ _mesa_sampler_uniforms_pipeline_are_valid(struct gl_pipeline_object *pipeline)
       for (unsigned i = 0; i < shProg[idx]->NumUniformStorage; i++) {
          const struct gl_uniform_storage *const storage =
             &shProg[idx]->UniformStorage[i];
-         const glsl_type *const t = (storage->type->is_array())
-            ? storage->type->fields.array : storage->type;
+         const glsl_type *const t = storage->type;
 
          if (!t->is_sampler())
             continue;
 
          active_samplers++;
 
-         const unsigned count = MAX2(1, storage->type->array_size());
+         const unsigned count = MAX2(1, storage->array_elements);
          for (unsigned j = 0; j < count; j++) {
             const unsigned unit = storage->storage[j].i;
 
-- 
2.1.0



More information about the mesa-dev mailing list