GLSL reflection: Fix #985: reflect runtime sized arrays having no constant index.
This commit is contained in:
parent
a353bf1f20
commit
a58cc9ffdf
@ -73,6 +73,7 @@ abl2.foo: offset 0, type 1406, size 1, index 11, binding -1
|
|||||||
buf1.runtimeArray: offset 4, type 1406, size 4, index 12, binding -1
|
buf1.runtimeArray: offset 4, type 1406, size 4, index 12, binding -1
|
||||||
buf2.runtimeArray.c: offset 8, type 1406, size 1, index 13, binding -1
|
buf2.runtimeArray.c: offset 8, type 1406, size 1, index 13, binding -1
|
||||||
buf3.runtimeArray: offset 4, type 1406, size 0, index 14, binding -1
|
buf3.runtimeArray: offset 4, type 1406, size 0, index 14, binding -1
|
||||||
|
buf4.runtimeArray.c: offset 8, type 1406, size 1, index 15, binding -1
|
||||||
anonMember1: offset 0, type 8b51, size 1, index 0, binding -1
|
anonMember1: offset 0, type 8b51, size 1, index 0, binding -1
|
||||||
uf1: offset -1, type 1406, size 1, index -1, binding -1
|
uf1: offset -1, type 1406, size 1, index -1, binding -1
|
||||||
uf2: offset -1, type 1406, size 1, index -1, binding -1
|
uf2: offset -1, type 1406, size 1, index -1, binding -1
|
||||||
|
@ -181,7 +181,7 @@ public:
|
|||||||
switch (visitNode->getOp()) {
|
switch (visitNode->getOp()) {
|
||||||
case EOpIndexIndirect:
|
case EOpIndexIndirect:
|
||||||
// Visit all the indices of this array, and for each one add on the remaining dereferencing
|
// Visit all the indices of this array, and for each one add on the remaining dereferencing
|
||||||
for (int i = 0; i < visitNode->getLeft()->getType().getOuterArraySize(); ++i) {
|
for (int i = 0; i < std::max(visitNode->getLeft()->getType().getOuterArraySize(), 1); ++i) {
|
||||||
TString newBaseName = name;
|
TString newBaseName = name;
|
||||||
if (baseType.getBasicType() != EbtBlock)
|
if (baseType.getBasicType() != EbtBlock)
|
||||||
newBaseName.append(TString("[") + String(i) + "]");
|
newBaseName.append(TString("[") + String(i) + "]");
|
||||||
@ -216,7 +216,7 @@ public:
|
|||||||
if (terminalType->isArray()) {
|
if (terminalType->isArray()) {
|
||||||
// Visit all the indices of this array, and for each one,
|
// Visit all the indices of this array, and for each one,
|
||||||
// fully explode the remaining aggregate to dereference
|
// fully explode the remaining aggregate to dereference
|
||||||
for (int i = 0; i < terminalType->getOuterArraySize(); ++i) {
|
for (int i = 0; i < std::max(terminalType->getOuterArraySize(), 1); ++i) {
|
||||||
TString newBaseName = name;
|
TString newBaseName = name;
|
||||||
newBaseName.append(TString("[") + String(i) + "]");
|
newBaseName.append(TString("[") + String(i) + "]");
|
||||||
TType derefType(*terminalType, 0);
|
TType derefType(*terminalType, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user