Fix default precision check for formal parameters; it was one level too deep. This will accept more fragment shaders with no default precision before declaring functions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@29281 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
33a5423f76
commit
c311d35500
3 changed files with 48 additions and 46 deletions
|
|
@ -2266,27 +2266,27 @@ TPrecisionQualifier TParseContext::getDefaultPrecision(TPublicType& publicType)
|
|||
return defaultPrecision[publicType.basicType];
|
||||
}
|
||||
|
||||
void TParseContext::precisionQualifierCheck(TSourceLoc loc, TPublicType& publicType)
|
||||
void TParseContext::precisionQualifierCheck(TSourceLoc loc, TBasicType baseType, TQualifier& qualifier)
|
||||
{
|
||||
// Built-in symbols are allowed some ambiguous precisions, to be pinned down
|
||||
// later by context.
|
||||
if (profile != EEsProfile || parsingBuiltins)
|
||||
return;
|
||||
|
||||
if (publicType.basicType == EbtAtomicUint && publicType.qualifier.precision != EpqNone && publicType.qualifier.precision != EpqHigh)
|
||||
if (baseType == EbtAtomicUint && qualifier.precision != EpqNone && qualifier.precision != EpqHigh)
|
||||
error(loc, "atomic counters can only be highp", "atomic_uint", "");
|
||||
|
||||
if (publicType.basicType == EbtFloat || publicType.basicType == EbtUint || publicType.basicType == EbtInt || publicType.basicType == EbtSampler || publicType.basicType == EbtAtomicUint) {
|
||||
if (publicType.qualifier.precision == EpqNone) {
|
||||
if (baseType == EbtFloat || baseType == EbtUint || baseType == EbtInt || baseType == EbtSampler || baseType == EbtAtomicUint) {
|
||||
if (qualifier.precision == EpqNone) {
|
||||
if (messages & EShMsgRelaxedErrors)
|
||||
warn(loc, "type requires declaration of default precision qualifier", TType::getBasicString(publicType.basicType), "substituting 'mediump'");
|
||||
warn(loc, "type requires declaration of default precision qualifier", TType::getBasicString(baseType), "substituting 'mediump'");
|
||||
else
|
||||
error(loc, "type requires declaration of default precision qualifier", TType::getBasicString(publicType.basicType), "");
|
||||
publicType.qualifier.precision = EpqMedium;
|
||||
defaultPrecision[publicType.basicType] = EpqMedium;
|
||||
error(loc, "type requires declaration of default precision qualifier", TType::getBasicString(baseType), "");
|
||||
qualifier.precision = EpqMedium;
|
||||
defaultPrecision[baseType] = EpqMedium;
|
||||
}
|
||||
} else if (publicType.qualifier.precision != EpqNone)
|
||||
error(loc, "type cannot have precision qualifier", TType::getBasicString(publicType.basicType), "");
|
||||
} else if (qualifier.precision != EpqNone)
|
||||
error(loc, "type cannot have precision qualifier", TType::getBasicString(baseType), "");
|
||||
}
|
||||
|
||||
void TParseContext::parameterTypeCheck(TSourceLoc loc, TStorageQualifier qualifier, const TType& type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue