Have non-ES profiles always use EpqNone (no precision qualifier) rather than using highp. This keeps precision qualifiers out of error messages, IL dumps, etc., and avoids the precision propagation algorithm.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20364 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-01-29 17:24:14 +00:00
parent e406f1c71c
commit 59ddbafb62
4 changed files with 13 additions and 14 deletions

View File

@ -836,8 +836,10 @@ bool TIntermBinary::promote(TInfoSink& infoSink)
// Fix precision qualifiers // Fix precision qualifiers
if (right->getQualifier().precision > getQualifier().precision) if (right->getQualifier().precision > getQualifier().precision)
getQualifier().precision = right->getQualifier().precision; getQualifier().precision = right->getQualifier().precision;
if (getQualifier().precision != EpqNone) {
left->propagatePrecision(getQualifier().precision); left->propagatePrecision(getQualifier().precision);
right->propagatePrecision(getQualifier().precision); right->propagatePrecision(getQualifier().precision);
}
// //
// Array operations. // Array operations.
@ -1125,7 +1127,8 @@ void TIntermTyped::propagatePrecision(TPrecisionQualifier newPrecision)
// comma operator: just through the last operand // comma operator: just through the last operand
// ":?" and ",": where is this triggered? // ":?" and ",": where is this triggered?
// built-in function calls: how much to propagate to arguments? // built-in function calls: how much to propagate to arguments?
// performance: don't do this for desktop profiles // length()?
// indexing?
} }
bool CompareStructure(const TType& leftNodeType, constUnion* rightUnionArray, constUnion* leftUnionArray) bool CompareStructure(const TType& leftNodeType, constUnion* rightUnionArray, constUnion* leftUnionArray)

View File

@ -55,11 +55,7 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, EShLangu
// Default precisions for version 110, to be overridden for // Default precisions for version 110, to be overridden for
// other versions/profiles/stage combinations // other versions/profiles/stage combinations
for (int type = 0; type < EbtNumTypes; ++type) for (int type = 0; type < EbtNumTypes; ++type)
defaultPrecision[type] = EpqHigh; defaultPrecision[type] = EpqNone;
defaultPrecision[EbtVoid] = EpqNone;
defaultPrecision[EbtDouble] = EpqNone;
defaultPrecision[EbtBool] = EpqNone;
} }
// //

View File

@ -734,9 +734,6 @@ void SetVersion(int version)
parseContext.version = version; parseContext.version = version;
if (version == 100 || version == 300) { if (version == 100 || version == 300) {
for (int type = 0; type < EbtNumTypes; ++type)
parseContext.defaultPrecision[type] = EpqNone;
if (parseContext.language == EShLangVertex) { if (parseContext.language == EShLangVertex) {
parseContext.defaultPrecision[EbtInt] = EpqHigh; parseContext.defaultPrecision[EbtInt] = EpqHigh;
parseContext.defaultPrecision[EbtFloat] = EpqHigh; parseContext.defaultPrecision[EbtFloat] = EpqHigh;

View File

@ -2442,16 +2442,19 @@ precision_qualifier
: HIGH_PRECISION { : HIGH_PRECISION {
parseContext.profileRequires($1.line, ENoProfile, 130, 0, "highp precision qualifier"); parseContext.profileRequires($1.line, ENoProfile, 130, 0, "highp precision qualifier");
$$.init($1.line); $$.init($1.line);
if (parseContext.profile == EEsProfile)
$$.qualifier.precision = EpqHigh; $$.qualifier.precision = EpqHigh;
} }
| MEDIUM_PRECISION { | MEDIUM_PRECISION {
parseContext.profileRequires($1.line, ENoProfile, 130, 0, "mediump precision qualifier"); parseContext.profileRequires($1.line, ENoProfile, 130, 0, "mediump precision qualifier");
$$.init($1.line); $$.init($1.line);
if (parseContext.profile == EEsProfile)
$$.qualifier.precision = EpqMedium; $$.qualifier.precision = EpqMedium;
} }
| LOW_PRECISION { | LOW_PRECISION {
parseContext.profileRequires($1.line, ENoProfile, 130, 0, "lowp precision qualifier"); parseContext.profileRequires($1.line, ENoProfile, 130, 0, "lowp precision qualifier");
$$.init($1.line); $$.init($1.line);
if (parseContext.profile == EEsProfile)
$$.qualifier.precision = EpqLow; $$.qualifier.precision = EpqLow;
} }
; ;