Implement the full scheme for ES precision qualifiers, generalizing existing storage qualifiers to be able to include multiple independent kinds of qualifiers.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20317 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
674014bfc4
commit
5521862729
15 changed files with 661 additions and 463 deletions
|
|
@ -546,13 +546,14 @@ TIntermNode* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nod
|
|||
|
||||
TIntermTyped* TIntermediate::addComma(TIntermTyped* left, TIntermTyped* right, TSourceLoc line)
|
||||
{
|
||||
if (left->getType().getQualifier() == EvqConst && right->getType().getQualifier() == EvqConst) {
|
||||
if (left->getType().getQualifier().storage == EvqConst &&
|
||||
right->getType().getQualifier().storage == EvqConst) {
|
||||
return right;
|
||||
} else {
|
||||
TIntermTyped *commaAggregate = growAggregate(left, right, line);
|
||||
commaAggregate->getAsAggregate()->setOperator(EOpComma);
|
||||
commaAggregate->setType(right->getType());
|
||||
commaAggregate->getTypePointer()->changeQualifier(EvqTemporary);
|
||||
commaAggregate->getTypePointer()->getQualifier().storage = EvqTemporary;
|
||||
return commaAggregate;
|
||||
}
|
||||
}
|
||||
|
|
@ -830,7 +831,11 @@ bool TIntermBinary::promote(TInfoSink& infoSink)
|
|||
// operand. Then only deviations from this need be coded.
|
||||
//
|
||||
setType(left->getType());
|
||||
type.changeQualifier(EvqTemporary);
|
||||
type.getQualifier().storage = EvqTemporary;
|
||||
|
||||
// Fix precision qualifiers
|
||||
if (right->getQualifier().precision > getQualifier().precision)
|
||||
getQualifier().precision = right->getQualifier().precision;
|
||||
|
||||
//
|
||||
// Array operations.
|
||||
|
|
@ -1510,7 +1515,8 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||
|
||||
const TType& t = node->getType();
|
||||
|
||||
return addConstantUnion(leftUnionArray, TType(promoteTo, t.getQualifier(), t.getNominalSize(), t.isMatrix(), t.isArray()), node->getLine());
|
||||
return addConstantUnion(leftUnionArray, TType(promoteTo, t.getQualifier().storage, t.getNominalSize(), t.isMatrix(),
|
||||
t.isArray()), node->getLine());
|
||||
}
|
||||
|
||||
void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue