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