Fix treatment of array input/output variables in reflection

* Non-block arrays should not be ignored when exploding types.
* When not exploding, set the array size correctly on each item.
This commit is contained in:
baldurk 2019-02-11 16:39:12 +00:00
parent 05d12a9461
commit 879562b766
10 changed files with 25 additions and 18 deletions

View file

@ -121,7 +121,7 @@ public:
}
// by convention if this is an arrayed block we ignore the array in the reflection
if (type.isArray()) {
if (type.isArray() && type.getBasicType() == EbtBlock) {
blowUpIOAggregate(input, baseName, TType(type, 0));
} else {
blowUpIOAggregate(input, baseName, type);
@ -130,7 +130,8 @@ public:
TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str());
if (it == reflection.nameToIndex.end()) {
reflection.nameToIndex[name.c_str()] = (int)ioItems.size();
ioItems.push_back(TObjectReflection(name.c_str(), type, 0, mapToGlType(type), 0, 0));
ioItems.push_back(
TObjectReflection(name.c_str(), type, 0, mapToGlType(type), mapToGlArraySize(type), 0));
EShLanguageMask& stages = ioItems.back().stages;
stages = static_cast<EShLanguageMask>(stages | 1 << intermediate.getStage());