gallium: add support for clip distances
[mesa.git] / 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 };
76
77 const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
78 {
79 "UNKNOWN",
80 "1D",
81 "2D",
82 "3D",
83 "CUBE",
84 "RECT",
85 "SHADOW1D",
86 "SHADOW2D",
87 "SHADOWRECT",
88 "1DARRAY",
89 "2DARRAY",
90 "SHADOW1DARRAY",
91 "SHADOW2DARRAY",
92 };
93
94 const char *tgsi_property_names[TGSI_PROPERTY_COUNT] =
95 {
96 "GS_INPUT_PRIMITIVE",
97 "GS_OUTPUT_PRIMITIVE",
98 "GS_MAX_OUTPUT_VERTICES",
99 "FS_COORD_ORIGIN",
100 "FS_COORD_PIXEL_CENTER",
101 "FS_COLOR0_WRITES_ALL_CBUFS",
102 "FS_DEPTH_LAYOUT"
103 };
104
105 const char *tgsi_type_names[5] =
106 {
107 "UNORM",
108 "SNORM",
109 "SINT",
110 "UINT",
111 "FLOAT"
112 };
113
114 const char *tgsi_interpolate_names[TGSI_INTERPOLATE_COUNT] =
115 {
116 "CONSTANT",
117 "LINEAR",
118 "PERSPECTIVE"
119 };
120
121 const char *tgsi_primitive_names[PIPE_PRIM_MAX] =
122 {
123 "POINTS",
124 "LINES",
125 "LINE_LOOP",
126 "LINE_STRIP",
127 "TRIANGLES",
128 "TRIANGLE_STRIP",
129 "TRIANGLE_FAN",
130 "QUADS",
131 "QUAD_STRIP",
132 "POLYGON",
133 "LINES_ADJACENCY",
134 "LINE_STRIP_ADJACENCY",
135 "TRIANGLES_ADJACENCY",
136 "TRIANGLE_STRIP_ADJACENCY"
137 };
138
139 const char *tgsi_fs_coord_origin_names[2] =
140 {
141 "UPPER_LEFT",
142 "LOWER_LEFT"
143 };
144
145 const char *tgsi_fs_coord_pixel_center_names[2] =
146 {
147 "HALF_INTEGER",
148 "INTEGER"
149 };
150
151 const char *tgsi_immediate_type_names[3] =
152 {
153 "FLT32",
154 "UINT32",
155 "INT32"
156 };
157
158
159 static INLINE void
160 tgsi_strings_check(void)
161 {
162 STATIC_ASSERT(Elements(tgsi_file_names) == TGSI_FILE_COUNT);
163 STATIC_ASSERT(Elements(tgsi_semantic_names) == TGSI_SEMANTIC_COUNT);
164 STATIC_ASSERT(Elements(tgsi_texture_names) == TGSI_TEXTURE_COUNT);
165 STATIC_ASSERT(Elements(tgsi_property_names) == TGSI_PROPERTY_COUNT);
166 STATIC_ASSERT(Elements(tgsi_primitive_names) == PIPE_PRIM_MAX);
167 STATIC_ASSERT(Elements(tgsi_interpolate_names) == TGSI_INTERPOLATE_COUNT);
168 (void) tgsi_processor_type_names;
169 (void) tgsi_type_names;
170 (void) tgsi_immediate_type_names;
171 (void) tgsi_fs_coord_origin_names;
172 (void) tgsi_fs_coord_pixel_center_names;
173 }