~ubuntu-branches/ubuntu/oneiric/mesa-demos/oneiric

« back to all changes in this revision

Viewing changes to src/slang/vstest.txt

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2010-09-27 16:18:27 UTC
  • Revision ID: james.westby@ubuntu.com-20100927161827-1yfgolc1oy9sjhi8
Tags: upstream-8.0.1
ImportĀ upstreamĀ versionĀ 8.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Vertex shader test.
 
3
 * Uses all conventional attributes and 15 generic attributes to print
 
4
 * their values, using printMESA() extension function, to the debugger
 
5
 * to compare them with the actual passed-in values.
 
6
 * Use different types for generic attributes to check matrix handling.
 
7
 *
 
8
 * Author: Michal Krol
 
9
 */
 
10
 
 
11
#version 110
 
12
 
 
13
#extension MESA_shader_debug: require
 
14
 
 
15
attribute vec4 Attribute1;
 
16
attribute vec4 Attribute2;
 
17
attribute vec4 Attribute3;
 
18
attribute float Attribute4;
 
19
attribute vec2 Attribute5;
 
20
attribute vec3 Attribute6;
 
21
attribute mat2 Attribute7;
 
22
attribute mat3 Attribute9;
 
23
attribute mat4 Attribute12;
 
24
 
 
25
void main ()
 
26
{
 
27
   //
 
28
   // Do some legal stuff.
 
29
   //
 
30
   gl_Position = gl_ModelViewMatrix * gl_Vertex;
 
31
   gl_FrontColor = vec4 (1.0);
 
32
 
 
33
   //
 
34
   // Conventional attributes - except for gl_Vertex.
 
35
   //
 
36
   printMESA (gl_Color);
 
37
   printMESA (gl_SecondaryColor);
 
38
   printMESA (gl_Normal);
 
39
   printMESA (gl_MultiTexCoord0);
 
40
   printMESA (gl_MultiTexCoord1);
 
41
   printMESA (gl_MultiTexCoord2);
 
42
   printMESA (gl_MultiTexCoord3);
 
43
   printMESA (gl_MultiTexCoord4);
 
44
   printMESA (gl_MultiTexCoord5);
 
45
   printMESA (gl_MultiTexCoord6);
 
46
   printMESA (gl_MultiTexCoord7);
 
47
   printMESA (gl_FogCoord);
 
48
 
 
49
   //
 
50
   // Generic attributes - attrib with index 0 is not used because it would
 
51
   // alias with gl_Vertex, which is not allowed.
 
52
   //
 
53
   printMESA (Attribute1);
 
54
   printMESA (Attribute2);
 
55
   printMESA (Attribute3);
 
56
   printMESA (Attribute4);
 
57
   printMESA (Attribute5);
 
58
   printMESA (Attribute6);
 
59
   printMESA (Attribute7);
 
60
   printMESA (Attribute9);
 
61
   printMESA (Attribute12);
 
62
 
 
63
   //
 
64
   // Vertex position goes last.
 
65
   //
 
66
   printMESA (gl_Vertex);
 
67
}
 
68