Simplified TType class by carving out TStructure and TField.
R=kbr@chromium.org
Review URL: https://codereview.appspot.com/9866043
git-svn-id: https://angleproject.googlecode.com/svn/trunk@2423 736b8ea6-26fd-11df-bfd4-992fa37f6226
TRAC #23415
Authored-by: alokp@chromium.org
Signed-off-by: Shannon Woods
Signed-off-by Nicolas Capens
Merged-by: Jamie Madill
diff --git a/src/compiler/VariableInfo.cpp b/src/compiler/VariableInfo.cpp
index cce5e36..3a01258 100644
--- a/src/compiler/VariableInfo.cpp
+++ b/src/compiler/VariableInfo.cpp
@@ -173,14 +173,15 @@
TVariableInfoList& infoList,
ShHashFunction64 hashFunction)
{
- ASSERT(type.getBasicType() == EbtStruct);
+ ASSERT(type.getBasicType() == EbtStruct || type.isInterfaceBlock());
- const TTypeList* structure = type.getStruct();
- for (size_t i = 0; i < structure->size(); ++i) {
- const TType* fieldType = (*structure)[i].type;
- getVariableInfo(*fieldType,
- name + "." + fieldType->getFieldName(),
- mappedName + "." + TIntermTraverser::hash(fieldType->getFieldName(), hashFunction),
+ const TFieldList& fields = type.getStruct()->fields();
+ for (size_t i = 0; i < fields.size(); ++i) {
+ const TType& fieldType = *(fields[i]->type());
+ const TString& fieldName = fields[i]->name();
+ getVariableInfo(fieldType,
+ name + "." + fieldName,
+ mappedName + "." + TIntermTraverser::hash(fieldName, hashFunction),
infoList,
hashFunction);
}