It's okay for symbolic spec-consts, but without constant folding, not okay when the array size is an expression.
		
			
				
	
	
		
			15 lines
		
	
	
		
			256 B
		
	
	
	
		
			GLSL
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			256 B
		
	
	
	
		
			GLSL
		
	
	
		
			Executable File
		
	
	
	
	
#version 450
 | 
						|
 | 
						|
layout(constant_id = 0) const uint a = 1;
 | 
						|
layout(constant_id = 1) const uint b = 2;
 | 
						|
layout(location = 0) out uint o;
 | 
						|
 | 
						|
void main() {
 | 
						|
  uint arr1[a+a];
 | 
						|
  uint arr2[b];
 | 
						|
  o = arr1[1];
 | 
						|
  o = arr2[1];
 | 
						|
  o = arr1[6];
 | 
						|
  o = arr2[6];
 | 
						|
}
 |