Handle interface blocks in getVariableInfo and
getUserDefinedVariableInfo.
BUG=angle:654
Change-Id: I07a230bbf2387e85168c50cb3719c669a7890f8a
Reviewed-on: https://chromium-review.googlesource.com/199687
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
diff --git a/src/compiler/translator/VariableInfo.cpp b/src/compiler/translator/VariableInfo.cpp
index 2d21134..d0b1990 100644
--- a/src/compiler/translator/VariableInfo.cpp
+++ b/src/compiler/translator/VariableInfo.cpp
@@ -136,7 +136,7 @@
TVariableInfoList& infoList,
ShHashFunction64 hashFunction)
{
- if (type.getBasicType() == EbtStruct) {
+ if (type.getBasicType() == EbtStruct || type.isInterfaceBlock()) {
if (type.isArray()) {
for (int i = 0; i < type.getArraySize(); ++i) {
TString lname = name + arrayBrackets(i);
@@ -183,7 +183,9 @@
{
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) {
const TType& fieldType = *(fields[i]->type());
const TString& fieldName = fields[i]->name();
@@ -370,4 +372,3 @@
return visitChildren;
}
-