GLSL: Implement correct semantic checking for run-time sized arrays.

This commit is contained in:
John Kessenich
2018-04-02 14:52:15 -06:00
parent 5a867acad5
commit 6a4a427efe
5 changed files with 601 additions and 2 deletions

81
Test/runtimeArray.vert Normal file
View File

@@ -0,0 +1,81 @@
#version 450 core
buffer bn {
int a[];
float b[];
} buf;
uniform un {
int a[];
float b[];
} ubuf;
buffer bna {
int a[];
float b[];
} bufa[4];
uniform una {
int a[];
float b[];
} ubufa[4];
buffer abn {
int aba[];
float abb[];
};
uniform aun {
int aua[];
float aub[];
};
int i;
void main()
{
ubuf.a[3];
ubuf.b[3];
buf.a[3];
buf.b[3];
ubufa[3].a[3];
ubufa[3].b[3];
bufa[3].a[3];
bufa[3].b[3];
aua[3];
aub[3];
aba[3];
abb[3];
ubuf.a[i]; // ERROR
ubuf.b[i]; // ERROR
buf.a[i]; // ERROR
buf.b[i];
ubuf.a.length(); // ERROR
ubuf.b.length(); // ERROR
buf.a.length(); // ERROR
buf.b.length();
ubufa[1].a[i]; // ERROR
ubufa[1].b[i]; // ERROR
bufa[1].a[i]; // ERROR
bufa[1].b[i];
ubufa[1].a.length(); // ERROR
ubufa[1].b.length(); // ERROR
bufa[1].a.length(); // ERROR
bufa[1].b.length();
aua[i]; // ERROR
aub[i]; // ERROR
aba[i]; // ERROR
abb[i];
aua.length(); // ERROR
aub.length(); // ERROR
aba.length(); // ERROR
abb.length();
}