Merge pull request #1375 from Igalia/nroberts/aml-arrayio

Skip outermost array when assigning locations to auto-array interfaces
This commit is contained in:
John Kessenich 2018-05-12 14:24:05 -06:00 committed by GitHub
commit 2fb966aad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -478,7 +478,16 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
// Placeholder. This does not do proper cross-stage lining up, nor
// work with mixed location/no-location declarations.
int location = nextLocation;
nextLocation += TIntermediate::computeTypeLocationSize(type, stage);
int typeLocationSize;
// Dont take into account the outer-most array if the stages
// interface is automatically an array.
if (type.getQualifier().isArrayedIo(stage)) {
TType elementType(type, 0);
typeLocationSize = TIntermediate::computeTypeLocationSize(elementType, stage);
} else {
typeLocationSize = TIntermediate::computeTypeLocationSize(type, stage);
}
nextLocation += typeLocationSize;
return location;
}