Commit 10e6e9e3 by alokp@chromium.org

Handled case when variable declaration contains initialization.

BUG=26 Review URL: http://codereview.appspot.com/2213049 git-svn-id: https://angleproject.googlecode.com/svn/trunk@441 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent ee76f6af
...@@ -171,9 +171,7 @@ bool CollectAttribsUniforms::visitAggregate(Visit, TIntermAggregate* node) ...@@ -171,9 +171,7 @@ bool CollectAttribsUniforms::visitAggregate(Visit, TIntermAggregate* node)
break; break;
case EOpDeclaration: { case EOpDeclaration: {
const TIntermSequence& sequence = node->getSequence(); const TIntermSequence& sequence = node->getSequence();
const TIntermSymbol* variable = sequence.front()->getAsSymbolNode(); TQualifier qualifier = sequence.front()->getAsTyped()->getQualifier();
const TType& type = variable->getType();
TQualifier qualifier = type.getQualifier();
if (qualifier == EvqAttribute || qualifier == EvqUniform) if (qualifier == EvqAttribute || qualifier == EvqUniform)
{ {
TVariableInfoList& infoList = qualifier == EvqAttribute ? TVariableInfoList& infoList = qualifier == EvqAttribute ?
...@@ -181,7 +179,13 @@ bool CollectAttribsUniforms::visitAggregate(Visit, TIntermAggregate* node) ...@@ -181,7 +179,13 @@ bool CollectAttribsUniforms::visitAggregate(Visit, TIntermAggregate* node)
for (TIntermSequence::const_iterator i = sequence.begin(); for (TIntermSequence::const_iterator i = sequence.begin();
i != sequence.end(); ++i) i != sequence.end(); ++i)
{ {
variable = (*i)->getAsSymbolNode(); const TIntermSymbol* variable = (*i)->getAsSymbolNode();
// The only case in which the sequence will not contain a
// TIntermSymbol node is initialization. It will contain a
// TInterBinary node in that case. Since attributes and unifroms
// cannot be initialized in a shader, we must have only
// TIntermSymbol nodes in the sequence.
ASSERT(variable != NULL);
getVariableInfo(variable->getType(), variable->getSymbol(), getVariableInfo(variable->getType(), variable->getSymbol(),
infoList); infoList);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment