Lines Matching refs:qualifier
32 bool IsVaryingOut(TQualifier qualifier)
34 switch(qualifier)
49 bool IsVaryingIn(TQualifier qualifier)
51 switch(qualifier)
66 bool IsVarying(TQualifier qualifier)
68 return IsVaryingIn(qualifier) || IsVaryingOut(qualifier);
702 switch(pType.qualifier)
717 error(line, "cannot be used with a structure", getQualifierString(pType.qualifier));
726 if (pType.qualifier != EvqUniform && samplerErrorCheck(line, pType, "samplers must be uniform"))
729 // check for layout qualifier issues
730 if (pType.qualifier != EvqVertexIn && pType.qualifier != EvqFragmentOut &&
744 switch(publicType.qualifier)
754 getQualifierString(publicType.qualifier));
761 if(publicType.qualifier != EvqUniform && samplerErrorCheck(identifierLocation, publicType,
767 // check for layout qualifier issues
772 error(identifierLocation, "layout qualifier", getMatrixPackingString(layoutQualifier.matrixPacking),
779 error(identifierLocation, "layout qualifier", getBlockStorageString(layoutQualifier.blockStorage),
784 if(publicType.qualifier != EvqVertexIn && publicType.qualifier != EvqFragmentOut &&
797 error(location, "invalid layout qualifier:", "location", "only valid on program inputs and outputs");
815 bool TParseContext::parameterSamplerErrorCheck(const TSourceLoc &line, TQualifier qualifier, const TType& type)
817 if ((qualifier == EvqOut || qualifier == EvqInOut) &&
891 // See if this qualifier can be an array.
897 if ((type.qualifier == EvqAttribute) || (type.qualifier == EvqVertexIn) || (type.qualifier == EvqConstExpr && mShaderVersion < 300)) {
898 error(line, "cannot declare arrays of this qualifier", TType(type).getCompleteString().c_str());
922 if(mShaderVersion >= 300 && type.type == EbtStruct && IsVarying(type.qualifier))
924 error(line, "cannot declare arrays of structs of this qualifier",
977 // Enforce non-initializer type/qualifier rules.
983 if (type.qualifier == EvqConstExpr)
985 // Make the qualifier make sense.
986 type.qualifier = EvqTemporary;
998 error(line, "variables with qualifier 'const' must be initialized", identifier.c_str());
1015 if(type.qualifier == EvqConstExpr)
1017 // Make the qualifier make sense.
1018 type.qualifier = EvqTemporary;
1030 error(line, "variables with qualifier 'const' must be initialized", identifier.c_str());
1053 // gl_LastFragData may be redeclared with a new precision qualifier
1083 bool TParseContext::paramErrorCheck(const TSourceLoc &line, TQualifier qualifier, TQualifier paramQualifier, TType* type)
1085 if (qualifier != EvqConstReadOnly && qualifier != EvqTemporary) {
1086 error(line, "qualifier not allowed on function parameter", getQualifierString(qualifier));
1089 if (qualifier == EvqConstReadOnly && paramQualifier != EvqIn) {
1090 error(line, "qualifier not allowed with ", getQualifierString(qualifier), getQualifierString(paramQualifier));
1094 if (qualifier == EvqConstReadOnly)
1143 void TParseContext::es3InvariantErrorCheck(const TQualifier qualifier, const TSourceLoc &invariantLocation)
1145 switch(qualifier)
1212 TQualifier qualifier = variable->getType().getQualifier();
1213 if(qualifier == EvqFragData)
1217 else if(qualifier == EvqFragColor)
1311 TQualifier qualifier = type.getQualifier();
1312 if ((qualifier != EvqTemporary) && (qualifier != EvqGlobal) && (qualifier != EvqConstExpr)) {
1313 error(line, " cannot initialize this type of qualifier ", variable->getType().getQualifierString());
1320 if (qualifier == EvqConstExpr) {
1321 if (qualifier != initializer->getQualifier()) {
1361 TPublicType TParseContext::addFullySpecifiedType(TQualifier qualifier, bool invariant, TLayoutQualifier layoutQualifier, const TPublicType &typeSpecifier)
1364 returnType.qualifier = qualifier;
1383 if(qualifier == EvqAttribute && (typeSpecifier.type == EbtBool || typeSpecifier.type == EbtInt))
1385 error(typeSpecifier.line, "cannot be bool or int", getQualifierString(qualifier));
1389 if((qualifier == EvqVaryingIn || qualifier == EvqVaryingOut) &&
1392 error(typeSpecifier.line, "cannot be bool or int", getQualifierString(qualifier));
1403 if(IsVarying(returnType.qualifier) || returnType.qualifier == EvqVertexIn || returnType.qualifier == EvqFragmentOut)
1405 checkInputOutputTypeIsValidES3(returnType.qualifier, typeSpecifier, typeSpecifier.line);
1412 void TParseContext::checkInputOutputTypeIsValidES3(const TQualifier qualifier,
1419 error(qualifierLocation, "cannot be bool", getQualifierString(qualifier));
1423 switch(qualifier)
1429 error(qualifierLocation, "cannot be array", getQualifierString(qualifier));
1437 error(qualifierLocation, "cannot be matrix", getQualifierString(qualifier));
1450 if(typeContainsIntegers && qualifier != EvqFlatIn && qualifier != EvqFlatOut)
1452 error(qualifierLocation, "must use 'flat' interpolation here", getQualifierString(qualifier));
1462 error(qualifierLocation, "cannot be an array of structures", getQualifierString(qualifier));
1466 error(qualifierLocation, "cannot be a structure containing an array", getQualifierString(qualifier));
1470 error(qualifierLocation, "cannot be a structure containing a structure", getQualifierString(qualifier));
1474 error(qualifierLocation, "cannot be a structure containing a bool", getQualifierString(qualifier));
1842 if(typeQualifier.qualifier != EvqUniform)
1844 error(typeQualifier.line, "invalid qualifier:", getQualifierString(typeQualifier.qualifier), "global layout must be uniform");
2373 if(typeQualifier.qualifier != EvqUniform)
2375 error(typeQualifier.line, "invalid qualifier:", getQualifierString(typeQualifier.qualifier), "interface blocks must be uniform");
2410 const TQualifier qualifier = fieldType->getQualifier();
2411 switch(qualifier)
2417 error(field->line(), "invalid qualifier on interface block member", getQualifierString(qualifier));
2431 error(field->line(), "invalid layout qualifier:", getBlockStorageString(fieldLayoutQualifier.blockStorage), "cannot be used here");
2441 error(field->line(), "invalid layout qualifier:", getMatrixPackingString(fieldLayoutQualifier.matrixPacking), "can only be used on matrix types");
2457 TType interfaceBlockType(interfaceBlock, typeQualifier.qualifier, blockLayoutQualifier, arraySize);
2474 fieldVariable->setQualifier(typeQualifier.qualifier);
2486 instanceTypeDef->setQualifier(typeQualifier.qualifier);
2649 TQualifier qualifier = baseExpression->getType().getQualifier() == EvqConstExpr ? EvqConstExpr : EvqTemporary;
2651 qualifier, static_cast<unsigned char>(baseExpression->getSecondarySize())));
2655 TQualifier qualifier = baseExpression->getType().getQualifier() == EvqConstExpr ? EvqConstExpr : EvqTemporary;
2656 indexedExpression->setType(TType(baseExpression->getBasicType(), baseExpression->getPrecision(), qualifier));
2780 // change the qualifier of the return type, not of the structure field
2861 TLayoutQualifier qualifier;
2863 qualifier.location = -1;
2864 qualifier.matrixPacking = EmpUnspecified;
2865 qualifier.blockStorage = EbsUnspecified;
2869 qualifier.blockStorage = EbsShared;
2873 qualifier.blockStorage = EbsPacked;
2877 qualifier.blockStorage = EbsStd140;
2881 qualifier.matrixPacking = EmpRowMajor;
2885 qualifier.matrixPacking = EmpColumnMajor;
2889 error(qualifierTypeLine, "invalid layout qualifier", qualifierType.c_str(), "location requires an argument");
2894 error(qualifierTypeLine, "invalid layout qualifier", qualifierType.c_str());
2898 return qualifier;
2903 TLayoutQualifier qualifier;
2905 qualifier.location = -1;
2906 qualifier.matrixPacking = EmpUnspecified;
2907 qualifier.blockStorage = EbsUnspecified;
2911 error(qualifierTypeLine, "invalid layout qualifier", qualifierType.c_str(), "only location may have arguments");
2924 qualifier.location = intValue;
2928 return qualifier;
2986 error(interpolationLoc, "interpolation qualifier requires a fragment 'in' or vertex 'out' storage qualifier", getQualifierString(interpolationQualifier));
3014 type->setQualifier(typeSpecifier.qualifier);
3068 const TQualifier qualifier = field.type()->getQualifier();
3069 switch(qualifier)
3075 error(field.line(), "invalid qualifier on struct member", getQualifierString(qualifier));