[Mesa-dev] [PATCH] glsl: non-last member unsized array on SSBO must fail compilation on GLSL ES 3.1

Kenneth Graunke kenneth at whitecape.org
Sat Feb 11 07:16:47 UTC 2017

On Friday, February 10, 2017 5:25:27 AM PST Jose Maria Casanova Crespo wrote:
> From GLSL ES 3.10 spec, section 4.1.9 "Arrays":
> "If an array is declared as the last member of a shader storage block
>  and the size is not specified at compile-time, it is sized at run-time.
>  In all other cases, arrays are sized only at compile-time."
> In desktop GLSL it is allowed to have unsized-arrays that are
> not last, as long as we can determine that they are implicitly
> sized, which is detected at link-time.
> With this patch Mesa reports a compilation error as glslang does with
> the following shader:
> buffer SSBO { vec4 data[]; vec4 moreData;};
> void main (void)
> {
> }
> Fixes:
> dEQP-GLES31.functional.debug.negative_coverage.log.shader.compile_compute_shader
> dEQP-GLES31.functional.debug.negative_coverage.callbacks.shader.compile_compute_shader
> dEQP-GLES31.functional.debug.negative_coverage.get_error.shader.compile_compute_shader
> Cc: "17.0" <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Jose Maria Casanova Crespo <jmcasanova at igalia.com>
> ---
>  src/compiler/glsl/ast_to_hir.cpp | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)

Thanks!  I missed this patch on the mailing list and independently
arrived at the same solution today, so we'll call that a:

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

and pushed:

To ssh://git.freedesktop.org/git/mesa/mesa
   0514b0bdc91..5bc222ebafd  master -> master
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170210/bb158991/attachment.sig>

More information about the mesa-dev mailing list