<div dir="ltr">Thanks for reviewing. I was actually hesitant about which list implementation to use since the changes affect <span style="font-size:12.8px">src/mesa/main/mtypes.h too. Thank you for clearing this up.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 11, 2016 at 8:02 PM, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Feb 11, 2016 at 8:31 AM, Plamena Manolova<br>
<<a href="mailto:plamena.manolova@intel.com">plamena.manolova@intel.com</a>> wrote:<br>
> This patch moves the calculation of current uniforms to<br>
> link_uniforms, which makes use of UniformRemapTable which<br>
> stores all the reserved uniform locations.<br>
><br>
> Location assignment for implicit uniforms now tries to use<br>
> any gaps left in the table after the location assignment<br>
> for explicit uniforms. This gives us more space to store more<br>
> uniforms.<br>
><br>
> Patch is based on earlier patch with following changes/additions:<br>
><br>
>    1: Move the counting of explicit locations to<br>
>       check_explicit_uniform_locations and then pass<br>
>       the number to link_assign_uniform_locations.<br>
>    2: Count the number of empty slots in UniformRemapTable<br>
>       and store them in a list_head.<br>
>    3: Try to find an empty slot for implicit locations from<br>
>       the list, if that fails resize UniformRemapTable.<br>
><br>
> Fixes following CTS tests:<br>
>    ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max<br>
>    ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max-array<br>
><br>
> Signed-off-by: Tapani Pälli <<a href="mailto:tapani.palli@intel.com">tapani.palli@intel.com</a>><br>
> Signed-off-by: Plamena Manolova <<a href="mailto:plamena.manolova@intel.com">plamena.manolova@intel.com</a>><br>
> Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=93696" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=93696</a><br>
> ---<br>
>  src/compiler/glsl/link_uniforms.cpp | 79 ++++++++++++++++++++++++++++++++-----<br>
>  src/compiler/glsl/linker.cpp        | 78 +++++++++++++++++++++++++-----------<br>
>  src/compiler/glsl/linker.h          | 17 +++++++-<br>
>  src/mesa/main/mtypes.h              |  8 ++++<br>
>  4 files changed, 147 insertions(+), 35 deletions(-)<br>
><br>
> diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp<br>
> index 7072c16..8192c21 100644<br>
> --- a/src/compiler/glsl/link_uniforms.cpp<br>
> +++ b/src/compiler/glsl/link_uniforms.cpp<br>
> @@ -1038,9 +1038,36 @@ assign_hidden_uniform_slot_id(const char *name, unsigned hidden_id,<br>
>     uniform_size->map->put(hidden_uniform_start + hidden_id, name);<br>
>  }<br>
><br>
> +/**<br>
> + * Search through the list of empty blocks to find one that fits the current<br>
> + * uniform.<br>
> + */<br>
> +static int<br>
> +find_empty_block(struct gl_shader_program *prog,<br>
> +                 struct gl_uniform_storage *uniform)<br>
> +{<br>
> +   const unsigned entries = MAX2(1, uniform->array_elements);<br>
> +<br>
> +   list_for_each_entry_safe(struct empty_uniform_block, block,<br>
> +                            &prog->EmptyUniformLocations, link) {<br>
<br>
</div></div>Please use exec_list in glsl code. That means embedding a "struct<br>
exec_node link" in empty_uniform_block instead of a head_link and<br>
iterating with  foreach_list_typed.<br>
<div class="HOEnZb"><div class="h5">---------------------------------------------------------------------<br>
Intel Corporation (UK) Limited<br>
Registered No. 1134945 (England)<br>
Registered Office: Pipers Way, Swindon SN3 1RJ<br>
VAT No: 860 2173 47<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.<br>
</div></div></blockquote></div><br></div>