layout(location=3) in vec4 vl; // ERROR
+layout(location = 3) out vec4 factorBad; // ERROR
+
+#extension GL_ARB_explicit_attrib_location : enable
+
+layout(location = 5) out vec4 factor;
+
#extension GL_ARB_separate_shader_objects : enable
layout(location=4) in vec4 vl2;
\r
out vec4 gl_Position; // ERROR\r
\r
+layout(location = 9) in vec4 locBad; // ERROR\r
+\r
+#extension GL_ARB_explicit_attrib_location : enable\r
+\r
+layout(location = 9) in vec4 loc;\r
+\r
#extension GL_ARB_separate_shader_objects : enable\r
\r
out vec4 gl_Position;\r
ERROR: 0:20: 'fragment-shader struct input' : not supported for this version or the enabled extensions \r
ERROR: 0:24: 'location' : not supported for this version or the enabled extensions \r
ERROR: 0:24: 'location qualifier on input' : not supported for this version or the enabled extensions \r
-ERROR: 0:32: 'assign' : l-value required "v" (can't modify shader input)\r
-ERROR: 0:32: 'out' : Non-L-value cannot be passed for 'out' or 'inout' parameters. \r
-ERROR: 6 compilation errors. No code generated.\r
+ERROR: 0:26: 'location' : not supported for this version or the enabled extensions \r
+ERROR: 0:26: 'location qualifier on output' : not supported for this version or the enabled extensions \r
+WARNING: 0:28: '#extension' : extension is only partially supported: GL_ARB_explicit_attrib_location\r
+ERROR: 0:38: 'assign' : l-value required "v" (can't modify shader input)\r
+ERROR: 0:38: 'out' : Non-L-value cannot be passed for 'out' or 'inout' parameters. \r
+ERROR: 8 compilation errors. No code generated.\r
\r
\r
Shader version: 140\r
+Requested GL_ARB_explicit_attrib_location\r
Requested GL_ARB_separate_shader_objects\r
ERROR: node is still EOpNull!\r
0:10 Function Definition: main( (void)\r
0:22 'patch' (float)\r
0:22 Constant:\r
0:22 3.100000\r
-0:30 Function Definition: foo( (void)\r
-0:30 Function Parameters: \r
-0:32 Sequence\r
-0:32 Sequence\r
-0:32 move second child to first child (2-component vector of float)\r
-0:32 'r1' (2-component vector of float)\r
-0:32 modf (2-component vector of float)\r
-0:32 vector swizzle (2-component vector of float)\r
-0:32 'v' (smooth in 4-component vector of float)\r
-0:32 Sequence\r
-0:32 Constant:\r
-0:32 0 (const int)\r
-0:32 Constant:\r
-0:32 1 (const int)\r
-0:32 vector swizzle (2-component vector of float)\r
-0:32 'v' (smooth in 4-component vector of float)\r
-0:32 Sequence\r
-0:32 Constant:\r
-0:32 2 (const int)\r
-0:32 Constant:\r
-0:32 3 (const int)\r
-0:33 Sequence\r
-0:33 move second child to first child (2-component vector of float)\r
-0:33 'r2' (2-component vector of float)\r
-0:33 modf (2-component vector of float)\r
-0:33 vector swizzle (2-component vector of float)\r
-0:33 'o' (out 4-component vector of float)\r
-0:33 Sequence\r
-0:33 Constant:\r
-0:33 0 (const int)\r
-0:33 Constant:\r
-0:33 1 (const int)\r
-0:33 vector swizzle (2-component vector of float)\r
-0:33 'o' (out 4-component vector of float)\r
-0:33 Sequence\r
-0:33 Constant:\r
-0:33 2 (const int)\r
-0:33 Constant:\r
-0:33 3 (const int)\r
+0:36 Function Definition: foo( (void)\r
+0:36 Function Parameters: \r
+0:38 Sequence\r
+0:38 Sequence\r
+0:38 move second child to first child (2-component vector of float)\r
+0:38 'r1' (2-component vector of float)\r
+0:38 modf (2-component vector of float)\r
+0:38 vector swizzle (2-component vector of float)\r
+0:38 'v' (smooth in 4-component vector of float)\r
+0:38 Sequence\r
+0:38 Constant:\r
+0:38 0 (const int)\r
+0:38 Constant:\r
+0:38 1 (const int)\r
+0:38 vector swizzle (2-component vector of float)\r
+0:38 'v' (smooth in 4-component vector of float)\r
+0:38 Sequence\r
+0:38 Constant:\r
+0:38 2 (const int)\r
+0:38 Constant:\r
+0:38 3 (const int)\r
+0:39 Sequence\r
+0:39 move second child to first child (2-component vector of float)\r
+0:39 'r2' (2-component vector of float)\r
+0:39 modf (2-component vector of float)\r
+0:39 vector swizzle (2-component vector of float)\r
+0:39 'o' (out 4-component vector of float)\r
+0:39 Sequence\r
+0:39 Constant:\r
+0:39 0 (const int)\r
+0:39 Constant:\r
+0:39 1 (const int)\r
+0:39 vector swizzle (2-component vector of float)\r
+0:39 'o' (out 4-component vector of float)\r
+0:39 Sequence\r
+0:39 Constant:\r
+0:39 2 (const int)\r
+0:39 Constant:\r
+0:39 3 (const int)\r
0:? Linker Objects\r
0:? 'v' (smooth in 4-component vector of float)\r
0:? 'i' (smooth in 4-component vector of float)\r
0:? 's' (smooth in structure{float f})\r
0:? 'patch' (float)\r
0:? 'vl' (layout(location=3 ) smooth in 4-component vector of float)\r
+0:? 'factorBad' (layout(location=3 ) out 4-component vector of float)\r
+0:? 'factor' (layout(location=5 ) out 4-component vector of float)\r
0:? 'vl2' (layout(location=4 ) smooth in 4-component vector of float)\r
\r
\r
\r
\r
Shader version: 140\r
+Requested GL_ARB_explicit_attrib_location\r
Requested GL_ARB_separate_shader_objects\r
ERROR: node is still EOpNull!\r
0:10 Function Definition: main( (void)\r
0:22 'patch' (float)\r
0:22 Constant:\r
0:22 3.100000\r
-0:30 Function Definition: foo( (void)\r
-0:30 Function Parameters: \r
-0:32 Sequence\r
-0:32 Sequence\r
-0:32 move second child to first child (2-component vector of float)\r
-0:32 'r1' (2-component vector of float)\r
-0:32 modf (2-component vector of float)\r
-0:32 vector swizzle (2-component vector of float)\r
-0:32 'v' (smooth in 4-component vector of float)\r
-0:32 Sequence\r
-0:32 Constant:\r
-0:32 0 (const int)\r
-0:32 Constant:\r
-0:32 1 (const int)\r
-0:32 vector swizzle (2-component vector of float)\r
-0:32 'v' (smooth in 4-component vector of float)\r
-0:32 Sequence\r
-0:32 Constant:\r
-0:32 2 (const int)\r
-0:32 Constant:\r
-0:32 3 (const int)\r
-0:33 Sequence\r
-0:33 move second child to first child (2-component vector of float)\r
-0:33 'r2' (2-component vector of float)\r
-0:33 modf (2-component vector of float)\r
-0:33 vector swizzle (2-component vector of float)\r
-0:33 'o' (out 4-component vector of float)\r
-0:33 Sequence\r
-0:33 Constant:\r
-0:33 0 (const int)\r
-0:33 Constant:\r
-0:33 1 (const int)\r
-0:33 vector swizzle (2-component vector of float)\r
-0:33 'o' (out 4-component vector of float)\r
-0:33 Sequence\r
-0:33 Constant:\r
-0:33 2 (const int)\r
-0:33 Constant:\r
-0:33 3 (const int)\r
+0:36 Function Definition: foo( (void)\r
+0:36 Function Parameters: \r
+0:38 Sequence\r
+0:38 Sequence\r
+0:38 move second child to first child (2-component vector of float)\r
+0:38 'r1' (2-component vector of float)\r
+0:38 modf (2-component vector of float)\r
+0:38 vector swizzle (2-component vector of float)\r
+0:38 'v' (smooth in 4-component vector of float)\r
+0:38 Sequence\r
+0:38 Constant:\r
+0:38 0 (const int)\r
+0:38 Constant:\r
+0:38 1 (const int)\r
+0:38 vector swizzle (2-component vector of float)\r
+0:38 'v' (smooth in 4-component vector of float)\r
+0:38 Sequence\r
+0:38 Constant:\r
+0:38 2 (const int)\r
+0:38 Constant:\r
+0:38 3 (const int)\r
+0:39 Sequence\r
+0:39 move second child to first child (2-component vector of float)\r
+0:39 'r2' (2-component vector of float)\r
+0:39 modf (2-component vector of float)\r
+0:39 vector swizzle (2-component vector of float)\r
+0:39 'o' (out 4-component vector of float)\r
+0:39 Sequence\r
+0:39 Constant:\r
+0:39 0 (const int)\r
+0:39 Constant:\r
+0:39 1 (const int)\r
+0:39 vector swizzle (2-component vector of float)\r
+0:39 'o' (out 4-component vector of float)\r
+0:39 Sequence\r
+0:39 Constant:\r
+0:39 2 (const int)\r
+0:39 Constant:\r
+0:39 3 (const int)\r
0:? Linker Objects\r
0:? 'v' (smooth in 4-component vector of float)\r
0:? 'i' (smooth in 4-component vector of float)\r
0:? 's' (smooth in structure{float f})\r
0:? 'patch' (float)\r
0:? 'vl' (layout(location=3 ) smooth in 4-component vector of float)\r
+0:? 'factorBad' (layout(location=3 ) out 4-component vector of float)\r
+0:? 'factor' (layout(location=5 ) out 4-component vector of float)\r
0:? 'vl2' (layout(location=4 ) smooth in 4-component vector of float)\r
\r
140.vert\r
ERROR: 0:23: 'gl_Position' : identifiers starting with "gl_" are reserved \r
-ERROR: 0:28: 'redeclaration' : cannot change storage, memory, or auxiliary qualification of gl_Position\r
-ERROR: 0:28: 'redeclaration' : cannot change interpolation qualification of gl_Position\r
-ERROR: 0:29: 'redeclaration' : cannot change the type of gl_Position\r
-ERROR: 0:32: 'gl_ClipVertex' : cannot redeclare after use \r
-ERROR: 0:33: 'gl_FogFragCoord' : cannot redeclare after use \r
-ERROR: 6 compilation errors. No code generated.\r
+ERROR: 0:25: 'location' : not supported for this version or the enabled extensions \r
+ERROR: 0:25: 'location qualifier on input' : not supported for this version or the enabled extensions \r
+WARNING: 0:27: '#extension' : extension is only partially supported: GL_ARB_explicit_attrib_location\r
+ERROR: 0:34: 'redeclaration' : cannot change storage, memory, or auxiliary qualification of gl_Position\r
+ERROR: 0:34: 'redeclaration' : cannot change interpolation qualification of gl_Position\r
+ERROR: 0:35: 'redeclaration' : cannot change the type of gl_Position\r
+ERROR: 0:38: 'gl_ClipVertex' : cannot redeclare after use \r
+ERROR: 0:39: 'gl_FogFragCoord' : cannot redeclare after use \r
+ERROR: 8 compilation errors. No code generated.\r
\r
\r
Shader version: 140\r
+Requested GL_ARB_explicit_attrib_location\r
Requested GL_ARB_separate_shader_objects\r
ERROR: node is still EOpNull!\r
0:9 Function Definition: main( (void)\r
0:? 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 offset=0 ) uniform int anonMem})\r
0:? 'gl_TexCoord' (smooth out implicitly-sized array of 4-component vector of float)\r
0:? 'gl_Position' (smooth out 4-component vector of float)\r
+0:? 'locBad' (layout(location=9 ) in 4-component vector of float)\r
+0:? 'loc' (layout(location=9 ) in 4-component vector of float)\r
0:? 'gl_PointSize' (gl_PointSize float)\r
0:? 'gl_PointSize' (gl_PointSize float)\r
0:? 'gl_ClipVertex' (gl_ClipVertex 4-component vector of float)\r
\r
\r
Shader version: 140\r
+Requested GL_ARB_explicit_attrib_location\r
Requested GL_ARB_separate_shader_objects\r
ERROR: node is still EOpNull!\r
0:9 Function Definition: main( (void)\r
0:? 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 offset=0 ) uniform int anonMem})\r
0:? 'gl_TexCoord' (smooth out 1-element array of 4-component vector of float)\r
0:? 'gl_Position' (smooth out 4-component vector of float)\r
+0:? 'locBad' (layout(location=9 ) in 4-component vector of float)\r
+0:? 'loc' (layout(location=9 ) in 4-component vector of float)\r
0:? 'gl_PointSize' (gl_PointSize float)\r
0:? 'gl_PointSize' (gl_PointSize float)\r
0:? 'gl_ClipVertex' (gl_ClipVertex 4-component vector of float)\r
return;
} else if (id == "location") {
profileRequires(loc, EEsProfile, 300, 0, "location");
- profileRequires(loc, ~EEsProfile, 330, GL_ARB_separate_shader_objects, "location");
+ const char* exts[2] = { GL_ARB_separate_shader_objects, GL_ARB_explicit_attrib_location };
+ profileRequires(loc, ~EEsProfile, 330, 2, exts, "location");
if ((unsigned int)value >= TQualifier::layoutLocationEnd)
error(loc, "location is too large", id.c_str(), "");
else
if (profile == EEsProfile)
requireStage(loc, EShLangVertex, feature);
requireStage(loc, (EShLanguageMask)~EShLangComputeMask, feature);
- if (language == EShLangVertex)
- profileRequires(loc, ~EEsProfile, 330, GL_ARB_separate_shader_objects, feature);
- else
+ if (language == EShLangVertex) {
+ const char* exts[2] = { GL_ARB_separate_shader_objects, GL_ARB_explicit_attrib_location };
+ profileRequires(loc, ~EEsProfile, 330, 2, exts, feature);
+ } else
profileRequires(loc, ~EEsProfile, 410, GL_ARB_separate_shader_objects, feature);
break;
}
if (profile == EEsProfile)
requireStage(loc, EShLangFragment, feature);
requireStage(loc, (EShLanguageMask)~EShLangComputeMask, feature);
- if (language == EShLangFragment)
- profileRequires(loc, ~EEsProfile, 330, GL_ARB_separate_shader_objects, feature);
- else
+ if (language == EShLangFragment) {
+ const char* exts[2] = { GL_ARB_separate_shader_objects, GL_ARB_explicit_attrib_location };
+ profileRequires(loc, ~EEsProfile, 330, 2, exts, feature);
+ } else
profileRequires(loc, ~EEsProfile, 410, GL_ARB_separate_shader_objects, feature);
break;
}
extensionBehavior[GL_EXT_frag_depth] = EBhDisable;
extensionBehavior[GL_OES_EGL_image_external] = EBhDisable;
extensionBehavior[GL_EXT_shader_texture_lod] = EBhDisable;
- extensionBehavior[GL_ARB_shader_texture_lod] = EBhDisable;
extensionBehavior[GL_ARB_texture_rectangle] = EBhDisable;
extensionBehavior[GL_3DL_array_objects] = EBhDisable;
extensionBehavior[GL_ARB_tessellation_shader] = EBhDisable;
extensionBehavior[GL_ARB_enhanced_layouts] = EBhDisable;
extensionBehavior[GL_ARB_texture_cube_map_array] = EBhDisable;
+ extensionBehavior[GL_ARB_shader_texture_lod] = EBhDisable;
+ extensionBehavior[GL_ARB_explicit_attrib_location] = EBhDisablePartial; // "index" for fragment outputs is missing
}
// Get code that is not part of a shared symbol table, is specific to this shader,
"#define GL_ARB_tessellation_shader 1\n"
"#define GL_ARB_enhanced_layouts 1\n"
"#define GL_ARB_texture_cube_map_array 1\n"
- "#define GL_ARB_shader_texture_lod 1\n";
+ "#define GL_ARB_shader_texture_lod 1\n"
+ "#define GL_ARB_explicit_attrib_location 1\n";
}
}
const char* const GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layouts";
const char* const GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array";
const char* const GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod";
+const char* const GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location";
} // end namespace glslang