IO mapper: Fix #1261: Supply location mapper with size computer.
This factored computeTypeLocationSize() out of needing the TIntermediate contents, and uses it to show how to know how many locations an object needs. However, it still does not do cross stage, or mixed location/no-location analysis.
This commit is contained in:
@@ -1256,7 +1256,7 @@ int HlslParseContext::addFlattenedMember(const TVariable& variable, const TType&
|
||||
// inherited locations must be auto bumped, not replicated
|
||||
if (flattenData.nextLocation != TQualifier::layoutLocationEnd) {
|
||||
memberVariable->getWritableType().getQualifier().layoutLocation = flattenData.nextLocation;
|
||||
flattenData.nextLocation += intermediate.computeTypeLocationSize(memberVariable->getType());
|
||||
flattenData.nextLocation += intermediate.computeTypeLocationSize(memberVariable->getType(), language);
|
||||
nextOutLocation = std::max(nextOutLocation, flattenData.nextLocation);
|
||||
}
|
||||
}
|
||||
@@ -1536,9 +1536,9 @@ void HlslParseContext::assignToInterface(TVariable& variable)
|
||||
int size;
|
||||
if (type.isArray() && qualifier.isArrayedIo(language)) {
|
||||
TType elementType(type, 0);
|
||||
size = intermediate.computeTypeLocationSize(elementType);
|
||||
size = intermediate.computeTypeLocationSize(elementType, language);
|
||||
} else
|
||||
size = intermediate.computeTypeLocationSize(type);
|
||||
size = intermediate.computeTypeLocationSize(type, language);
|
||||
|
||||
if (qualifier.storage == EvqVaryingIn) {
|
||||
variable.getWritableType().getQualifier().layoutLocation = nextInLocation;
|
||||
@@ -8633,7 +8633,7 @@ void HlslParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qual
|
||||
memberQualifier.layoutComponent = 0;
|
||||
}
|
||||
nextLocation = memberQualifier.layoutLocation +
|
||||
intermediate.computeTypeLocationSize(*typeList[member].type);
|
||||
intermediate.computeTypeLocationSize(*typeList[member].type, language);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user