glslang: Bug 13724: ES global initializers must be constant.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30990 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2015-04-30 03:22:41 +00:00
parent 09388459a8
commit 968c8f8e78
9 changed files with 299 additions and 206 deletions

View File

@@ -1,6 +1,6 @@
// okay
#version 100
int a[3] = { 2, 3, 4, }; // ERROR
int a[3] = { 2, 3, 4, }; // ERROR (lots)
#version 100
int uint;
@@ -194,6 +194,25 @@ void badswizzle()
a.method(); // ERROR
}
float fooinit();
float fooinittest()
{
return fooinit();
}
// Test extra-function initializers
const float fi1 = 3.0;
const float fi2 = 4.0;
const float fi3 = 5.0;
float fooinit()
{
return fi1 + fi2 + fi3; // should make a constant of 12.0
}
int init1 = gl_FrontFacing ? 1 : 2; // ERROR, non-const initializer
#pragma STDGL invariant(all)
#line 3000