mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
Add some simple constructor tests
This commit is contained in:
parent
6c86ea8adc
commit
8343550b42
7 changed files with 104 additions and 0 deletions
12
tests/constructor-03.glsl
Normal file
12
tests/constructor-03.glsl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* FAIL - cannot construct a matrix from a matrix in GLSL 1.10 */
|
||||
|
||||
uniform mat2 a;
|
||||
|
||||
void main()
|
||||
{
|
||||
mat2 b;
|
||||
|
||||
b = mat2(a);
|
||||
|
||||
gl_Position = gl_Vertex;
|
||||
}
|
||||
14
tests/constructor-04.glsl
Normal file
14
tests/constructor-04.glsl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#version 120
|
||||
/* FAIL - matrix must be only parameter to matrix constructor */
|
||||
|
||||
uniform mat2 a;
|
||||
uniform float x;
|
||||
|
||||
void main()
|
||||
{
|
||||
mat2 b;
|
||||
|
||||
b = mat2(a, x);
|
||||
|
||||
gl_Position = gl_Vertex;
|
||||
}
|
||||
13
tests/constructor-05.glsl
Normal file
13
tests/constructor-05.glsl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* FAIL - too few components supplied to constructor */
|
||||
|
||||
uniform vec2 a;
|
||||
uniform float x;
|
||||
|
||||
void main()
|
||||
{
|
||||
mat2 b;
|
||||
|
||||
b = mat2(a, x);
|
||||
|
||||
gl_Position = gl_Vertex;
|
||||
}
|
||||
13
tests/constructor-06.glsl
Normal file
13
tests/constructor-06.glsl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#version 120
|
||||
/* PASS */
|
||||
|
||||
uniform mat2 a;
|
||||
|
||||
void main()
|
||||
{
|
||||
mat2 b;
|
||||
|
||||
b = mat2(a);
|
||||
|
||||
gl_Position = gl_Vertex;
|
||||
}
|
||||
13
tests/constructor-07.glsl
Normal file
13
tests/constructor-07.glsl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* PASS */
|
||||
|
||||
uniform ivec2 a;
|
||||
uniform ivec2 b;
|
||||
|
||||
void main()
|
||||
{
|
||||
mat2 c;
|
||||
|
||||
c = mat2(a, b);
|
||||
|
||||
gl_Position = gl_Vertex;
|
||||
}
|
||||
13
tests/constructor-08.glsl
Normal file
13
tests/constructor-08.glsl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* PASS */
|
||||
|
||||
uniform float a;
|
||||
uniform float b;
|
||||
|
||||
void main()
|
||||
{
|
||||
ivec2 c;
|
||||
|
||||
c = ivec2(a, b);
|
||||
|
||||
gl_Position = gl_Vertex;
|
||||
}
|
||||
26
tests/constructor-09.glsl
Normal file
26
tests/constructor-09.glsl
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* PASS */
|
||||
|
||||
uniform int a;
|
||||
uniform float b;
|
||||
uniform bool c;
|
||||
|
||||
void main()
|
||||
{
|
||||
float x;
|
||||
int y;
|
||||
bool z;
|
||||
|
||||
x = float(a);
|
||||
x = float(b);
|
||||
x = float(c);
|
||||
|
||||
y = int(a);
|
||||
y = int(b);
|
||||
y = int(c);
|
||||
|
||||
z = bool(a);
|
||||
z = bool(b);
|
||||
z = bool(c);
|
||||
|
||||
gl_Position = gl_Vertex;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue