tgsi_strings.c revision 67a3e5bc32fe359b54121355295e6a19a24b44eb
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
35const char *tgsi_processor_type_names[4] =
36{
37   "FRAG",
38   "VERT",
39   "GEOM",
40   "COMP"
41};
42
43const 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
61const 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
84const 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   "UNKNOWN"
101};
102
103const char *tgsi_property_names[TGSI_PROPERTY_COUNT] =
104{
105   "GS_INPUT_PRIMITIVE",
106   "GS_OUTPUT_PRIMITIVE",
107   "GS_MAX_OUTPUT_VERTICES",
108   "FS_COORD_ORIGIN",
109   "FS_COORD_PIXEL_CENTER",
110   "FS_COLOR0_WRITES_ALL_CBUFS",
111   "FS_DEPTH_LAYOUT",
112   "VS_PROHIBIT_UCPS"
113};
114
115const char *tgsi_type_names[5] =
116{
117   "UNORM",
118   "SNORM",
119   "SINT",
120   "UINT",
121   "FLOAT"
122};
123
124const char *tgsi_interpolate_names[TGSI_INTERPOLATE_COUNT] =
125{
126   "CONSTANT",
127   "LINEAR",
128   "PERSPECTIVE",
129   "COLOR"
130};
131
132const char *tgsi_primitive_names[PIPE_PRIM_MAX] =
133{
134   "POINTS",
135   "LINES",
136   "LINE_LOOP",
137   "LINE_STRIP",
138   "TRIANGLES",
139   "TRIANGLE_STRIP",
140   "TRIANGLE_FAN",
141   "QUADS",
142   "QUAD_STRIP",
143   "POLYGON",
144   "LINES_ADJACENCY",
145   "LINE_STRIP_ADJACENCY",
146   "TRIANGLES_ADJACENCY",
147   "TRIANGLE_STRIP_ADJACENCY"
148};
149
150const char *tgsi_fs_coord_origin_names[2] =
151{
152   "UPPER_LEFT",
153   "LOWER_LEFT"
154};
155
156const char *tgsi_fs_coord_pixel_center_names[2] =
157{
158   "HALF_INTEGER",
159   "INTEGER"
160};
161
162const char *tgsi_immediate_type_names[3] =
163{
164   "FLT32",
165   "UINT32",
166   "INT32"
167};
168
169
170static INLINE void
171tgsi_strings_check(void)
172{
173   STATIC_ASSERT(Elements(tgsi_file_names) == TGSI_FILE_COUNT);
174   STATIC_ASSERT(Elements(tgsi_semantic_names) == TGSI_SEMANTIC_COUNT);
175   STATIC_ASSERT(Elements(tgsi_texture_names) == TGSI_TEXTURE_COUNT);
176   STATIC_ASSERT(Elements(tgsi_property_names) == TGSI_PROPERTY_COUNT);
177   STATIC_ASSERT(Elements(tgsi_primitive_names) == PIPE_PRIM_MAX);
178   STATIC_ASSERT(Elements(tgsi_interpolate_names) == TGSI_INTERPOLATE_COUNT);
179   (void) tgsi_processor_type_names;
180   (void) tgsi_type_names;
181   (void) tgsi_immediate_type_names;
182   (void) tgsi_fs_coord_origin_names;
183   (void) tgsi_fs_coord_pixel_center_names;
184}
185