Add function "const", where the initializer does not have to be a compile-time constant.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23566 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-10-17 20:55:30 +00:00
parent 779e6b406a
commit e46b087760
15 changed files with 165 additions and 111 deletions

View File

@@ -12,6 +12,23 @@ smooth flat out vec4 rep; // ERROR, replicating interpolation qualification
centroid sample out vec4 rep2; // ERROR, replicating auxiliary qualification
in uniform vec4 rep3; // ERROR, replicating storage qualification
int anonconst;
const int aconst = 5;
const int a = aconst;
const int b = anonconst; // ERROR at global scope
const int foo() // ERROR, no const functions
{
const int a = aconst;
const int b = anonconst;
const int c = a; // still compile-time const
const int d = b; // not a compile-time const
float x[c]; // okay
float y[d]; // ERROR
return b;
}
void main()
{
int i;