GLSL version 1.20 errors on float array constructors

Number:rdar://6121615 Date Originated:03-Aug-2008 02:12 PM
Status:Duplicate/5183554 Resolved:
Product:Mac OS X Product Version:10.5.4
Classification:Other Bug Reproducible:Always
03-Aug-2008 02:12 PM Paul Sargent:
The GL Shading Language Specification says that arrays of floats can be created using a constructor. The Apple implementation fails.

Steps to Reproduce:
Open OpenGL Shader Builder
New Vertex Shader
Cut and past in the following code 

#version 120

void main()
	float a[5] = float[5](3.4, 4.2, 5.0, 5.2, 1.1); 
	gl_FrontColor = gl_Color;
	gl_TexCoord[0] = gl_MultiTexCoord0;
	gl_Position = ftransform();

Expected Results:
The shader should compile

Actual Results:
The following error messages are given

ERROR: 0:5: 'array of float' : constructor not supported for type 
ERROR: 0:5: 'array of float' : no matching overloaded function found 
ERROR: 0:5: 'a' : redefinition 

The shader is the default shader in shader builder, with the #version added, and the float array declaration. The array declaration is copied directly out of the GL Shading Language Specification Version 1.20r6 page 19. It's the 2nd line of code from the bottom of the page.


Still not fixed (opportunity missed with 'Snow Leopard Graphics Update')

The August "Snow Leopard Graphics Update" -- -- has been missed as an opportunity to fix the Apple OpenGL non-compliance with GLSL version 1.20.

Reproduction steps above still cause an error after this update....

Still not fixed in 10.6.3

...which was meant to be the big OpenGL fix release.

Really disappointing

Apple need to fix this basic oversight of theirs.

I understand one partial workaround for short arrays (<=4 items) is here:; but it's not going to solve the problem for the great majority of Apple OpenGL developers who need to use GLSL arrays.

Still on 10.6.2

Over a year later, this bug is still not solved.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!