Mesa (master): glsl: fix error checking against MAX_UNIFORM_LOCATIONS

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 23 22:07:30 UTC 2018


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Aug  8 15:53:10 2018 -0400

glsl: fix error checking against MAX_UNIFORM_LOCATIONS

Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>

---

 src/compiler/glsl/link_uniforms.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index 8d3f95fe11..434ecefb28 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -1209,8 +1209,12 @@ link_setup_uniform_remap_tables(struct gl_context *ctx,
       if (empty_locs)
          chosen_location = link_util_find_empty_block(prog, &prog->data->UniformStorage[i]);
 
-      /* Add new entries to the total amount of entries. */
-      total_entries += entries;
+      /* Add new entries to the total amount for checking against MAX_UNIFORM-
+       * _LOCATIONS. This only applies to the default uniform block (-1),
+       * because locations of uniform block entries are not assignable.
+       */
+      if (prog->data->UniformStorage[i].block_index == -1)
+         total_entries += entries;
 
       if (chosen_location != -1) {
          empty_locs -= entries;




More information about the mesa-commit mailing list