[OPENGL]
[reactos.git] / reactos / dll / opengl / mesa / src / gallium / auxiliary / tgsi / tgsi_strings.c
1 /**************************************************************************
2 *
3 * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * Copyright 2012 VMware, Inc.
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
17 * of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR
23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 *
27 **************************************************************************/
28
29
30 #include "pipe/p_compiler.h"
31 #include "util/u_memory.h"
32 #include "tgsi_strings.h"
33
34
35 const char *tgsi_processor_type_names[3] =
36 {
37 "FRAG",
38 "VERT",
39 "GEOM"
40 };
41
42 const char *tgsi_file_names[TGSI_FILE_COUNT] =
43 {
44 "NULL",
45 "CONST",
46 "IN",
47 "OUT",
48 "TEMP",
49 "SAMP",
50 "ADDR",
51 "IMM",
52 "PRED",
53 "SV",
54 "IMMX",
55 "TEMPX",
56 "RES"
57 };
58
59 const char *tgsi_semantic_names[TGSI_SEMANTIC_COUNT] =
60 {
61 "POSITION",
62 "COLOR",
63 "BCOLOR",
64 "FOG",
65 "PSIZE",
66 "GENERIC",
67 "NORMAL",
68 "FACE",
69 "EDGEFLAG",
70 "PRIM_ID",
71 "INSTANCEID",
72 "VERTEXID",
73 "STENCIL",
74 "CLIPDIST",
75 "CLIPVERTEX"
76 };
77
78 const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
79 {
80 "UNKNOWN",
81 "1D",
82 "2D",
83 "3D",
84 "CUBE",
85 "RECT",
86 "SHADOW1D",
87 "SHADOW2D",
88 "SHADOWRECT",
89 "1DARRAY",
90 "2DARRAY",
91 "SHADOW1DARRAY",
92 "SHADOW2DARRAY",
93 "SHADOWCUBE"
94 };
95
96 const char *tgsi_property_names[TGSI_PROPERTY_COUNT] =
97 {
98 "GS_INPUT_PRIMITIVE",
99 "GS_OUTPUT_PRIMITIVE",
100 "GS_MAX_OUTPUT_VERTICES",
101 "FS_COORD_ORIGIN",
102 "FS_COORD_PIXEL_CENTER",
103 "FS_COLOR0_WRITES_ALL_CBUFS",
104 "FS_DEPTH_LAYOUT",
105 "VS_PROHIBIT_UCPS"
106 };
107
108 const char *tgsi_type_names[5] =
109 {
110 "UNORM",
111 "SNORM",
112 "SINT",
113 "UINT",
114 "FLOAT"
115 };
116
117 const char *tgsi_interpolate_names[TGSI_INTERPOLATE_COUNT] =
118 {
119 "CONSTANT",
120 "LINEAR",
121 "PERSPECTIVE",
122 "COLOR"
123 };
124
125 const char *tgsi_primitive_names[PIPE_PRIM_MAX] =
126 {
127 "POINTS",
128 "LINES",
129 "LINE_LOOP",
130 "LINE_STRIP",
131 "TRIANGLES",
132 "TRIANGLE_STRIP",
133 "TRIANGLE_FAN",
134 "QUADS",
135 "QUAD_STRIP",
136 "POLYGON",
137 "LINES_ADJACENCY",
138 "LINE_STRIP_ADJACENCY",
139 "TRIANGLES_ADJACENCY",
140 "TRIANGLE_STRIP_ADJACENCY"
141 };
142
143 const char *tgsi_fs_coord_origin_names[2] =
144 {
145 "UPPER_LEFT",
146 "LOWER_LEFT"
147 };
148
149 const char *tgsi_fs_coord_pixel_center_names[2] =
150 {
151 "HALF_INTEGER",
152 "INTEGER"
153 };
154
155 const char *tgsi_immediate_type_names[3] =
156 {
157 "FLT32",
158 "UINT32",
159 "INT32"
160 };
161
162
163 static INLINE void
164 tgsi_strings_check(void)
165 {
166 STATIC_ASSERT(Elements(tgsi_file_names) == TGSI_FILE_COUNT);
167 STATIC_ASSERT(Elements(tgsi_semantic_names) == TGSI_SEMANTIC_COUNT);
168 STATIC_ASSERT(Elements(tgsi_texture_names) == TGSI_TEXTURE_COUNT);
169 STATIC_ASSERT(Elements(tgsi_property_names) == TGSI_PROPERTY_COUNT);
170 STATIC_ASSERT(Elements(tgsi_primitive_names) == PIPE_PRIM_MAX);
171 STATIC_ASSERT(Elements(tgsi_interpolate_names) == TGSI_INTERPOLATE_COUNT);
172 (void) tgsi_processor_type_names;
173 (void) tgsi_type_names;
174 (void) tgsi_immediate_type_names;
175 (void) tgsi_fs_coord_origin_names;
176 (void) tgsi_fs_coord_pixel_center_names;
177 }