Front-end: Fix default layout(component) widths and correct for doubles.

Replaces PR #372.
This commit is contained in:
John Kessenich 2016-07-21 15:43:00 -06:00
parent bc9e1d118a
commit c8f6903b1d
5 changed files with 52 additions and 16 deletions

View file

@ -664,12 +664,19 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
size = computeTypeLocationSize(type);
}
// locations...
TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation + size - 1);
// components in this location slot...
TRange componentRange(0, 3);
if (qualifier.hasComponent()) {
componentRange.start = qualifier.layoutComponent;
componentRange.last = componentRange.start + type.getVectorSize() - 1;
if (qualifier.hasComponent() || type.getVectorSize() > 0) {
int consumedComponents = type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1);
if (qualifier.hasComponent())
componentRange.start = qualifier.layoutComponent;
componentRange.last = componentRange.start + consumedComponents - 1;
}
// both...
TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.layoutIndex : 0);
// check for collisions, except for vertex inputs on desktop