glsl: test function linking with implicit param conversions
[piglit.git] / tests / spec / glsl-1.30 / linker / function-match-implicit-params-multple-matches.shader_test
bloba7e308384948d6701e49bccdb40f467e60fc8cda
1 /* Here we test that linking fails if we have more than 1 matching function
2  * signature that is not an exact match.
3  *
4  * From page 42 (page 49 of the PDF) of the GLSL 1.20 spec:
5  *
6  * "If an exact match is found, the other signatures are ignored, and
7  *  the exact match is used.  Otherwise, if no exact match is found, then
8  *  the implicit conversions in Section 4.1.10 "Implicit Conversions" will
9  *  be applied to the calling arguments if this can make their types match
10  *  a signature.  In this case, it is a semantic error if there are
11  *  multiple ways to apply these conversions to the actual arguments of a
12  *  call such that the call can be made to match multiple signatures."
13  */
15 [require]
16 GLSL >= 1.30
18 [vertex shader]
19 #version 130
21 vec4 my_position(vec4 a)
23    return a * 0.5;
26 vec4 my_position(uvec4 a)
28    return vec4(a * 2u);
31 [vertex shader]
32 #version 120
34 vec4 my_position(ivec4 a);
36 void main()
38   gl_Position = my_position(ivec4(1.0));
42 [fragment shader]
43 #version 120
44 void main()
46   gl_FragColor = vec4(1.0);
50 [test]
51 link error