X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=tests%2Fglsl%2Fparameter_composite_access.glsl;fp=tests%2Fglsl%2Fparameter_composite_access.glsl;h=718fffd38a6063fa9059668d875ad01303639fbb;hb=e8369afbde298a3011a341cd2d4dfed76ecd8d3b;hp=0000000000000000000000000000000000000000;hpb=c1bf0909af97772da5b26d82272f337a14c1fae9;p=libs%2Fgl.git diff --git a/tests/glsl/parameter_composite_access.glsl b/tests/glsl/parameter_composite_access.glsl new file mode 100644 index 00000000..718fffd3 --- /dev/null +++ b/tests/glsl/parameter_composite_access.glsl @@ -0,0 +1,60 @@ +uniform Colors +{ + vec4 top_color; + vec4 bottom_color; +}; + +#pragma MSP stage(vertex) +layout(location=0) in vec4 position; +layout(location=1) in vec3 normal; +void main() +{ + gl_Position = position; + passthrough; +} + +#pragma MSP stage(fragment) +layout(location=0) out vec4 frag_color; +vec4 get_color(vec3 n) +{ + if(n.z>=0) + return top_color; + else + return bottom_color; +} +void main() +{ + frag_color = get_color(normal); +} + +/* Expected output: vertex +layout(location=0) in vec4 position; +layout(location=1) in vec3 normal; +layout(location=0) out vec3 _vs_out_normal; +void main() +{ + gl_Position = position; + _vs_out_normal = normal; +} +*/ + +/* Expected output: fragment +layout(binding=23) uniform Colors +{ + vec4 top_color; + vec4 bottom_color; +}; +layout(location=0) out vec4 frag_color; +vec4 get_color(vec3 n) +{ + if(n.z>=0.0) + return top_color; + else + return bottom_color; +} +layout(location=0) in vec3 _vs_out_normal; +void main() +{ + frag_color = get_color(_vs_out_normal); +} +*/