Revert "glsl: fix resizing of the uniform remap table"
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 5 Mar 2020 03:51:20 +0000 (14:51 +1100)
committerMarge Bot <eric+marge@anholt.net>
Sat, 18 Apr 2020 11:50:44 +0000 (11:50 +0000)
This reverts commit e0aa0a839f9c168784a1f50013c83877cc876094.

Instead we fix it correctly in the following patch.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4623>

src/compiler/glsl/gl_nir_link_uniforms.c

index c859c2d0b55077d31a8869e1bb6d559451186a19..ef19ced288ce382e22b3c7465f9ea73d4f118585 100644 (file)
@@ -116,20 +116,16 @@ nir_setup_uniform_remap_tables(struct gl_context *ctx,
       unsigned location =
          link_util_find_empty_block(prog, &prog->data->UniformStorage[i]);
 
-      if (location == -1 || location + entries >= prog->NumUniformRemapTable) {
-         unsigned new_entries = entries;
-         if (location == -1)
-            location = prog->NumUniformRemapTable;
-         else
-            new_entries = location - prog->NumUniformRemapTable + entries;
+      if (location == -1) {
+         location = prog->NumUniformRemapTable;
 
          /* resize remap table to fit new entries */
          prog->UniformRemapTable =
             reralloc(prog,
                      prog->UniformRemapTable,
                      struct gl_uniform_storage *,
-                     prog->NumUniformRemapTable + new_entries);
-         prog->NumUniformRemapTable += new_entries;
+                     prog->NumUniformRemapTable + entries);
+         prog->NumUniformRemapTable += entries;
       }
 
       /* set the base location in remap table for the uniform */