summaryrefslogtreecommitdiffstats
path: root/progs/slang/vstest.txt
blob: 7f51d0bc810f23b525dfa3a61172224d61623e83 (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
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * Vertex shader test.
 * Uses all conventional attributes and 15 generic attributes to print
 * their values, using printMESA() extension function, to the debugger
 * to compare them with the actual passed-in values.
 * Use different types for generic attributes to check matrix handling.
 *
 * Author: Michal Krol
 */

#version 110

#extension MESA_shader_debug: require

attribute vec4 Attribute1;
attribute vec4 Attribute2;
attribute vec4 Attribute3;
attribute float Attribute4;
attribute vec2 Attribute5;
attribute vec3 Attribute6;
attribute mat2 Attribute7;
attribute mat3 Attribute9;
attribute mat4 Attribute12;

void main ()
{
   //
   // Do some legal stuff.
   //
   gl_Position = gl_ModelViewMatrix * gl_Vertex;
   gl_FrontColor = vec4 (1.0);

   //
   // Conventional attributes - except for gl_Vertex.
   //
   printMESA (gl_Color);
   printMESA (gl_SecondaryColor);
   printMESA (gl_Normal);
   printMESA (gl_MultiTexCoord0);
   printMESA (gl_MultiTexCoord1);
   printMESA (gl_MultiTexCoord2);
   printMESA (gl_MultiTexCoord3);
   printMESA (gl_MultiTexCoord4);
   printMESA (gl_MultiTexCoord5);
   printMESA (gl_MultiTexCoord6);
   printMESA (gl_MultiTexCoord7);
   printMESA (gl_FogCoord);

   //
   // Generic attributes - attrib with index 0 is not used because it would
   // alias with gl_Vertex, which is not allowed.
   //
   printMESA (Attribute1);
   printMESA (Attribute2);
   printMESA (Attribute3);
   printMESA (Attribute4);
   printMESA (Attribute5);
   printMESA (Attribute6);
   printMESA (Attribute7);
   printMESA (Attribute9);
   printMESA (Attribute12);

   //
   // Vertex position goes last.
   //
   printMESA (gl_Vertex);
}