aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/glsl-es-1.00/execution/1.20/vs-outerProduct-const-mat3x2.shader_test
blob: 894dfb41e15561f9d83096399de6d706b0485889 (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
[require]
GLSL >= 1.00 es
GL >= 2.0 es
# glUniformMatrix3x2fv 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);


const vec2 c = vec2(2, 3);
const vec3 r = vec3(4, 5, 6);
uniform mat3x2 expected = mat3x2(8, 12, 10, 15, 12, 18);
varying vec4 color;

void main() {
  gl_Position = vertex;
	gl_Position *= proj;
  mat3x2 result = outerProduct(c, r);
  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
}

[fragment shader]

varying vec4 color;
void main() { gl_FragColor = color; }

[test]
clear color 0.5 0.5 0.5 0.0
clear


draw rect 10 10 10 10
probe rgb 15 15 0.0 1.0 0.0