cl: Don't use device_infos if num_device_infos == 0
[piglit.git] / tests / glslparsertest / glsl2 / gst-gl-mosaic-v.vert
blob09059fe25ee2c7e48b9ade8fb3267b942ff1d0f7
1 // [config]
2 // expect_result: pass
3 // glsl_version: 1.10
4 //
5 // [end config]
7 /*
8  * GStreamer
9  * Copyright (C) 2009 Julien Isorce <julien.isorce@gmail.com>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the
23  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24  * Boston, MA 02111-1307, USA.
25  */
27 #extension GL_ARB_texture_rectangle : enable
28 uniform mat4 u_matrix;
29 uniform float xrot_degree, yrot_degree, zrot_degree;
30 attribute vec4 a_position;
31 attribute vec2 a_texCoord;
32 varying vec2 v_texCoord;
33 void main()
35    float PI = 3.14159265;
36    float xrot = xrot_degree*2.0*PI/360.0;
37    float yrot = yrot_degree*2.0*PI/360.0;
38    float zrot = zrot_degree*2.0*PI/360.0;
39    mat4 matX = mat4 (
40             1.0,        0.0,        0.0, 0.0,
41             0.0,  cos(xrot),  sin(xrot), 0.0,
42             0.0, -sin(xrot),  cos(xrot), 0.0,
43             0.0,        0.0,        0.0, 1.0 );
44    mat4 matY = mat4 (
45       cos(yrot),        0.0, -sin(yrot), 0.0,
46             0.0,        1.0,        0.0, 0.0,
47       sin(yrot),        0.0,  cos(yrot), 0.0,
48             0.0,        0.0,       0.0,  1.0 );
49    mat4 matZ = mat4 (
50       cos(zrot),  sin(zrot),        0.0, 0.0,
51      -sin(zrot),  cos(zrot),        0.0, 0.0,
52             0.0,        0.0,        1.0, 0.0,
53             0.0,        0.0,        0.0, 1.0 );
54    gl_Position = u_matrix * matZ * matY * matX * a_position;
55    v_texCoord = a_texCoord;