Is this valid GLSL code?

works fine in my setup but want to be sure
using glsl 430 and I have this in my geometry shader

#version 430
layout (points) in;
layout (triangle_strip) out;
layout (max_vertices = 24) out;

uniform mat4 u_projMatrix;
uniform mat4 u_viewMatrix;

mat4 viewProjection = u_projMatrix * u_viewMatrix;

void someFunction1(){
 // uses viewProjection 
}

void someFunction2(){
 // uses viewProjection 
}

void main()
{
  // uses viewProjection 
}

my concern is with viewProjection , I expect viewProjection to be initialized before main(). I went through the glsl manual and looks like it will do exactly that and should compile fine.If its not valid code can someone please refer me to the section in the spec, thanks

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.