glsl: check for arrays of arrays when assigning explicit locations
authorTimothy Arceri <timothy.arceri@collabora.com>
Wed, 21 Oct 2015 02:44:10 +0000 (13:44 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Wed, 21 Oct 2015 04:49:32 +0000 (15:49 +1100)
This fixes assigning explicit locations in the CTS test:

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

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/glsl/link_uniforms.cpp

index 6efde5c27f2803ddec0cec79f12200e4e6b8ad27..8183e65d2f5d4e9d74828536c4325963e0e7cce4 100644 (file)
@@ -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;