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,
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 @@ void getUserDefinedVariableInfo(const TType& type,
{
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 @@ bool CollectVariables::visitAggregate(Visit, TIntermAggregate* node)
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