aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-mat4x2.shader_test
blob: a7c36334beb7abd09c0e39d56f557b3eede47771 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[require]
GLSL >= 1.00 es
GL >= 2.0 es
# glUniformMatrix4x2fv only exists in OpenGL 2.1 or later.


[vertex shader]
attribute vec4 vertex;
mat4 proj = mat4(
	2.0/250.0, 0.0, 0.0, -1.0,
	0.0, 2.0/250.0, 0.0, -1.0,
	0.0, 0.0, -1.0, 0.0,
	0.0, 0.0, 0.0, 1.0);

void main() { gl_Position = vertex;
	gl_Position *= proj; }

[fragment shader]

uniform vec2 c;
uniform vec4 r;
uniform mat4x2 expected;

void main() {
  mat4x2 result = outerProduct(c, r);
  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
}

[test]
clear color 0.5 0.5 0.5 0.0
clear


uniform vec2 c  2 3
uniform vec4 r  4 5 6 7
uniform mat4x2 expected  8 12 10 15 12 18 14 21
draw rect 10 10 10 10
probe rgb 15 15 0.0 1.0 0.0

uniform vec2 c  3 4
uniform vec4 r  5 6 7 8
uniform mat4x2 expected  15 20 18 24 21 28 24 32
draw rect 30 10 10 10
probe rgb 35 15 0.0 1.0 0.0

uniform vec2 c  4 5
uniform vec4 r  6 7 8 9
uniform mat4x2 expected  24 30 28 35 32 40 36 45
draw rect 50 10 10 10
probe rgb 55 15 0.0 1.0 0.0

uniform vec2 c  5 6
uniform vec4 r  7 8 9 10
uniform mat4x2 expected  35 42 40 48 45 54 50 60
draw rect 70 10 10 10
probe rgb 75 15 0.0 1.0 0.0