Commit b66feb31 by Dan Glastonbury Committed by Shannon Woods

Handle interface blocks in getVariableInfo and

getUserDefinedVariableInfo. BUG=angle:654 Change-Id: I07a230bbf2387e85168c50cb3719c669a7890f8a Reviewed-on: https://chromium-review.googlesource.com/199687Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Tested-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent 1b2a8f96
...@@ -136,7 +136,7 @@ void getVariableInfo(const TType& type, ...@@ -136,7 +136,7 @@ void getVariableInfo(const TType& type,
TVariableInfoList& infoList, TVariableInfoList& infoList,
ShHashFunction64 hashFunction) ShHashFunction64 hashFunction)
{ {
if (type.getBasicType() == EbtStruct) { if (type.getBasicType() == EbtStruct || type.isInterfaceBlock()) {
if (type.isArray()) { if (type.isArray()) {
for (int i = 0; i < type.getArraySize(); ++i) { for (int i = 0; i < type.getArraySize(); ++i) {
TString lname = name + arrayBrackets(i); TString lname = name + arrayBrackets(i);
...@@ -183,7 +183,9 @@ void getUserDefinedVariableInfo(const TType& type, ...@@ -183,7 +183,9 @@ void getUserDefinedVariableInfo(const TType& type,
{ {
ASSERT(type.getBasicType() == EbtStruct || type.isInterfaceBlock()); ASSERT(type.getBasicType() == EbtStruct || type.isInterfaceBlock());
const TFieldList& fields = type.getStruct()->fields(); const TFieldList& fields = type.isInterfaceBlock() ?
type.getInterfaceBlock()->fields() :
type.getStruct()->fields();
for (size_t i = 0; i < fields.size(); ++i) { for (size_t i = 0; i < fields.size(); ++i) {
const TType& fieldType = *(fields[i]->type()); const TType& fieldType = *(fields[i]->type());
const TString& fieldName = fields[i]->name(); const TString& fieldName = fields[i]->name();
...@@ -370,4 +372,3 @@ bool CollectVariables::visitAggregate(Visit, TIntermAggregate* node) ...@@ -370,4 +372,3 @@ bool CollectVariables::visitAggregate(Visit, TIntermAggregate* node)
return visitChildren; return visitChildren;
} }
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