X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=tests%2Fglsl%2Fnested_member_access.glsl;fp=tests%2Fglsl%2Fnested_member_access.glsl;h=60b3a492ebca98d44a320e98022c4fd181a448e4;hb=1b9417220971f271daaf2d4cc7e2a41d34edaeb0;hp=0000000000000000000000000000000000000000;hpb=9656026f49b0063e035825fec2a96e17b6de93af;p=libs%2Fgl.git diff --git a/tests/glsl/nested_member_access.glsl b/tests/glsl/nested_member_access.glsl new file mode 100644 index 00000000..60b3a492 --- /dev/null +++ b/tests/glsl/nested_member_access.glsl @@ -0,0 +1,46 @@ +uniform Lighting +{ + vec3 light_color[4]; +}; +uniform Params +{ + int light_index; +}; + +#pragma MSP stage(vertex) +layout(location=0) in vec4 position; +void main() +{ + gl_Position = position; +} + +#pragma MSP stage(fragment) +layout(location=0) out vec4 frag_color; +void main() +{ + frag_color = vec4(light_color[light_index], 1.0); +} + +/* Expected output: vertex +layout(location=0) in vec4 position; +void main() +{ + gl_Position = position; +} +*/ + +/* Expected output: fragment +layout(binding=5) uniform Lighting +{ + vec3 light_color[4]; +}; +layout(binding=80) uniform Params +{ + int light_index; +}; +layout(location=0) out vec4 frag_color; +void main() +{ + frag_color = vec4(light_color[light_index], 1.0); +} +*/