uniform mediump; // ERROR
+layout(early_fragment_tests) in; // ERROR
+
float imageBuffer; // ERROR, reserved
float uimage2DRect; // ERROR, reserved
+
q[1] = pos;
}
-layout(location = 40) out float ca[4];
-layout(location = 41) out float cb[2]; // ERROR, overlap
-layout(location = 39) out float cc[6]; // ERROR, overlap
+layout(location = 40) out float ca[4]; // ERROR, overlap, ERROR too big
+layout(location = 41) out float cb[2]; // ERROR, overlap, ERROR too big
+layout(location = 39) out float cc[6]; // ERROR, overlap, ERROR too big
origi = atomicExchange(atomi, 4);\r
origu = atomicCompSwap(atomu, 10u, 8u);\r
}\r
+\r
+precision highp atomic_uint;\r
+precision lowp atomic_uint; // ERROR\r
+\r
+precise int pfoo; // ERROR, reserved\r
+\r
+dmat2x4 dm; // ERROR\r
+uniform samplerCubeArray sca; // ERROR\r
+uniform iimage2DRect i2dr; // ERROR\r
+uniform image2DMS i2dms; // ERROR\r
+uniform uimage2DMSArray u2dmsa; // ERROR\r
int foo;\r
layout(binding = 2) float f; // ERROR\r
} bbi;\r
+\r
+in centroid vec4 centroidIn;\r
+layout(location = 200000) uniform vec4 bigl; // ERROR, location too big\r
+\r
+layout(early_fragment_tests) in;\r
+\r
+layout(location = 40) out vec4 bigout1; // ERROR, too big\r
+layout(location = 40) out vec4 bigout2; // ERROR, overlap\r
+layout(location = -2) out vec4 neg; // ERROR, negative\r
+\r
+layout(std430) uniform b430 {\r
+ int i;\r
+} b430i;\r
+\r
+layout(shared) uniform bshar {\r
+ int i;\r
+} bshari;\r
+\r
+in smooth vec4 smoothIn;\r
+in flat int flatIn;\r
+\r
+uniform sampler2DMS s2dms;\r
+\r
+void foots()\r
+{\r
+ highp ivec2 v2 = textureSize(s1, 2);\r
+ highp ivec3 v3 = textureSize(isamp2DA, 3);\r
+ v2 = textureSize(s2dms);\r
+ v2 = imageSize(i2D);\r
+}\r
+\r
+out bool bout; // ERROR\r
+out image2D imageOut; // ERROR\r
+out mat2x3 mout; // ERROR\r
+\r
ERROR: 0:129: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]\r
ERROR: 0:129: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]\r
ERROR: 0:148: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type) \r
-ERROR: 0:150: 'imageBuffer' : Reserved word. \r
-ERROR: 0:150: '' : syntax error\r
-ERROR: 37 compilation errors. No code generated.\r
+ERROR: 0:150: 'early_fragment_tests' : not supported for this version or the enabled extensions \r
+ERROR: 0:152: 'imageBuffer' : Reserved word. \r
+ERROR: 0:152: '' : syntax error\r
+ERROR: 38 compilation errors. No code generated.\r
\r
\r
Shader version: 300\r
+using early_fragment_tests\r
ERROR: node is still EOpNull!\r
0:53 Function Definition: main( (void)\r
0:53 Function Parameters: \r
ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers\r
\r
Shader version: 300\r
+using early_fragment_tests\r
ERROR: node is still EOpNull!\r
0:53 Function Definition: main( (void)\r
0:53 Function Parameters: \r
300layout.frag\r
ERROR: 0:4: 'location qualifier on input' : not supported in this stage: fragment\r
ERROR: 0:4: 'location qualifier on input' : not supported for this version or the enabled extensions \r
+ERROR: 0:17: 'location' : too large for fragment output \r
+ERROR: 0:18: 'location' : too large for fragment output \r
ERROR: 0:18: 'location' : overlapping use of location 41\r
+ERROR: 0:19: 'location' : too large for fragment output \r
ERROR: 0:19: 'location' : overlapping use of location 40\r
-ERROR: 4 compilation errors. No code generated.\r
+ERROR: 7 compilation errors. No code generated.\r
\r
\r
Shader version: 300\r
ERROR: 0:141: 'binding' : cannot be greater-than-or-equal to gl_MaxAtomicCounterBindings \r
ERROR: 0:143: 'binding' : cannot be greater-than-or-equal to gl_MaxAtomicCounterBindings \r
ERROR: 0:149: '[]' : scalar integer expression required \r
-ERROR: 42 compilation errors. No code generated.\r
+ERROR: 0:166: 'precision' : can only apply highp to atomic_uint \r
+ERROR: 0:168: 'precise' : Reserved word. \r
+ERROR: 0:170: 'dmat2x4' : Reserved word. \r
+ERROR: 0:170: 'double matrix' : not supported with this profile: es\r
+ERROR: 0:171: 'samplerCubeArray' : Reserved word. \r
+ERROR: 0:171: 'sampler/image' : type requires declaration of default precision qualifier \r
+ERROR: 0:172: 'iimage2DRect' : Reserved word. \r
+ERROR: 0:172: 'sampler/image' : type requires declaration of default precision qualifier \r
+ERROR: 0:172: '' : image variables not declared 'writeonly' must have a format layout qualifier \r
+ERROR: 0:173: 'image2DMS' : Reserved word. \r
+ERROR: 0:173: '' : image variables not declared 'writeonly' must have a format layout qualifier \r
+ERROR: 0:174: 'uimage2DMSArray' : Reserved word. \r
+ERROR: 0:174: 'sampler/image' : type requires declaration of default precision qualifier \r
+ERROR: 0:174: '' : image variables not declared 'writeonly' must have a format layout qualifier \r
+ERROR: 56 compilation errors. No code generated.\r
\r
\r
Shader version: 310\r
0:? 'i' (uniform highp int)\r
0:? 'atomi' (shared highp int)\r
0:? 'atomu' (shared highp uint)\r
+0:? 'pfoo' (highp int)\r
+0:? 'dm' (2X4 matrix of double)\r
+0:? 'sca' (uniform mediump samplerCubeArray)\r
+0:? 'i2dr' (uniform mediump iimage2DRect)\r
+0:? 'i2dms' (uniform lowp image2DMS)\r
+0:? 'u2dmsa' (uniform mediump uimage2DMSArray)\r
\r
\r
Linked compute stage:\r
0:? 'i' (uniform highp int)\r
0:? 'atomi' (shared highp int)\r
0:? 'atomu' (shared highp uint)\r
+0:? 'pfoo' (highp int)\r
+0:? 'dm' (2X4 matrix of double)\r
+0:? 'sca' (uniform mediump samplerCubeArray)\r
+0:? 'i2dr' (uniform mediump iimage2DRect)\r
+0:? 'i2dms' (uniform lowp image2DMS)\r
+0:? 'u2dmsa' (uniform mediump uimage2DMSArray)\r
\r
ERROR: 0:45: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]\r
ERROR: 0:45: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]\r
ERROR: 0:69: 'binding' : requires block, or sampler/image, or atomic-counter type \r
-ERROR: 17 compilation errors. No code generated.\r
+ERROR: 0:73: 'location' : location is too large \r
+ERROR: 0:77: 'location' : too large for fragment output \r
+ERROR: 0:78: 'location' : too large for fragment output \r
+ERROR: 0:78: 'location' : overlapping use of location 40\r
+ERROR: 0:79: 'non-literal layout-id value' : not supported with this profile: es\r
+ERROR: 0:79: 'layout-id value' : cannot be negative \r
+ERROR: 0:92: 'sampler2DMS' : Reserved word. \r
+ERROR: 0:98: 'textureSize' : no matching overloaded function found \r
+ERROR: 0:98: 'assign' : cannot convert from 'const float' to 'highp 2-component vector of int'\r
+ERROR: 0:99: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter \r
+ERROR: 0:102: 'out' : cannot be bool \r
+ERROR: 0:103: 'image2D' : sampler/image types can only be used in uniform variables or function parameters: imageOut\r
+ERROR: 0:103: '' : image variables not declared 'writeonly' must have a format layout qualifier \r
+ERROR: 0:104: 'out' : cannot be a matrix \r
+ERROR: 31 compilation errors. No code generated.\r
\r
\r
Shader version: 310\r
+using early_fragment_tests\r
ERROR: node is still EOpNull!\r
0:21 Function Definition: main( (void)\r
0:21 Function Parameters: \r
0:60 'i' (uniform mediump int)\r
0:60 Construct bvec4 (4-component vector of bool)\r
0:60 'b' (bool)\r
+0:94 Function Definition: foots( (void)\r
+0:94 Function Parameters: \r
+0:96 Sequence\r
+0:96 Sequence\r
+0:96 move second child to first child (highp 2-component vector of int)\r
+0:96 'v2' (highp 2-component vector of int)\r
+0:96 Function Call: textureSize(s21;i1; (highp 2-component vector of int)\r
+0:96 's1' (layout(binding=3 ) uniform highp sampler2D)\r
+0:96 Constant:\r
+0:96 2 (const int)\r
+0:97 Sequence\r
+0:97 move second child to first child (highp 3-component vector of int)\r
+0:97 'v3' (highp 3-component vector of int)\r
+0:97 Function Call: textureSize(isA21;i1; (highp 3-component vector of int)\r
+0:97 'isamp2DA' (uniform highp isampler2DArray)\r
+0:97 Constant:\r
+0:97 3 (const int)\r
+0:98 'v2' (highp 2-component vector of int)\r
+0:99 move second child to first child (highp 2-component vector of int)\r
+0:99 'v2' (highp 2-component vector of int)\r
+0:99 Function Call: imageSize(I21; (highp 2-component vector of int)\r
+0:99 'i2D' (layout(binding=2 ) writeonly uniform highp image2D)\r
0:? Linker Objects\r
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)\r
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)\r
0:? 's2' (layout(binding=3 ) uniform highp sampler2D)\r
0:? 'i2D' (layout(binding=2 ) writeonly uniform highp image2D)\r
0:? 'bbi' (layout(binding=1 column_major shared ) uniform block{layout(column_major shared ) uniform mediump int foo, layout(binding=2 column_major shared ) uniform mediump float f})\r
+0:? 'centroidIn' (centroid smooth in mediump 4-component vector of float)\r
+0:? 'bigl' (uniform mediump 4-component vector of float)\r
+0:? 'bigout1' (layout(location=40 ) out mediump 4-component vector of float)\r
+0:? 'bigout2' (layout(location=40 ) out mediump 4-component vector of float)\r
+0:? 'neg' (out mediump 4-component vector of float)\r
+0:? 'b430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform mediump int i})\r
+0:? 'bshari' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform mediump int i})\r
+0:? 'smoothIn' (smooth in mediump 4-component vector of float)\r
+0:? 'flatIn' (flat in mediump int)\r
+0:? 's2dms' (uniform highp sampler2DMS)\r
+0:? 'bout' (out bool)\r
+0:? 'imageOut' (out highp image2D)\r
+0:? 'mout' (out mediump 2X3 matrix of float)\r
\r
\r
Linked fragment stage:\r
\r
+ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers\r
\r
Shader version: 310\r
+using early_fragment_tests\r
ERROR: node is still EOpNull!\r
0:21 Function Definition: main( (void)\r
0:21 Function Parameters: \r
0:60 'i' (uniform mediump int)\r
0:60 Construct bvec4 (4-component vector of bool)\r
0:60 'b' (bool)\r
+0:94 Function Definition: foots( (void)\r
+0:94 Function Parameters: \r
+0:96 Sequence\r
+0:96 Sequence\r
+0:96 move second child to first child (highp 2-component vector of int)\r
+0:96 'v2' (highp 2-component vector of int)\r
+0:96 Function Call: textureSize(s21;i1; (highp 2-component vector of int)\r
+0:96 's1' (layout(binding=3 ) uniform highp sampler2D)\r
+0:96 Constant:\r
+0:96 2 (const int)\r
+0:97 Sequence\r
+0:97 move second child to first child (highp 3-component vector of int)\r
+0:97 'v3' (highp 3-component vector of int)\r
+0:97 Function Call: textureSize(isA21;i1; (highp 3-component vector of int)\r
+0:97 'isamp2DA' (uniform highp isampler2DArray)\r
+0:97 Constant:\r
+0:97 3 (const int)\r
+0:98 'v2' (highp 2-component vector of int)\r
+0:99 move second child to first child (highp 2-component vector of int)\r
+0:99 'v2' (highp 2-component vector of int)\r
+0:99 Function Call: imageSize(I21; (highp 2-component vector of int)\r
+0:99 'i2D' (layout(binding=2 ) writeonly uniform highp image2D)\r
0:? Linker Objects\r
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)\r
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)\r
0:? 's2' (layout(binding=3 ) uniform highp sampler2D)\r
0:? 'i2D' (layout(binding=2 ) writeonly uniform highp image2D)\r
0:? 'bbi' (layout(binding=1 column_major shared ) uniform block{layout(column_major shared ) uniform mediump int foo, layout(binding=2 column_major shared ) uniform mediump float f})\r
+0:? 'centroidIn' (centroid smooth in mediump 4-component vector of float)\r
+0:? 'bigl' (uniform mediump 4-component vector of float)\r
+0:? 'bigout1' (layout(location=40 ) out mediump 4-component vector of float)\r
+0:? 'bigout2' (layout(location=40 ) out mediump 4-component vector of float)\r
+0:? 'neg' (out mediump 4-component vector of float)\r
+0:? 'b430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform mediump int i})\r
+0:? 'bshari' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform mediump int i})\r
+0:? 'smoothIn' (smooth in mediump 4-component vector of float)\r
+0:? 'flatIn' (flat in mediump int)\r
+0:? 's2dms' (uniform highp sampler2DMS)\r
+0:? 'bout' (out bool)\r
+0:? 'imageOut' (out highp image2D)\r
+0:? 'mout' (out mediump 2X3 matrix of float)\r
\r
+ Texture gather
+ Bitfield operations
+ Integer mix function
+ - overlapping bindings
+ - offset post incrementing
+ - overlapping offsets
+ - frexp/ldexp
+ - packUnorm4x8(),packSnorm4x8(), unpackUnorm4x8(), unpackSnorm4x8()
+ - 2DMS samplers and images
+ - inheritance of memory qualifiers in block members
GLSL 1.2
+ Handle multiple compilation units per stage
+ Allow initializers on uniform declarations
elements of the array.
- Arrays of arrays are now supported, as per the GL_ARB_arrays_of_arrays extension.
+ Compute shaders are now supported, as per the GL_ARB_compute_shader extension.
- - Added imageSize() built-ins to query the dimensions of an image.
+ + Added imageSize() built-ins to query the dimensions of an image.
- All choice of depth or stencil texturing, for a packed depth-stencil texture, as per the
GL_ARB_stencil_texturing extension.
- Allow explicit locations/indexes to be assigned to uniform variables and subroutines, as per the
if (publicType.basicType == EbtBool) {
error(loc, "cannot be bool", GetStorageQualifierString(qualifier.storage), "");
-
return;
}
profileRequires(loc, EEsProfile, 300, 0, "fragment shader output");
if (publicType.basicType == EbtStruct) {
error(loc, "cannot be a structure", GetStorageQualifierString(qualifier.storage), "");
-
+ return;
+ }
+ if (publicType.matrixRows > 0) {
+ error(loc, "cannot be a matrix", GetStorageQualifierString(qualifier.storage), "");
return;
}
break;
}
}
+ if (basicType == EbtAtomicUint) {
+ if (qualifier != EpqHigh)
+ error(loc, "can only apply highp to atomic_uint", "precision", "");
+
+ return;
+ }
+
error(loc, "cannot apply precision statement to this type; use 'float', 'int' or a sampler type", TType::getBasicString(basicType), "");
}
return;
}
if (id == "early_fragment_tests") {
- requireProfile(loc, ENoProfile | ECoreProfile | ECompatibilityProfile, "early_fragment_tests");
profileRequires(loc, ENoProfile | ECoreProfile | ECompatibilityProfile, 420, GL_ARB_shader_image_load_store, "early_fragment_tests");
+ profileRequires(loc, EEsProfile, 310, 0, "early_fragment_tests");
publicType.shaderQualifiers.earlyFragmentTests = true;
return;
}
error(loc, "cannot apply to a matrix, structure, or block", "component", "");
}
+ if (qualifier.storage == EvqVaryingOut && language == EShLangFragment) {
+ if (qualifier.layoutLocation >= (unsigned int)resources.maxDrawBuffers)
+ error(loc, "too large for fragment output", "location", "");
+ }
+
switch (qualifier.storage) {
case EvqVaryingIn:
case EvqVaryingOut:
return keyword;
case PRECISE:
- if (parseContext.profile == EEsProfile ||
+ if (parseContext.profile == EEsProfile && parseContext.version >= 310)
+ reservedWord();
+ else if (parseContext.profile == EEsProfile ||
(parseContext.profile != EEsProfile && parseContext.version < 400))
return identifierOrType();
return keyword;
{
afterType = true;
+ if (parseContext.profile == EEsProfile && parseContext.version >= 310) {
+ reservedWord();
+ return keyword;
+ }
+
if (parseContext.symbolTable.atBuiltInLevel() || parseContext.profile != EEsProfile && (parseContext.version >= 420 || parseContext.extensionsTurnedOn(1, &GL_ARB_shader_image_load_store)))
return keyword;