101e04c3fSmrg/*
201e04c3fSmrg * Mesa 3-D graphics library
301e04c3fSmrg *
401e04c3fSmrg * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
501e04c3fSmrg * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
601e04c3fSmrg * Copyright (C) 2018 Advanced Micro Devices, Inc.  All Rights Reserved.
701e04c3fSmrg *
801e04c3fSmrg * Permission is hereby granted, free of charge, to any person obtaining a
901e04c3fSmrg * copy of this software and associated documentation files (the "Software"),
1001e04c3fSmrg * to deal in the Software without restriction, including without limitation
1101e04c3fSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1201e04c3fSmrg * and/or sell copies of the Software, and to permit persons to whom the
1301e04c3fSmrg * Software is furnished to do so, subject to the following conditions:
1401e04c3fSmrg *
1501e04c3fSmrg * The above copyright notice and this permission notice shall be included
1601e04c3fSmrg * in all copies or substantial portions of the Software.
1701e04c3fSmrg *
1801e04c3fSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1901e04c3fSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2001e04c3fSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
2101e04c3fSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2201e04c3fSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2301e04c3fSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2401e04c3fSmrg * OTHER DEALINGS IN THE SOFTWARE.
2501e04c3fSmrg */
2601e04c3fSmrg
2701e04c3fSmrg/**
2801e04c3fSmrg * \file menums.h
2901e04c3fSmrg * Often used definitions and enums.
3001e04c3fSmrg */
3101e04c3fSmrg
3201e04c3fSmrg#ifndef MENUMS_H
3301e04c3fSmrg#define MENUMS_H
3401e04c3fSmrg
3501e04c3fSmrg#include "util/macros.h"
3601e04c3fSmrg
3701e04c3fSmrg/**
3801e04c3fSmrg * Enum for the OpenGL APIs we know about and may support.
3901e04c3fSmrg *
4001e04c3fSmrg * NOTE: This must match the api_enum table in
4101e04c3fSmrg * src/mesa/main/get_hash_generator.py
4201e04c3fSmrg */
4301e04c3fSmrgtypedef enum
4401e04c3fSmrg{
4501e04c3fSmrg   API_OPENGL_COMPAT,      /* legacy / compatibility contexts */
4601e04c3fSmrg   API_OPENGLES,
4701e04c3fSmrg   API_OPENGLES2,
4801e04c3fSmrg   API_OPENGL_CORE,
4901e04c3fSmrg   API_OPENGL_LAST = API_OPENGL_CORE
5001e04c3fSmrg} gl_api;
5101e04c3fSmrg
5201e04c3fSmrg/**
5301e04c3fSmrg * An index for each type of texture object.  These correspond to the GL
5401e04c3fSmrg * texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc.
5501e04c3fSmrg * Note: the order is from highest priority to lowest priority.
5601e04c3fSmrg */
5701e04c3fSmrgtypedef enum
5801e04c3fSmrg{
5901e04c3fSmrg   TEXTURE_2D_MULTISAMPLE_INDEX,
6001e04c3fSmrg   TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX,
6101e04c3fSmrg   TEXTURE_CUBE_ARRAY_INDEX,
6201e04c3fSmrg   TEXTURE_BUFFER_INDEX,
6301e04c3fSmrg   TEXTURE_2D_ARRAY_INDEX,
6401e04c3fSmrg   TEXTURE_1D_ARRAY_INDEX,
6501e04c3fSmrg   TEXTURE_EXTERNAL_INDEX,
6601e04c3fSmrg   TEXTURE_CUBE_INDEX,
6701e04c3fSmrg   TEXTURE_3D_INDEX,
6801e04c3fSmrg   TEXTURE_RECT_INDEX,
6901e04c3fSmrg   TEXTURE_2D_INDEX,
7001e04c3fSmrg   TEXTURE_1D_INDEX,
7101e04c3fSmrg   NUM_TEXTURE_TARGETS
7201e04c3fSmrg} gl_texture_index;
7301e04c3fSmrg
7401e04c3fSmrg/**
7501e04c3fSmrg * Remapped color logical operations
7601e04c3fSmrg *
7701e04c3fSmrg * With the exception of NVIDIA hardware, which consumes the OpenGL enumerants
7801e04c3fSmrg * directly, everything wants this mapping of color logical operations.
7901e04c3fSmrg *
8001e04c3fSmrg * Fun fact: These values are just the bit-reverse of the low-nibble of the GL
8101e04c3fSmrg * enumerant values (i.e., `GL_NOOP & 0x0f` is `b0101' while
8201e04c3fSmrg * \c COLOR_LOGICOP_NOOP is `b1010`).
8301e04c3fSmrg *
8401e04c3fSmrg * Fun fact #2: These values are just an encoding of the operation as a table
8501e04c3fSmrg * of bit values. The result of the logic op is:
8601e04c3fSmrg *
8701e04c3fSmrg *    result_bit = (logic_op >> (2 * src_bit + dst_bit)) & 1
8801e04c3fSmrg *
8901e04c3fSmrg * For the GL enums, the result is:
9001e04c3fSmrg *
9101e04c3fSmrg *    result_bit = logic_op & (1 << (2 * src_bit + dst_bit))
9201e04c3fSmrg */
9301e04c3fSmrgenum PACKED gl_logicop_mode {
9401e04c3fSmrg   COLOR_LOGICOP_CLEAR = 0,
9501e04c3fSmrg   COLOR_LOGICOP_NOR = 1,
9601e04c3fSmrg   COLOR_LOGICOP_AND_INVERTED = 2,
9701e04c3fSmrg   COLOR_LOGICOP_COPY_INVERTED = 3,
9801e04c3fSmrg   COLOR_LOGICOP_AND_REVERSE = 4,
9901e04c3fSmrg   COLOR_LOGICOP_INVERT = 5,
10001e04c3fSmrg   COLOR_LOGICOP_XOR = 6,
10101e04c3fSmrg   COLOR_LOGICOP_NAND = 7,
10201e04c3fSmrg   COLOR_LOGICOP_AND = 8,
10301e04c3fSmrg   COLOR_LOGICOP_EQUIV = 9,
10401e04c3fSmrg   COLOR_LOGICOP_NOOP = 10,
10501e04c3fSmrg   COLOR_LOGICOP_OR_INVERTED = 11,
10601e04c3fSmrg   COLOR_LOGICOP_COPY = 12,
10701e04c3fSmrg   COLOR_LOGICOP_OR_REVERSE = 13,
10801e04c3fSmrg   COLOR_LOGICOP_OR = 14,
10901e04c3fSmrg   COLOR_LOGICOP_SET = 15
11001e04c3fSmrg};
11101e04c3fSmrg
11201e04c3fSmrg/**
11301e04c3fSmrg * Indexes for all renderbuffers
11401e04c3fSmrg */
11501e04c3fSmrgtypedef enum
11601e04c3fSmrg{
11701e04c3fSmrg   /* the four standard color buffers */
11801e04c3fSmrg   BUFFER_FRONT_LEFT,
11901e04c3fSmrg   BUFFER_BACK_LEFT,
12001e04c3fSmrg   BUFFER_FRONT_RIGHT,
12101e04c3fSmrg   BUFFER_BACK_RIGHT,
12201e04c3fSmrg   BUFFER_DEPTH,
12301e04c3fSmrg   BUFFER_STENCIL,
12401e04c3fSmrg   BUFFER_ACCUM,
12501e04c3fSmrg   /* generic renderbuffers */
12601e04c3fSmrg   BUFFER_COLOR0,
12701e04c3fSmrg   BUFFER_COLOR1,
12801e04c3fSmrg   BUFFER_COLOR2,
12901e04c3fSmrg   BUFFER_COLOR3,
13001e04c3fSmrg   BUFFER_COLOR4,
13101e04c3fSmrg   BUFFER_COLOR5,
13201e04c3fSmrg   BUFFER_COLOR6,
13301e04c3fSmrg   BUFFER_COLOR7,
13401e04c3fSmrg   BUFFER_COUNT,
13501e04c3fSmrg   BUFFER_NONE = -1,
13601e04c3fSmrg} gl_buffer_index;
13701e04c3fSmrg
13801e04c3fSmrgtypedef enum
13901e04c3fSmrg{
14001e04c3fSmrg   MAP_USER,
14101e04c3fSmrg   MAP_INTERNAL,
1427ec681f3Smrg   MAP_GLTHREAD,
14301e04c3fSmrg   MAP_COUNT
14401e04c3fSmrg} gl_map_buffer_index;
14501e04c3fSmrg
14601e04c3fSmrg/** @{
14701e04c3fSmrg *
14801e04c3fSmrg * These are a mapping of the GL_ARB_debug_output/GL_KHR_debug enums
14901e04c3fSmrg * to small enums suitable for use as an array index.
15001e04c3fSmrg */
15101e04c3fSmrg
15201e04c3fSmrgenum mesa_debug_source
15301e04c3fSmrg{
15401e04c3fSmrg   MESA_DEBUG_SOURCE_API,
15501e04c3fSmrg   MESA_DEBUG_SOURCE_WINDOW_SYSTEM,
15601e04c3fSmrg   MESA_DEBUG_SOURCE_SHADER_COMPILER,
15701e04c3fSmrg   MESA_DEBUG_SOURCE_THIRD_PARTY,
15801e04c3fSmrg   MESA_DEBUG_SOURCE_APPLICATION,
15901e04c3fSmrg   MESA_DEBUG_SOURCE_OTHER,
16001e04c3fSmrg   MESA_DEBUG_SOURCE_COUNT
16101e04c3fSmrg};
16201e04c3fSmrg
16301e04c3fSmrgenum mesa_debug_type
16401e04c3fSmrg{
16501e04c3fSmrg   MESA_DEBUG_TYPE_ERROR,
16601e04c3fSmrg   MESA_DEBUG_TYPE_DEPRECATED,
16701e04c3fSmrg   MESA_DEBUG_TYPE_UNDEFINED,
16801e04c3fSmrg   MESA_DEBUG_TYPE_PORTABILITY,
16901e04c3fSmrg   MESA_DEBUG_TYPE_PERFORMANCE,
17001e04c3fSmrg   MESA_DEBUG_TYPE_OTHER,
17101e04c3fSmrg   MESA_DEBUG_TYPE_MARKER,
17201e04c3fSmrg   MESA_DEBUG_TYPE_PUSH_GROUP,
17301e04c3fSmrg   MESA_DEBUG_TYPE_POP_GROUP,
17401e04c3fSmrg   MESA_DEBUG_TYPE_COUNT
17501e04c3fSmrg};
17601e04c3fSmrg
17701e04c3fSmrgenum mesa_debug_severity
17801e04c3fSmrg{
17901e04c3fSmrg   MESA_DEBUG_SEVERITY_LOW,
18001e04c3fSmrg   MESA_DEBUG_SEVERITY_MEDIUM,
18101e04c3fSmrg   MESA_DEBUG_SEVERITY_HIGH,
18201e04c3fSmrg   MESA_DEBUG_SEVERITY_NOTIFICATION,
18301e04c3fSmrg   MESA_DEBUG_SEVERITY_COUNT
18401e04c3fSmrg};
18501e04c3fSmrg
18601e04c3fSmrg/** @} */
18701e04c3fSmrg
18801e04c3fSmrg#endif
189