1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Mesa 3-D graphics library
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
5bf215546Sopenharmony_ci * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
6bf215546Sopenharmony_ci * Copyright (C) 2018 Advanced Micro Devices, Inc.  All Rights Reserved.
7bf215546Sopenharmony_ci *
8bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
9bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
10bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
11bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
13bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
14bf215546Sopenharmony_ci *
15bf215546Sopenharmony_ci * The above copyright notice and this permission notice shall be included
16bf215546Sopenharmony_ci * in all copies or substantial portions of the Software.
17bf215546Sopenharmony_ci *
18bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19bf215546Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
21bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22bf215546Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23bf215546Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24bf215546Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
25bf215546Sopenharmony_ci */
26bf215546Sopenharmony_ci
27bf215546Sopenharmony_ci/**
28bf215546Sopenharmony_ci * \file menums.h
29bf215546Sopenharmony_ci * Often used definitions and enums.
30bf215546Sopenharmony_ci */
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_ci#ifndef MENUMS_H
33bf215546Sopenharmony_ci#define MENUMS_H
34bf215546Sopenharmony_ci
35bf215546Sopenharmony_ci#include "util/macros.h"
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ci/**
38bf215546Sopenharmony_ci * Enum for the OpenGL APIs we know about and may support.
39bf215546Sopenharmony_ci *
40bf215546Sopenharmony_ci * NOTE: This must match the api_enum table in
41bf215546Sopenharmony_ci * src/mesa/main/get_hash_generator.py
42bf215546Sopenharmony_ci */
43bf215546Sopenharmony_citypedef enum
44bf215546Sopenharmony_ci{
45bf215546Sopenharmony_ci   API_OPENGL_COMPAT,      /* legacy / compatibility contexts */
46bf215546Sopenharmony_ci   API_OPENGLES,
47bf215546Sopenharmony_ci   API_OPENGLES2,
48bf215546Sopenharmony_ci   API_OPENGL_CORE,
49bf215546Sopenharmony_ci   API_OPENGL_LAST = API_OPENGL_CORE
50bf215546Sopenharmony_ci} gl_api;
51bf215546Sopenharmony_ci
52bf215546Sopenharmony_ci/**
53bf215546Sopenharmony_ci * An index for each type of texture object.  These correspond to the GL
54bf215546Sopenharmony_ci * texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc.
55bf215546Sopenharmony_ci * Note: the order is from highest priority to lowest priority.
56bf215546Sopenharmony_ci */
57bf215546Sopenharmony_citypedef enum
58bf215546Sopenharmony_ci{
59bf215546Sopenharmony_ci   TEXTURE_2D_MULTISAMPLE_INDEX,
60bf215546Sopenharmony_ci   TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX,
61bf215546Sopenharmony_ci   TEXTURE_CUBE_ARRAY_INDEX,
62bf215546Sopenharmony_ci   TEXTURE_BUFFER_INDEX,
63bf215546Sopenharmony_ci   TEXTURE_2D_ARRAY_INDEX,
64bf215546Sopenharmony_ci   TEXTURE_1D_ARRAY_INDEX,
65bf215546Sopenharmony_ci   TEXTURE_EXTERNAL_INDEX,
66bf215546Sopenharmony_ci   TEXTURE_CUBE_INDEX,
67bf215546Sopenharmony_ci   TEXTURE_3D_INDEX,
68bf215546Sopenharmony_ci   TEXTURE_RECT_INDEX,
69bf215546Sopenharmony_ci   TEXTURE_2D_INDEX,
70bf215546Sopenharmony_ci   TEXTURE_1D_INDEX,
71bf215546Sopenharmony_ci   NUM_TEXTURE_TARGETS
72bf215546Sopenharmony_ci} gl_texture_index;
73bf215546Sopenharmony_ci
74bf215546Sopenharmony_ci/**
75bf215546Sopenharmony_ci * Remapped color logical operations
76bf215546Sopenharmony_ci *
77bf215546Sopenharmony_ci * With the exception of NVIDIA hardware, which consumes the OpenGL enumerants
78bf215546Sopenharmony_ci * directly, everything wants this mapping of color logical operations.
79bf215546Sopenharmony_ci *
80bf215546Sopenharmony_ci * Fun fact: These values are just the bit-reverse of the low-nibble of the GL
81bf215546Sopenharmony_ci * enumerant values (i.e., `GL_NOOP & 0x0f` is `b0101' while
82bf215546Sopenharmony_ci * \c COLOR_LOGICOP_NOOP is `b1010`).
83bf215546Sopenharmony_ci *
84bf215546Sopenharmony_ci * Fun fact #2: These values are just an encoding of the operation as a table
85bf215546Sopenharmony_ci * of bit values. The result of the logic op is:
86bf215546Sopenharmony_ci *
87bf215546Sopenharmony_ci *    result_bit = (logic_op >> (2 * src_bit + dst_bit)) & 1
88bf215546Sopenharmony_ci *
89bf215546Sopenharmony_ci * For the GL enums, the result is:
90bf215546Sopenharmony_ci *
91bf215546Sopenharmony_ci *    result_bit = logic_op & (1 << (2 * src_bit + dst_bit))
92bf215546Sopenharmony_ci */
93bf215546Sopenharmony_cienum PACKED gl_logicop_mode {
94bf215546Sopenharmony_ci   COLOR_LOGICOP_CLEAR = 0,
95bf215546Sopenharmony_ci   COLOR_LOGICOP_NOR = 1,
96bf215546Sopenharmony_ci   COLOR_LOGICOP_AND_INVERTED = 2,
97bf215546Sopenharmony_ci   COLOR_LOGICOP_COPY_INVERTED = 3,
98bf215546Sopenharmony_ci   COLOR_LOGICOP_AND_REVERSE = 4,
99bf215546Sopenharmony_ci   COLOR_LOGICOP_INVERT = 5,
100bf215546Sopenharmony_ci   COLOR_LOGICOP_XOR = 6,
101bf215546Sopenharmony_ci   COLOR_LOGICOP_NAND = 7,
102bf215546Sopenharmony_ci   COLOR_LOGICOP_AND = 8,
103bf215546Sopenharmony_ci   COLOR_LOGICOP_EQUIV = 9,
104bf215546Sopenharmony_ci   COLOR_LOGICOP_NOOP = 10,
105bf215546Sopenharmony_ci   COLOR_LOGICOP_OR_INVERTED = 11,
106bf215546Sopenharmony_ci   COLOR_LOGICOP_COPY = 12,
107bf215546Sopenharmony_ci   COLOR_LOGICOP_OR_REVERSE = 13,
108bf215546Sopenharmony_ci   COLOR_LOGICOP_OR = 14,
109bf215546Sopenharmony_ci   COLOR_LOGICOP_SET = 15
110bf215546Sopenharmony_ci};
111bf215546Sopenharmony_ci
112bf215546Sopenharmony_ci/**
113bf215546Sopenharmony_ci * Indexes for all renderbuffers
114bf215546Sopenharmony_ci */
115bf215546Sopenharmony_citypedef enum
116bf215546Sopenharmony_ci{
117bf215546Sopenharmony_ci   /* the four standard color buffers */
118bf215546Sopenharmony_ci   BUFFER_FRONT_LEFT,
119bf215546Sopenharmony_ci   BUFFER_BACK_LEFT,
120bf215546Sopenharmony_ci   BUFFER_FRONT_RIGHT,
121bf215546Sopenharmony_ci   BUFFER_BACK_RIGHT,
122bf215546Sopenharmony_ci   BUFFER_DEPTH,
123bf215546Sopenharmony_ci   BUFFER_STENCIL,
124bf215546Sopenharmony_ci   BUFFER_ACCUM,
125bf215546Sopenharmony_ci   /* generic renderbuffers */
126bf215546Sopenharmony_ci   BUFFER_COLOR0,
127bf215546Sopenharmony_ci   BUFFER_COLOR1,
128bf215546Sopenharmony_ci   BUFFER_COLOR2,
129bf215546Sopenharmony_ci   BUFFER_COLOR3,
130bf215546Sopenharmony_ci   BUFFER_COLOR4,
131bf215546Sopenharmony_ci   BUFFER_COLOR5,
132bf215546Sopenharmony_ci   BUFFER_COLOR6,
133bf215546Sopenharmony_ci   BUFFER_COLOR7,
134bf215546Sopenharmony_ci   BUFFER_COUNT,
135bf215546Sopenharmony_ci   BUFFER_NONE = -1,
136bf215546Sopenharmony_ci} gl_buffer_index;
137bf215546Sopenharmony_ci
138bf215546Sopenharmony_citypedef enum
139bf215546Sopenharmony_ci{
140bf215546Sopenharmony_ci   MAP_USER,
141bf215546Sopenharmony_ci   MAP_INTERNAL,
142bf215546Sopenharmony_ci   MAP_GLTHREAD,
143bf215546Sopenharmony_ci   MAP_COUNT
144bf215546Sopenharmony_ci} gl_map_buffer_index;
145bf215546Sopenharmony_ci
146bf215546Sopenharmony_ci/** @{
147bf215546Sopenharmony_ci *
148bf215546Sopenharmony_ci * These are a mapping of the GL_ARB_debug_output/GL_KHR_debug enums
149bf215546Sopenharmony_ci * to small enums suitable for use as an array index.
150bf215546Sopenharmony_ci */
151bf215546Sopenharmony_ci
152bf215546Sopenharmony_cienum mesa_debug_source
153bf215546Sopenharmony_ci{
154bf215546Sopenharmony_ci   MESA_DEBUG_SOURCE_API,
155bf215546Sopenharmony_ci   MESA_DEBUG_SOURCE_WINDOW_SYSTEM,
156bf215546Sopenharmony_ci   MESA_DEBUG_SOURCE_SHADER_COMPILER,
157bf215546Sopenharmony_ci   MESA_DEBUG_SOURCE_THIRD_PARTY,
158bf215546Sopenharmony_ci   MESA_DEBUG_SOURCE_APPLICATION,
159bf215546Sopenharmony_ci   MESA_DEBUG_SOURCE_OTHER,
160bf215546Sopenharmony_ci   MESA_DEBUG_SOURCE_COUNT
161bf215546Sopenharmony_ci};
162bf215546Sopenharmony_ci
163bf215546Sopenharmony_cienum mesa_debug_type
164bf215546Sopenharmony_ci{
165bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_ERROR,
166bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_DEPRECATED,
167bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_UNDEFINED,
168bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_PORTABILITY,
169bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_PERFORMANCE,
170bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_OTHER,
171bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_MARKER,
172bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_PUSH_GROUP,
173bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_POP_GROUP,
174bf215546Sopenharmony_ci   MESA_DEBUG_TYPE_COUNT
175bf215546Sopenharmony_ci};
176bf215546Sopenharmony_ci
177bf215546Sopenharmony_cienum mesa_debug_severity
178bf215546Sopenharmony_ci{
179bf215546Sopenharmony_ci   MESA_DEBUG_SEVERITY_LOW,
180bf215546Sopenharmony_ci   MESA_DEBUG_SEVERITY_MEDIUM,
181bf215546Sopenharmony_ci   MESA_DEBUG_SEVERITY_HIGH,
182bf215546Sopenharmony_ci   MESA_DEBUG_SEVERITY_NOTIFICATION,
183bf215546Sopenharmony_ci   MESA_DEBUG_SEVERITY_COUNT
184bf215546Sopenharmony_ci};
185bf215546Sopenharmony_ci
186bf215546Sopenharmony_ci/** @} */
187bf215546Sopenharmony_ci
188bf215546Sopenharmony_ci#endif
189