Skip to content

Commit

Permalink
fix the failures of glslang-tests in the last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Qining committed Mar 18, 2016
1 parent 133dd65 commit 19a2a73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions glslang/MachineIndependent/ParseHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn
TIntermTyped* result = nullptr;

int indexValue = 0;
if (index->getQualifier().isFrontEndConstant()) {
if (index->getQualifier().storage == EvqConst && !index->getQualifier().isSpecConstant()) {
indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst();
checkIndex(loc, base->getType(), indexValue);
}
Expand All @@ -495,15 +495,15 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn
error(loc, " left of '[' is not of type array, matrix, or vector ", base->getAsSymbolNode()->getName().c_str(), "");
else
error(loc, " left of '[' is not of type array, matrix, or vector ", "expression", "");
} else if (base->getType().getQualifier().isFrontEndConstant() == EvqConst && index->getQualifier().isFrontEndConstant() == EvqConst)
} else if (base->getType().getQualifier().storage == EvqConst && index->getQualifier().storage == EvqConst && !base->getType().getQualifier().isSpecConstant() && !index->getQualifier().isSpecConstant())
return intermediate.foldDereference(base, indexValue, loc);
else {
// at least one of base and index is variable or specialization constant...

if (base->getAsSymbolNode() && isIoResizeArray(base->getType()))
handleIoResizeArrayAccess(loc, base);

if (index->getQualifier().isFrontEndConstant()) {
if (index->getQualifier().storage == EvqConst && !index->getQualifier().isSpecConstant()) {
if (base->getType().isImplicitlySizedArray())
updateImplicitArraySize(loc, base, indexValue);
result = intermediate.addIndex(EOpIndexDirect, base, index, loc);
Expand Down

0 comments on commit 19a2a73

Please sign in to comment.