glsl: fix record type detection in explicit location assign
authorTapani Pälli <tapani.palli@intel.com>
Tue, 20 Oct 2015 09:18:51 +0000 (12:18 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Wed, 21 Oct 2015 03:12:15 +0000 (06:12 +0300)
Check current_var directly instead of using the passed in record_type.

This fixes following failing CTS test:
ES31-CTS.explicit_uniform_location.uniform-loc-types-structs

No Piglit regressions.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/glsl/link_uniforms.cpp

index f7b87a1811a972214aa91e70fe032d698309265c..6efde5c27f2803ddec0cec79f12200e4e6b8ad27 100644 (file)
@@ -763,7 +763,7 @@ private:
       /* Assign explicit locations. */
       if (current_var->data.explicit_location) {
          /* Set sequential locations for struct fields. */
-         if (record_type != NULL) {
+         if (current_var->type->without_array()->is_record()) {
             const unsigned entries = MAX2(1, this->uniforms[id].array_elements);
             this->uniforms[id].remap_location =
                this->explicit_location + field_counter;