mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-15 13:10:31 +01:00
Add several simple if-statement tests
This commit is contained in:
parent
17d86f4371
commit
721efc04da
4 changed files with 44 additions and 0 deletions
11
tests/if-01.glsl
Normal file
11
tests/if-01.glsl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* FAIL - if-statement condition is not bool scalar */
|
||||
|
||||
uniform bvec4 a;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (a)
|
||||
gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
else
|
||||
gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
11
tests/if-02.glsl
Normal file
11
tests/if-02.glsl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* FAIL - if-statement condition is not bool scalar */
|
||||
|
||||
uniform float a;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (a)
|
||||
gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
else
|
||||
gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
11
tests/if-03.glsl
Normal file
11
tests/if-03.glsl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* PASS */
|
||||
|
||||
uniform bool a;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (a)
|
||||
gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
else
|
||||
gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
11
tests/if-04.glsl
Normal file
11
tests/if-04.glsl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* PASS */
|
||||
|
||||
uniform bvec4 a;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (a.x)
|
||||
gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
else
|
||||
gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue