mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
Add a handful of simple tests for function calls in constructors
This commit is contained in:
parent
ed45ec6a51
commit
7e3ed40200
4 changed files with 52 additions and 0 deletions
4
tests/constructor-01.glsl
Normal file
4
tests/constructor-01.glsl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
void main()
|
||||
{
|
||||
gl_Position = vec4(1.0, 1.0, 1.0, 0.0);;
|
||||
}
|
||||
16
tests/function-01.glsl
Normal file
16
tests/function-01.glsl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* FAIL - no function named 'foo' exists */
|
||||
|
||||
vec4 bar(float x, float y, float z, float w)
|
||||
{
|
||||
vec4 v;
|
||||
v.x = x;
|
||||
v.y = y;
|
||||
v.z = z;
|
||||
v.w = w;
|
||||
return v;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = foo(1.0, 1.0, 1.0, 0.0);
|
||||
}
|
||||
16
tests/function-02.glsl
Normal file
16
tests/function-02.glsl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* FAIL - no version of 'foo' matches the call to 'foo' */
|
||||
|
||||
vec4 foo(float x, float y, float z, float w)
|
||||
{
|
||||
vec4 v;
|
||||
v.x = x;
|
||||
v.y = y;
|
||||
v.z = z;
|
||||
v.w = w;
|
||||
return v;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = foo(1.0, 1.0, 1.0);
|
||||
}
|
||||
16
tests/function-03.glsl
Normal file
16
tests/function-03.glsl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* PASS */
|
||||
|
||||
vec4 foo(float x, float y, float z, float w)
|
||||
{
|
||||
vec4 v;
|
||||
v.x = x;
|
||||
v.y = y;
|
||||
v.z = z;
|
||||
v.w = w;
|
||||
return v;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = foo(1.0, 1.0, 1.0, 0.0);
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue