yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
b4e66d7b
main
1#version 400 2 3struct Vertex { 4vec3 position ; 5vec3 normal ; 6}; 7 8struct Light { 9vec3 position ; 10vec3 color ; 11float intensity ; 12}; 13 14struct Camera { 15mat4 viewMatrix ; 16mat4 projMatrix ; 17}; 18 19// Test various positions of struct parameters - these should be TYPE_NAME 20void render (Vertex v ,Light l ,Camera c ) { 21// Function with struct parameters at start 22} 23 24void process (int id ,Vertex v ,float time ) { 25// Function with struct parameter in middle 26} 27 28void compute (float delta ,int count ,Light l ,Camera c ,bool enabled ) { 29// Function with multiple struct parameters mixed with other types 30} 31 32void single (Vertex v ) { 33// Function with single struct parameter 34} 35 36void multiple (Vertex v1 ,Vertex v2 ,Light l1 ,Light l2 ) { 37// Function with multiple parameters of same struct type 38} 39 40void main () { 41Vertex v = Vertex (vec3 (0.0 ),vec3 (1.0 ,0.0 ,0.0 )); 42Light l = Light (vec3 (10.0 ),vec3 (1.0 ),1.0 ); 43Camera c = Camera (mat4 (1.0 ),mat4 (1.0 )); 44 45render (v ,l ,c ); 46process (1 ,v ,0.5 ); 47compute (0.016 ,100 ,l ,c , true); 48}