const float b = 2 * a1;
int a = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset;
}
+
+const int comma0 = (2, 3); // ERROR
+int comma1[(2, 3)]; // ERROR
layout(offset = 32) vec3 b; // ERROR\r
} spinste;\r
\r
-int aconste[gl_MaxTransformFeedbackBuffers]; // ERROR ??\r
+int aconste[gl_MaxTransformFeedbackBuffers]; // ERROR\r
int bconste[gl_MaxTransformFeedbackInterleavedComponents]; // ERROR\r
\r
out bblck2 {\r
ERROR: 0:85: 'textureGatherOffset(...)' : not supported for this version or the enabled extensions \r
WARNING: 0:88: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5\r
ERROR: 0:120: 'line continuation' : not supported for this version or the enabled extensions \r
-WARNING: 0:123: '#extension' : extension is only partially supported: GL_ARB_shading_language_420pack\r
ERROR: 0:126: 'uniform block' : not supported for this version or the enabled extensions \r
-ERROR: 0:138: 'gl_MinProgramTexelOffset' : undeclared identifier \r
-ERROR: 0:138: 'gl_MaxProgramTexelOffset' : undeclared identifier \r
ERROR: 0:140: 'length' : does not operate on this type: bool\r
ERROR: 0:140: 'boolb' : can't use function syntax on variable \r
ERROR: 0:141: 'length' : does not operate on this type: float\r
ERROR: 0:146: 'gl_FogFragCoord' : identifiers starting with "gl_" are reserved \r
ERROR: 0:151: 'int' : must be qualified as flat in\r
ERROR: 0:151: 'redeclaration' : cannot change the type of gl_FogFragCoord\r
-ERROR: 26 compilation errors. No code generated.\r
+ERROR: 24 compilation errors. No code generated.\r
\r
\r
Shader version: 130\r
0:138 'a' (3-component vector of float)\r
0:138 Constant:\r
0:138 0 (const int)\r
-0:138 add (float)\r
-0:138 'gl_MinProgramTexelOffset' (float)\r
-0:138 'gl_MaxProgramTexelOffset' (float)\r
+0:138 Constant:\r
+0:138 -1.000000\r
0:140 Constant:\r
0:140 0.000000\r
0:141 Constant:\r
0:138 'a' (3-component vector of float)\r
0:138 Constant:\r
0:138 0 (const int)\r
-0:138 add (float)\r
-0:138 'gl_MinProgramTexelOffset' (float)\r
-0:138 'gl_MaxProgramTexelOffset' (float)\r
+0:138 Constant:\r
+0:138 -1.000000\r
0:140 Constant:\r
0:140 0.000000\r
0:141 Constant:\r
ERROR: 0:85: 'patch' : not supported in this stage: vertex\r
ERROR: 0:85: '' : vertex input cannot be further qualified \r
ERROR: 0:86: 'patch' : not supported in this stage: vertex\r
-ERROR: 0:97: 'gl_MinProgramTexelOffset' : undeclared identifier \r
-ERROR: 0:97: 'gl_MaxProgramTexelOffset' : undeclared identifier \r
-ERROR: 0:97: '=' : cannot convert from 'float' to 'int'\r
+ERROR: 0:100: '=' : global const initializers must be constant 'const int'\r
+ERROR: 0:101: '' : constant expression required \r
+ERROR: 0:101: '' : array size must be a constant integer expression \r
ERROR: 33 compilation errors. No code generated.\r
\r
\r
0:96 Constant:\r
0:96 2.000000\r
0:96 'a1' (float)\r
+0:97 Sequence\r
+0:97 move second child to first child (int)\r
+0:97 'a' (int)\r
+0:97 Constant:\r
+0:97 -1 (const int)\r
0:? Linker Objects\r
0:? 'v2' (smooth out 2-component vector of float)\r
0:? 'bad' (in 10-element array of 4-component vector of float)\r
0:? 'anon@3' (out block{out implicitly-sized array of float gl_ClipDistance, })\r
0:? 'patchIn' (patch in 4-component vector of float)\r
0:? 'patchOut' (smooth patch out 4-component vector of float)\r
+0:? 'comma0' (int)\r
+0:? 'comma1' (1-element array of int)\r
0:? 'gl_VertexID' (gl_VertexId int)\r
0:? 'gl_InstanceID' (gl_InstanceId int)\r
\r
0:96 Constant:\r
0:96 2.000000\r
0:96 'a1' (float)\r
+0:97 Sequence\r
+0:97 move second child to first child (int)\r
+0:97 'a' (int)\r
+0:97 Constant:\r
+0:97 -1 (const int)\r
0:? Linker Objects\r
0:? 'v2' (smooth out 2-component vector of float)\r
0:? 'bad' (in 10-element array of 4-component vector of float)\r
0:? 'anon@3' (out block{out 1-element array of float gl_ClipDistance, })\r
0:? 'patchIn' (patch in 4-component vector of float)\r
0:? 'patchOut' (smooth patch out 4-component vector of float)\r
+0:? 'comma0' (int)\r
+0:? 'comma1' (1-element array of int)\r
0:? 'gl_VertexID' (gl_VertexId int)\r
0:? 'gl_InstanceID' (gl_InstanceId int)\r
\r
0:175 Function Definition: foo985( (void)\r
0:175 Function Parameters: \r
0:175 Sequence\r
-0:175 Constant:\r
-0:175 6 (const int)\r
+0:175 add (int)\r
+0:175 Constant:\r
+0:175 2 (const int)\r
+0:175 Comma (int)\r
+0:175 Constant:\r
+0:175 3 (const int)\r
+0:175 Constant:\r
+0:175 4 (const int)\r
0:? Linker Objects\r
0:? 'sum' (float)\r
0:? 'selected4' (int)\r
0:175 Function Definition: foo985( (void)\r
0:175 Function Parameters: \r
0:175 Sequence\r
-0:175 Constant:\r
-0:175 6 (const int)\r
+0:175 add (int)\r
+0:175 Constant:\r
+0:175 2 (const int)\r
+0:175 Comma (int)\r
+0:175 Constant:\r
+0:175 3 (const int)\r
+0:175 Constant:\r
+0:175 4 (const int)\r
0:? Linker Objects\r
0:? 'sum' (float)\r
0:? 'selected4' (int)\r
s.append(builtInConstant);
snprintf(builtInConstant, maxSize, "const int gl_MaxVaryingComponents = %d;", resources.maxVaryingComponents);
s.append(builtInConstant);
+
+ // GL_ARB_shading_language_420pack
+ snprintf(builtInConstant, maxSize, "const mediump int gl_MinProgramTexelOffset = %d;", resources.minProgramTexelOffset);
+ s.append(builtInConstant);
+ snprintf(builtInConstant, maxSize, "const mediump int gl_MaxProgramTexelOffset = %d;", resources.maxProgramTexelOffset);
+ s.append(builtInConstant);
}
// geometry
}
//
-// Add context-dependent (resource-specific) built-ins not yet handled. These
+// Add context-dependent (resource-specific) built-ins not handled by the above. These
// would be ones that need to be programmatically added because they cannot
// be added by simple text strings. For these, also
// 1) Map built-in functions to operators, for those that will turn into an operation node
symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &GL_ARB_enhanced_layouts);
symbolTable.setVariableExtensions("gl_MaxTransformFeedbackInterleavedComponents", 1, &GL_ARB_enhanced_layouts);
}
+ if (profile != EEsProfile && version >= 130 && version < 420) {
+ symbolTable.setVariableExtensions("gl_MinProgramTexelOffset", 1, &GL_ARB_shading_language_420pack);
+ symbolTable.setVariableExtensions("gl_MaxProgramTexelOffset", 1, &GL_ARB_shading_language_420pack);
+ }
switch(language) {
-
case EShLangFragment:
// Set up gl_FragData based on current array size.
if (version == 100 || IncludeLegacy(version, profile) || (! ForwardCompatibility && profile != EEsProfile && version < 420)) {
}
//
- // Need a new node holding things together then. Make
+ // Need a new node holding things together. Make
// one and promote it to the right type.
//
TIntermBinary* node = new TIntermBinary(op);
//
// If they are both constants, they must be folded.
+ // (Unless it's the sequence (comma) operator, but that's handled in addComma().)
//
TIntermConstantUnion *leftTempConstant = left->getAsConstantUnion();
TIntermTyped* TIntermediate::addComma(TIntermTyped* left, TIntermTyped* right, TSourceLoc loc)
{
- if (left->getType().getQualifier().storage == EvqConst &&
- right->getType().getQualifier().storage == EvqConst) {
+ // However, the lowest precedence operators of the sequence operator ( , ) and the assignment operators
+ // ... are not included in the operators that can create a constant expression.
+ //
+ //if (left->getType().getQualifier().storage == EvqConst &&
+ // right->getType().getQualifier().storage == EvqConst) {
- return right;
- } else {
- TIntermTyped *commaAggregate = growAggregate(left, right, loc);
- commaAggregate->getAsAggregate()->setOperator(EOpComma);
- commaAggregate->setType(right->getType());
- commaAggregate->getWritableType().getQualifier().makeTemporary();
+ // return right;
+ //}
- return commaAggregate;
- }
+ TIntermTyped *commaAggregate = growAggregate(left, right, loc);
+ commaAggregate->getAsAggregate()->setOperator(EOpComma);
+ commaAggregate->setType(right->getType());
+ commaAggregate->getWritableType().getQualifier().makeTemporary();
+
+ return commaAggregate;
}
TIntermTyped* TIntermediate::addMethod(TIntermTyped* object, const TType& type, const TString* name, TSourceLoc loc)
TSymbolTable& symbolTable)
{
TIntermediate intermediate(language, version, profile);
-
+
TParseContext parseContext(symbolTable, intermediate, true, version, profile, language, infoSink);
TPpContext ppContext(parseContext);
TScanContext scanContext(parseContext);
bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile)
{
TBuiltIns builtIns;
- builtIns.initialize(version, profile);
+ builtIns.initialize(version, profile);
// do the common tables
InitializeSymbolTable(builtIns.getCommonString(), version, profile, EShLangVertex, infoSink, *commonTable[EPcGeneral]);
{
TBuiltIns builtIns;
- builtIns.initialize(*resources, version, profile, language);
+ builtIns.initialize(*resources, version, profile, language);
InitializeSymbolTable(builtIns.getCommonString(), version, profile, language, infoSink, symbolTable);
- IdentifyBuiltIns(version, profile, language, symbolTable, *resources);
+ IdentifyBuiltIns(version, profile, language, symbolTable, *resources);
return true;
}
extensionBehavior[GL_ARB_texture_rectangle] = EBhDisable;
extensionBehavior[GL_3DL_array_objects] = EBhDisable;
- extensionBehavior[GL_ARB_shading_language_420pack] = EBhDisablePartial;
+ extensionBehavior[GL_ARB_shading_language_420pack] = EBhDisable;
extensionBehavior[GL_ARB_texture_gather] = EBhDisable;
extensionBehavior[GL_ARB_gpu_shader5] = EBhDisablePartial;
extensionBehavior[GL_ARB_separate_shader_objects] = EBhDisable;