1b8e80941Smrg/* Copyright (c) 2008 VMware, Inc. 2b8e80941Smrg * Copyright © 2018 Intel Corporation 3b8e80941Smrg * 4b8e80941Smrg * Permission is hereby granted, free of charge, to any person obtaining a copy 5b8e80941Smrg * of this software and associated documentation files (the "Software"), to deal 6b8e80941Smrg * in the Software without restriction, including without limitation the rights 7b8e80941Smrg * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8b8e80941Smrg * copies of the Software, and to permit persons to whom the Software is 9b8e80941Smrg * furnished to do so, subject to the following conditions: 10b8e80941Smrg * 11b8e80941Smrg * The above copyright notice and this permission notice shall be included in 12b8e80941Smrg * all copies or substantial portions of the Software. 13b8e80941Smrg * 14b8e80941Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15b8e80941Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16b8e80941Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17b8e80941Smrg * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18b8e80941Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19b8e80941Smrg * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20b8e80941Smrg * SOFTWARE. 21b8e80941Smrg */ 22b8e80941Smrg 23b8e80941Smrg#include "u_prim.h" 24b8e80941Smrg 25b8e80941Smrg 26b8e80941Smrg/** Return string name of given primitive type */ 27b8e80941Smrgconst char * 28b8e80941Smrgu_prim_name(enum pipe_prim_type prim) 29b8e80941Smrg{ 30b8e80941Smrg static const struct debug_named_value names[] = { 31b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_POINTS), 32b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_LINES), 33b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_LOOP), 34b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP), 35b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES), 36b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP), 37b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_FAN), 38b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_QUADS), 39b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_QUAD_STRIP), 40b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_POLYGON), 41b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_LINES_ADJACENCY), 42b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP_ADJACENCY), 43b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES_ADJACENCY), 44b8e80941Smrg DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY), 45b8e80941Smrg DEBUG_NAMED_VALUE_END 46b8e80941Smrg }; 47b8e80941Smrg return debug_dump_enum(names, prim); 48b8e80941Smrg} 49