[Mesa-dev] [PATCH 2/2] glsl: check for arrays of arrays when assigning explicit locations

Timothy Arceri timothy.arceri at collabora.com
Tue Oct 20 20:23:59 PDT 2015


This fixes assigning explicit locations in the CTS test:

ES31-CTS.explicit_uniform_location.uniform-loc-arrays-of-arrays

Cc: Tapani Pälli <tapani.palli at intel.com>
---
 Note: the test still fails, looks like some compute shader support is missing.

 src/glsl/link_uniforms.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index e80a247..8f62cfd 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -763,7 +763,8 @@ private:
       /* Assign explicit locations. */
       if (current_var->data.explicit_location) {
          /* Set sequential locations for struct fields. */
-         if (current_var->type->without_array()->is_record()) {
+         if (current_var->type->without_array()->is_record() ||
+             current_var->type->is_array_of_arrays()) {
             const unsigned entries = MAX2(1, this->uniforms[id].array_elements);
             this->uniforms[id].remap_location =
                this->explicit_location + field_counter;
-- 
2.4.3



More information about the mesa-dev mailing list