• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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[4] =
36 {
37    "FRAG",
38    "VERT",
39    "GEOM",
40    "COMP"
41 };
42 
43 const char *tgsi_file_names[TGSI_FILE_COUNT] =
44 {
45    "NULL",
46    "CONST",
47    "IN",
48    "OUT",
49    "TEMP",
50    "SAMP",
51    "ADDR",
52    "IMM",
53    "PRED",
54    "SV",
55    "IMMX",
56    "TEMPX",
57    "RES",
58    "SVIEW"
59 };
60 
61 const char *tgsi_semantic_names[TGSI_SEMANTIC_COUNT] =
62 {
63    "POSITION",
64    "COLOR",
65    "BCOLOR",
66    "FOG",
67    "PSIZE",
68    "GENERIC",
69    "NORMAL",
70    "FACE",
71    "EDGEFLAG",
72    "PRIM_ID",
73    "INSTANCEID",
74    "VERTEXID",
75    "STENCIL",
76    "CLIPDIST",
77    "CLIPVERTEX",
78    "GRID_SIZE",
79    "BLOCK_ID",
80    "BLOCK_SIZE",
81    "THREAD_ID"
82 };
83 
84 const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
85 {
86    "BUFFER",
87    "1D",
88    "2D",
89    "3D",
90    "CUBE",
91    "RECT",
92    "SHADOW1D",
93    "SHADOW2D",
94    "SHADOWRECT",
95    "1D_ARRAY",
96    "2D_ARRAY",
97    "SHADOW1D_ARRAY",
98    "SHADOW2D_ARRAY",
99    "SHADOWCUBE",
100    "2D_MSAA",
101    "2D_ARRAY_MSAA",
102    "UNKNOWN"
103 };
104 
105 const char *tgsi_property_names[TGSI_PROPERTY_COUNT] =
106 {
107    "GS_INPUT_PRIMITIVE",
108    "GS_OUTPUT_PRIMITIVE",
109    "GS_MAX_OUTPUT_VERTICES",
110    "FS_COORD_ORIGIN",
111    "FS_COORD_PIXEL_CENTER",
112    "FS_COLOR0_WRITES_ALL_CBUFS",
113    "FS_DEPTH_LAYOUT",
114    "VS_PROHIBIT_UCPS"
115 };
116 
117 const char *tgsi_type_names[5] =
118 {
119    "UNORM",
120    "SNORM",
121    "SINT",
122    "UINT",
123    "FLOAT"
124 };
125 
126 const char *tgsi_interpolate_names[TGSI_INTERPOLATE_COUNT] =
127 {
128    "CONSTANT",
129    "LINEAR",
130    "PERSPECTIVE",
131    "COLOR"
132 };
133 
134 const char *tgsi_primitive_names[PIPE_PRIM_MAX] =
135 {
136    "POINTS",
137    "LINES",
138    "LINE_LOOP",
139    "LINE_STRIP",
140    "TRIANGLES",
141    "TRIANGLE_STRIP",
142    "TRIANGLE_FAN",
143    "QUADS",
144    "QUAD_STRIP",
145    "POLYGON",
146    "LINES_ADJACENCY",
147    "LINE_STRIP_ADJACENCY",
148    "TRIANGLES_ADJACENCY",
149    "TRIANGLE_STRIP_ADJACENCY"
150 };
151 
152 const char *tgsi_fs_coord_origin_names[2] =
153 {
154    "UPPER_LEFT",
155    "LOWER_LEFT"
156 };
157 
158 const char *tgsi_fs_coord_pixel_center_names[2] =
159 {
160    "HALF_INTEGER",
161    "INTEGER"
162 };
163 
164 const char *tgsi_immediate_type_names[3] =
165 {
166    "FLT32",
167    "UINT32",
168    "INT32"
169 };
170 
171 
172 static INLINE void
tgsi_strings_check(void)173 tgsi_strings_check(void)
174 {
175    STATIC_ASSERT(Elements(tgsi_file_names) == TGSI_FILE_COUNT);
176    STATIC_ASSERT(Elements(tgsi_semantic_names) == TGSI_SEMANTIC_COUNT);
177    STATIC_ASSERT(Elements(tgsi_texture_names) == TGSI_TEXTURE_COUNT);
178    STATIC_ASSERT(Elements(tgsi_property_names) == TGSI_PROPERTY_COUNT);
179    STATIC_ASSERT(Elements(tgsi_primitive_names) == PIPE_PRIM_MAX);
180    STATIC_ASSERT(Elements(tgsi_interpolate_names) == TGSI_INTERPOLATE_COUNT);
181    (void) tgsi_processor_type_names;
182    (void) tgsi_type_names;
183    (void) tgsi_immediate_type_names;
184    (void) tgsi_fs_coord_origin_names;
185    (void) tgsi_fs_coord_pixel_center_names;
186 }
187