Portal:OpenGL Shading Language/Layout Qualifiers

From OpenGL Wiki
Jump to navigation Jump to search

Among the qualifiers that can be applied to variables, the most complex set are the layout qualifiers. These specify certain attributes of a variable definition, such as where it gets its data from, how it interacts with other variables, or how to interpret the data provided to this variable. They define the layout of the variable.

These qualifiers are useful for defining many attributes of variables that would otherwise have to be defined at program linking time or after the program is linked. Thus, they allow the shader to be more standalone. In general, if a layout qualifier conflicts with user-specified data, the layout qualifier wins.