Replaces PR #372.
layout(location = 50, component = 3) out int be;\r
layout(location = 50, component = 0) out vec3 bf;\r
\r
-//layout(location = 51, component = 1) out double dfo; // ERROR, odd component\r
-//layout(location = 52, component = 2) out dvec2 dvo; // ERROR, overflow\r
-//layout(location = 53) out double dfo2;\r
-//layout(location = 53, component = 2) out vec2 ffv2; // okay, fits\r
-//layout(location = 54) out dvec4 dvec4out; // uses up location 55 too\r
-//layout(location = 55) out float overf; // ERROR, collides with previous dvec4\r
-//layout(location = 56, component = 1) out vec2 df2o;\r
-//layout(location = 56, component = 3) out float sf2o;\r
-//layout(location = 57, component = 2) out vec2 dv3o;\r
-//layout(location = 57, component = 3) out float sf4o; // ERROR, overlapping component\r
+layout(location = 51, component = 1) out double dfo; // ERROR, odd component\r
+layout(location = 52, component = 2) out dvec2 dvo; // ERROR, overflow\r
+layout(location = 53) out double dfo2;\r
+layout(location = 53, component = 2) out vec2 ffv2; // okay, fits\r
+layout(location = 54) out dvec4 dvec4out; // uses up location 55 too\r
+layout(location = 55) out float overf; // ERROR, collides with previous dvec4\r
+layout(location = 56, component = 1) out vec2 df2o;\r
+layout(location = 56, component = 3) out float sf2o;\r
+layout(location = 57, component = 2) out vec2 dv3o;\r
+layout(location = 57, component = 3) out float sf4o; // ERROR, overlapping component\r
\r
out bblck1 {\r
vec4 bbv;\r
ERROR: 0:57: 'component' : cannot apply to a matrix, structure, or block
ERROR: 0:58: 'component' : cannot apply to a matrix, structure, or block
ERROR: 0:61: 'location/component/index' : cannot declare a default, use a full declaration
+ERROR: 0:66: 'component' : doubles cannot start on an odd-numbered component
+ERROR: 0:67: 'component' : type overflows the available 4 components
+ERROR: 0:71: 'location' : overlapping use of location 55
+ERROR: 0:75: 'location' : overlapping use of location 57
ERROR: 0:92: 'xfb layout qualifier' : can only be used on an output
ERROR: 0:98: 'xfb_offset' : cannot declare a default, use a full declaration
ERROR: 0:108: 'xfb_buffer' : member cannot contradict block (or what block inherited from global)
ERROR: 0:185: 'assign' : l-value required "gl_BaseInstanceARB" (can't modify shader input)
ERROR: 0:186: 'assign' : l-value required "gl_DrawIDARB" (can't modify shader input)
ERROR: 0:187: 'glBaseInstanceARB' : undeclared identifier
-ERROR: 49 compilation errors. No code generated.
+ERROR: 53 compilation errors. No code generated.
Shader version: 440
0:? 'bd' (out block{layout(location=40 component=2 ) out float u, layout(location=40 component=0 ) out float v, layout(location=40 component=3 ) out float w, layout(location=40 component=1 ) out 2-component vector of float x, layout(location=41 component=3 ) out 2-component vector of float y, layout(location=42 component=1 ) out 4-component vector of float z, layout(location=42 component=1 ) out 4X4 matrix of float ba, layout(location=43 component=1 ) out structure{global int a} Ss})
0:? 'be' (layout(location=50 component=3 ) smooth out int)
0:? 'bf' (layout(location=50 component=0 ) smooth out 3-component vector of float)
+0:? 'dfo' (layout(location=51 component=1 ) smooth out double)
+0:? 'dvo' (layout(location=52 component=2 ) smooth out 2-component vector of double)
+0:? 'dfo2' (layout(location=53 ) smooth out double)
+0:? 'ffv2' (layout(location=53 component=2 ) smooth out 2-component vector of float)
+0:? 'dvec4out' (layout(location=54 ) smooth out 4-component vector of double)
+0:? 'overf' (layout(location=55 ) smooth out float)
+0:? 'df2o' (layout(location=56 component=1 ) smooth out 2-component vector of float)
+0:? 'sf2o' (layout(location=56 component=3 ) smooth out float)
+0:? 'dv3o' (layout(location=57 component=2 ) smooth out 2-component vector of float)
+0:? 'sf4o' (layout(location=57 component=3 ) smooth out float)
0:? 'bbinst1' (out block{out 4-component vector of float bbv})
0:? 'bbinst2' (out block{layout(xfb_buffer=0 xfb_offset=64 ) out 4-component vector of float bbv})
0:? 'bbinst3' (out block{layout(xfb_buffer=3 xfb_offset=16 ) out 4-component vector of float bbv})
0:? 'bd' (out block{layout(location=40 component=2 ) out float u, layout(location=40 component=0 ) out float v, layout(location=40 component=3 ) out float w, layout(location=40 component=1 ) out 2-component vector of float x, layout(location=41 component=3 ) out 2-component vector of float y, layout(location=42 component=1 ) out 4-component vector of float z, layout(location=42 component=1 ) out 4X4 matrix of float ba, layout(location=43 component=1 ) out structure{global int a} Ss})
0:? 'be' (layout(location=50 component=3 ) smooth out int)
0:? 'bf' (layout(location=50 component=0 ) smooth out 3-component vector of float)
+0:? 'dfo' (layout(location=51 component=1 ) smooth out double)
+0:? 'dvo' (layout(location=52 component=2 ) smooth out 2-component vector of double)
+0:? 'dfo2' (layout(location=53 ) smooth out double)
+0:? 'ffv2' (layout(location=53 component=2 ) smooth out 2-component vector of float)
+0:? 'dvec4out' (layout(location=54 ) smooth out 4-component vector of double)
+0:? 'overf' (layout(location=55 ) smooth out float)
+0:? 'df2o' (layout(location=56 component=1 ) smooth out 2-component vector of float)
+0:? 'sf2o' (layout(location=56 component=3 ) smooth out float)
+0:? 'dv3o' (layout(location=57 component=2 ) smooth out 2-component vector of float)
+0:? 'sf4o' (layout(location=57 component=3 ) smooth out float)
0:? 'bbinst1' (out block{out 4-component vector of float bbv})
0:? 'bbinst2' (out block{layout(xfb_buffer=0 xfb_offset=64 ) out 4-component vector of float bbv})
0:? 'bbinst3' (out block{layout(xfb_buffer=3 xfb_offset=16 ) out 4-component vector of float bbv})
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
-#define GLSLANG_REVISION "SPIRV99.1331"
+#define GLSLANG_REVISION "SPIRV99.1332"
#define GLSLANG_DATE "21-Jul-2016"
}
if (qualifier.hasComponent()) {
// "It is a compile-time error if this sequence of components gets larger than 3."
- if (qualifier.layoutComponent + type.getVectorSize() > 4)
+ if (qualifier.layoutComponent + type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1) > 4)
error(loc, "type overflows the available 4 components", "component", "");
// "It is a compile-time error to apply the component qualifier to a matrix, a structure, a block, or an array containing any of these."
if (type.isMatrix() || type.getBasicType() == EbtBlock || type.getBasicType() == EbtStruct)
error(loc, "cannot apply to a matrix, structure, or block", "component", "");
+
+ // " It is a compile-time error to use component 1 or 3 as the beginning of a double or dvec2."
+ if (type.getBasicType() == EbtDouble)
+ if (qualifier.layoutComponent & 1)
+ error(loc, "doubles cannot start on an odd-numbered component", "component", "");
}
switch (qualifier.storage) {
size = computeTypeLocationSize(type);
}
+ // locations...
TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation + size - 1);
+
+ // components in this location slot...
TRange componentRange(0, 3);
- if (qualifier.hasComponent()) {
- componentRange.start = qualifier.layoutComponent;
- componentRange.last = componentRange.start + type.getVectorSize() - 1;
+ if (qualifier.hasComponent() || type.getVectorSize() > 0) {
+ int consumedComponents = type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1);
+ if (qualifier.hasComponent())
+ componentRange.start = qualifier.layoutComponent;
+ componentRange.last = componentRange.start + consumedComponents - 1;
}
+
+ // both...
TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.layoutIndex : 0);
// check for collisions, except for vertex inputs on desktop