PDA

View Full Version : GLSL version for layout qualifier



DarkRaven
09-23-2011, 12:18 PM
I'd like to know when was layout qualifiers (layout in, layout out, etc.) introduced to GLSL (version number), and what was used prior to them to set for example in geometry shader output primitive type (which is now layout(triangle_strip) out).
Is it possible to enable this in earlier versions by setting some extension, or it's only defined by version used.

Also for next time, I'd like to ask where I can find similiar info - what was introduced in which version.

Alfonse Reinheart
09-23-2011, 01:40 PM
Geometry shaders were made core in 3.2, so that's GLSL version 1.50. Also, layout qualifiers were introduced in 3.1 (GLSL 1.40), but they could only be applied to uniforms.

And no, there is no way to use them before 1.50. The ARB_geometry_shader4 extension doesn't allow you to set the input and output primitive types in the actual shader itself. They are set as shader compilation parameters.


Also for next time, I'd like to ask where I can find similiar info - what was introduced in which version.

Read the OpenGL specifications (http://www.opengl.org/registry/). They have a pretty detailed history of what was incorporated into each version.

arekkusu
09-24-2011, 07:03 AM
In 2006, geometry shaders were exposed via EXT_geometry_shader4. The layout qualifier data was set via glProgramParameteriEXT().

See the wiki (http://www.opengl.org/wiki/Geometry_Shader).