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