Skip to content

glsl: Handle .length() method on implicitly-sized arrays

Yevhenii Kolesnikov requested to merge GL/mesa:fix/unsized_array_length into main

ARB_shader_storage_buffer_object extension (promoted to core in 4.3) allows us to call .length() method on arrays declared without an explicit size. The length is determined at link time as a maximum array access.

Version 4.60.5 of the spec introduced a contradiction, disallowing the usage of .length() on implicitly-sized arrays:

From GLSL 4.60.7, section 1.1.3 "Changes from Revision 4 of GLSL 4.6":

 - Private GLSL issue 32: Remove length() method contradiction:
   Non runtime-sized arrays only support length() on explicitly sized arrays.

It was later concluded, that this change was incorrect (see private issue 32).

See also: !4131 (closed), piglit!239 (closed)

Merge request reports