Merge pull request #1696 from baldurk/fix-nonblock-array-size

Fix treatment of array input/output variables in reflection
This commit is contained in:
John Kessenich 2019-02-17 13:15:11 +07:00 committed by GitHub
commit 9f538c7207
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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());