Use glsl_type::element_type to get the type of array elements
[mesa.git] / builtin_variables.h
1 /*
2 * Copyright © 2010 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24 struct builtin_variable {
25 enum ir_variable_mode mode;
26 const char *type;
27 const char *name;
28 };
29
30 static const builtin_variable builtin_core_vs_variables[] = {
31 { ir_var_out, "vec4", "gl_Position" },
32 { ir_var_out, "float", "gl_PointSize" },
33 };
34
35 static const builtin_variable builtin_core_fs_variables[] = {
36 { ir_var_out, "vec4", "gl_FragCoord" },
37 { ir_var_out, "bool", "gl_FrontFacing" },
38 { ir_var_out, "vec4", "gl_FragColor" },
39 { ir_var_out, "float", "gl_FragDepth" },
40 };
41
42 static const builtin_variable builtin_110_deprecated_fs_variables[] = {
43 { ir_var_in, "vec4", "gl_Color" },
44 { ir_var_in, "vec4", "gl_SecondaryColor" },
45 { ir_var_in, "vec4", "gl_FogFragCoord" },
46 };
47
48 static const builtin_variable builtin_110_deprecated_vs_variables[] = {
49 { ir_var_in, "vec4", "gl_Vertex" },
50 { ir_var_in, "vec4", "gl_Normal" },
51 { ir_var_in, "vec4", "gl_Color" },
52 { ir_var_in, "vec4", "gl_SecondaryColor" },
53 { ir_var_in, "vec4", "gl_MultiTexCoord0" },
54 { ir_var_in, "vec4", "gl_MultiTexCoord1" },
55 { ir_var_in, "vec4", "gl_MultiTexCoord2" },
56 { ir_var_in, "vec4", "gl_MultiTexCoord3" },
57 { ir_var_in, "vec4", "gl_MultiTexCoord4" },
58 { ir_var_in, "vec4", "gl_MultiTexCoord5" },
59 { ir_var_in, "vec4", "gl_MultiTexCoord6" },
60 { ir_var_in, "vec4", "gl_MultiTexCoord7" },
61 { ir_var_in, "float", "gl_FogCoord" },
62 { ir_var_out, "vec4", "gl_ClipVertex" },
63 { ir_var_out, "vec4", "gl_FrontColor" },
64 { ir_var_out, "vec4", "gl_BackColor" },
65 { ir_var_out, "vec4", "gl_FrontSecondaryColor" },
66 { ir_var_out, "vec4", "gl_BackSecondaryColor" },
67 { ir_var_out, "vec4", "gl_FogFragCoord" },
68 };
69
70 static const builtin_variable builtin_130_vs_variables[] = {
71 { ir_var_in, "int", "gl_VertexID" },
72 };
73
74 static const builtin_variable builtin_110_deprecated_uniforms[] = {
75 { ir_var_uniform, "mat4", "gl_ModelViewMatrix" },
76 { ir_var_uniform, "mat4", "gl_ProjectionMatrix" },
77 { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrix" },
78 { ir_var_uniform, "mat3", "gl_NormalMatrix" },
79 { ir_var_uniform, "mat4", "gl_ModelViewMatrixInverse" },
80 { ir_var_uniform, "mat4", "gl_ProjectionMatrixInverse" },
81 { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrixInverse" },
82 { ir_var_uniform, "mat4", "gl_ModelViewMatrixTranspose" },
83 { ir_var_uniform, "mat4", "gl_ProjectionMatrixTranspose" },
84 { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrixTranspose" },
85 { ir_var_uniform, "mat4", "gl_ModelViewMatrixInverseTranspose" },
86 { ir_var_uniform, "mat4", "gl_ProjectionMatrixInverseTranspose" },
87 { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrixInverseTranspose" },
88 { ir_var_uniform, "float", "gl_NormalScale" },
89 };
90