Mesa (master): glsl: fix record type detection in explicit location assign

Tapani Pälli tpalli at kemper.freedesktop.org
Wed Oct 21 03:55:31 UTC 2015


Module: Mesa
Branch: master
Commit: a59c1adcc665b70ca5a8fbfebe3f0d6e05ad2778
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a59c1adcc665b70ca5a8fbfebe3f0d6e05ad2778

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Tue Oct 20 12:18:51 2015 +0300

glsl: fix record type detection in explicit location assign

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 at intel.com>
Reviewed-by: Marta Lofstedt <marta.lofstedt at intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

---

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

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index f7b87a1..6efde5c 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -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;




More information about the mesa-commit mailing list