*/
unsigned explicit_index:1;
+ /**
+ * Flag set if GL_ARB_enhanced_layouts "component" layout
+ * qualifier is used.
+ */
+ unsigned explicit_component:1;
+
/**
* Flag set if GL_ARB_shading_language_420pack "binding" layout
* qualifier is used.
*/
ast_expression *index;
+ /**
+ * Component specified via GL_ARB_enhaced_layouts
+ *
+ * \note
+ * This field is only valid if \c explicit_component is set.
+ */
+ ast_expression *component;
+
/** Maximum output vertices in GLSL 1.50 geometry shaders. */
ast_layout_expression *max_vertices;
if (q.flags.q.explicit_index)
this->index = q.index;
+ if (q.flags.q.explicit_component)
+ this->component = q.component;
+
if (q.flags.q.explicit_binding)
this->binding = q.binding;
$$.location = $3;
}
+ if (match_layout_qualifier("component", $1, state) == 0) {
+ if (!state->has_enhanced_layouts()) {
+ _mesa_glsl_error(& @1, state,
+ "component qualifier requires "
+ "GLSL 4.40 or ARB_enhanced_layouts");
+ } else {
+ $$.flags.q.explicit_component = 1;
+ $$.component = $3;
+ }
+ }
+
if (match_layout_qualifier("index", $1, state) == 0) {
if (state->es_shader && !state->EXT_blend_func_extended_enable) {
_mesa_glsl_error(& @3, state, "index layout qualifier requires EXT_blend_func_extended");