1bf215546Sopenharmony_ci/************************************************************************** 2bf215546Sopenharmony_ci * 3bf215546Sopenharmony_ci * Copyright 2007 VMware, Inc. 4bf215546Sopenharmony_ci * All Rights Reserved. 5bf215546Sopenharmony_ci * 6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the 8bf215546Sopenharmony_ci * "Software"), to deal in the Software without restriction, including 9bf215546Sopenharmony_ci * without limitation the rights to use, copy, modify, merge, publish, 10bf215546Sopenharmony_ci * distribute, sub license, and/or sell copies of the Software, and to 11bf215546Sopenharmony_ci * permit persons to whom the Software is furnished to do so, subject to 12bf215546Sopenharmony_ci * the following conditions: 13bf215546Sopenharmony_ci * 14bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the 15bf215546Sopenharmony_ci * next paragraph) shall be included in all copies or substantial portions 16bf215546Sopenharmony_ci * 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 20bf215546Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21bf215546Sopenharmony_ci * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 22bf215546Sopenharmony_ci * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23bf215546Sopenharmony_ci * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24bf215546Sopenharmony_ci * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25bf215546Sopenharmony_ci * 26bf215546Sopenharmony_ci **************************************************************************/ 27bf215546Sopenharmony_ci 28bf215546Sopenharmony_ci#ifndef PIPE_DEFINES_H 29bf215546Sopenharmony_ci#define PIPE_DEFINES_H 30bf215546Sopenharmony_ci 31bf215546Sopenharmony_ci#include "p_compiler.h" 32bf215546Sopenharmony_ci 33bf215546Sopenharmony_ci#ifdef __cplusplus 34bf215546Sopenharmony_ciextern "C" { 35bf215546Sopenharmony_ci#endif 36bf215546Sopenharmony_ci 37bf215546Sopenharmony_ci/** 38bf215546Sopenharmony_ci * Gallium error codes. 39bf215546Sopenharmony_ci * 40bf215546Sopenharmony_ci * - A zero value always means success. 41bf215546Sopenharmony_ci * - A negative value always means failure. 42bf215546Sopenharmony_ci * - The meaning of a positive value is function dependent. 43bf215546Sopenharmony_ci */ 44bf215546Sopenharmony_cienum pipe_error 45bf215546Sopenharmony_ci{ 46bf215546Sopenharmony_ci PIPE_OK = 0, 47bf215546Sopenharmony_ci PIPE_ERROR = -1, /**< Generic error */ 48bf215546Sopenharmony_ci PIPE_ERROR_BAD_INPUT = -2, 49bf215546Sopenharmony_ci PIPE_ERROR_OUT_OF_MEMORY = -3, 50bf215546Sopenharmony_ci PIPE_ERROR_RETRY = -4 51bf215546Sopenharmony_ci /* TODO */ 52bf215546Sopenharmony_ci}; 53bf215546Sopenharmony_ci 54bf215546Sopenharmony_cienum pipe_blendfactor { 55bf215546Sopenharmony_ci PIPE_BLENDFACTOR_ONE = 1, 56bf215546Sopenharmony_ci PIPE_BLENDFACTOR_SRC_COLOR, 57bf215546Sopenharmony_ci PIPE_BLENDFACTOR_SRC_ALPHA, 58bf215546Sopenharmony_ci PIPE_BLENDFACTOR_DST_ALPHA, 59bf215546Sopenharmony_ci PIPE_BLENDFACTOR_DST_COLOR, 60bf215546Sopenharmony_ci PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE, 61bf215546Sopenharmony_ci PIPE_BLENDFACTOR_CONST_COLOR, 62bf215546Sopenharmony_ci PIPE_BLENDFACTOR_CONST_ALPHA, 63bf215546Sopenharmony_ci PIPE_BLENDFACTOR_SRC1_COLOR, 64bf215546Sopenharmony_ci PIPE_BLENDFACTOR_SRC1_ALPHA, 65bf215546Sopenharmony_ci 66bf215546Sopenharmony_ci PIPE_BLENDFACTOR_ZERO = 0x11, 67bf215546Sopenharmony_ci PIPE_BLENDFACTOR_INV_SRC_COLOR, 68bf215546Sopenharmony_ci PIPE_BLENDFACTOR_INV_SRC_ALPHA, 69bf215546Sopenharmony_ci PIPE_BLENDFACTOR_INV_DST_ALPHA, 70bf215546Sopenharmony_ci PIPE_BLENDFACTOR_INV_DST_COLOR, 71bf215546Sopenharmony_ci 72bf215546Sopenharmony_ci PIPE_BLENDFACTOR_INV_CONST_COLOR = 0x17, 73bf215546Sopenharmony_ci PIPE_BLENDFACTOR_INV_CONST_ALPHA, 74bf215546Sopenharmony_ci PIPE_BLENDFACTOR_INV_SRC1_COLOR, 75bf215546Sopenharmony_ci PIPE_BLENDFACTOR_INV_SRC1_ALPHA, 76bf215546Sopenharmony_ci}; 77bf215546Sopenharmony_ci 78bf215546Sopenharmony_cienum pipe_blend_func { 79bf215546Sopenharmony_ci PIPE_BLEND_ADD, 80bf215546Sopenharmony_ci PIPE_BLEND_SUBTRACT, 81bf215546Sopenharmony_ci PIPE_BLEND_REVERSE_SUBTRACT, 82bf215546Sopenharmony_ci PIPE_BLEND_MIN, 83bf215546Sopenharmony_ci PIPE_BLEND_MAX, 84bf215546Sopenharmony_ci}; 85bf215546Sopenharmony_ci 86bf215546Sopenharmony_cienum pipe_logicop { 87bf215546Sopenharmony_ci PIPE_LOGICOP_CLEAR, 88bf215546Sopenharmony_ci PIPE_LOGICOP_NOR, 89bf215546Sopenharmony_ci PIPE_LOGICOP_AND_INVERTED, 90bf215546Sopenharmony_ci PIPE_LOGICOP_COPY_INVERTED, 91bf215546Sopenharmony_ci PIPE_LOGICOP_AND_REVERSE, 92bf215546Sopenharmony_ci PIPE_LOGICOP_INVERT, 93bf215546Sopenharmony_ci PIPE_LOGICOP_XOR, 94bf215546Sopenharmony_ci PIPE_LOGICOP_NAND, 95bf215546Sopenharmony_ci PIPE_LOGICOP_AND, 96bf215546Sopenharmony_ci PIPE_LOGICOP_EQUIV, 97bf215546Sopenharmony_ci PIPE_LOGICOP_NOOP, 98bf215546Sopenharmony_ci PIPE_LOGICOP_OR_INVERTED, 99bf215546Sopenharmony_ci PIPE_LOGICOP_COPY, 100bf215546Sopenharmony_ci PIPE_LOGICOP_OR_REVERSE, 101bf215546Sopenharmony_ci PIPE_LOGICOP_OR, 102bf215546Sopenharmony_ci PIPE_LOGICOP_SET, 103bf215546Sopenharmony_ci}; 104bf215546Sopenharmony_ci 105bf215546Sopenharmony_ci#define PIPE_MASK_R 0x1 106bf215546Sopenharmony_ci#define PIPE_MASK_G 0x2 107bf215546Sopenharmony_ci#define PIPE_MASK_B 0x4 108bf215546Sopenharmony_ci#define PIPE_MASK_A 0x8 109bf215546Sopenharmony_ci#define PIPE_MASK_RGBA 0xf 110bf215546Sopenharmony_ci#define PIPE_MASK_Z 0x10 111bf215546Sopenharmony_ci#define PIPE_MASK_S 0x20 112bf215546Sopenharmony_ci#define PIPE_MASK_ZS 0x30 113bf215546Sopenharmony_ci#define PIPE_MASK_RGBAZS (PIPE_MASK_RGBA|PIPE_MASK_ZS) 114bf215546Sopenharmony_ci 115bf215546Sopenharmony_ci 116bf215546Sopenharmony_ci/** 117bf215546Sopenharmony_ci * Inequality functions. Used for depth test, stencil compare, alpha 118bf215546Sopenharmony_ci * test, shadow compare, etc. 119bf215546Sopenharmony_ci */ 120bf215546Sopenharmony_cienum pipe_compare_func { 121bf215546Sopenharmony_ci PIPE_FUNC_NEVER, 122bf215546Sopenharmony_ci PIPE_FUNC_LESS, 123bf215546Sopenharmony_ci PIPE_FUNC_EQUAL, 124bf215546Sopenharmony_ci PIPE_FUNC_LEQUAL, 125bf215546Sopenharmony_ci PIPE_FUNC_GREATER, 126bf215546Sopenharmony_ci PIPE_FUNC_NOTEQUAL, 127bf215546Sopenharmony_ci PIPE_FUNC_GEQUAL, 128bf215546Sopenharmony_ci PIPE_FUNC_ALWAYS, 129bf215546Sopenharmony_ci}; 130bf215546Sopenharmony_ci 131bf215546Sopenharmony_ci/** Polygon fill mode */ 132bf215546Sopenharmony_cienum { 133bf215546Sopenharmony_ci PIPE_POLYGON_MODE_FILL, 134bf215546Sopenharmony_ci PIPE_POLYGON_MODE_LINE, 135bf215546Sopenharmony_ci PIPE_POLYGON_MODE_POINT, 136bf215546Sopenharmony_ci PIPE_POLYGON_MODE_FILL_RECTANGLE, 137bf215546Sopenharmony_ci}; 138bf215546Sopenharmony_ci 139bf215546Sopenharmony_ci/** Polygon face specification, eg for culling */ 140bf215546Sopenharmony_ci#define PIPE_FACE_NONE 0 141bf215546Sopenharmony_ci#define PIPE_FACE_FRONT 1 142bf215546Sopenharmony_ci#define PIPE_FACE_BACK 2 143bf215546Sopenharmony_ci#define PIPE_FACE_FRONT_AND_BACK (PIPE_FACE_FRONT | PIPE_FACE_BACK) 144bf215546Sopenharmony_ci 145bf215546Sopenharmony_ci/** Stencil ops */ 146bf215546Sopenharmony_cienum pipe_stencil_op { 147bf215546Sopenharmony_ci PIPE_STENCIL_OP_KEEP, 148bf215546Sopenharmony_ci PIPE_STENCIL_OP_ZERO, 149bf215546Sopenharmony_ci PIPE_STENCIL_OP_REPLACE, 150bf215546Sopenharmony_ci PIPE_STENCIL_OP_INCR, 151bf215546Sopenharmony_ci PIPE_STENCIL_OP_DECR, 152bf215546Sopenharmony_ci PIPE_STENCIL_OP_INCR_WRAP, 153bf215546Sopenharmony_ci PIPE_STENCIL_OP_DECR_WRAP, 154bf215546Sopenharmony_ci PIPE_STENCIL_OP_INVERT, 155bf215546Sopenharmony_ci}; 156bf215546Sopenharmony_ci 157bf215546Sopenharmony_ci/** Texture types. 158bf215546Sopenharmony_ci * See the documentation for info on PIPE_TEXTURE_RECT vs PIPE_TEXTURE_2D 159bf215546Sopenharmony_ci */ 160bf215546Sopenharmony_cienum pipe_texture_target 161bf215546Sopenharmony_ci{ 162bf215546Sopenharmony_ci PIPE_BUFFER, 163bf215546Sopenharmony_ci PIPE_TEXTURE_1D, 164bf215546Sopenharmony_ci PIPE_TEXTURE_2D, 165bf215546Sopenharmony_ci PIPE_TEXTURE_3D, 166bf215546Sopenharmony_ci PIPE_TEXTURE_CUBE, 167bf215546Sopenharmony_ci PIPE_TEXTURE_RECT, 168bf215546Sopenharmony_ci PIPE_TEXTURE_1D_ARRAY, 169bf215546Sopenharmony_ci PIPE_TEXTURE_2D_ARRAY, 170bf215546Sopenharmony_ci PIPE_TEXTURE_CUBE_ARRAY, 171bf215546Sopenharmony_ci PIPE_MAX_TEXTURE_TYPES, 172bf215546Sopenharmony_ci}; 173bf215546Sopenharmony_ci 174bf215546Sopenharmony_cienum pipe_tex_face { 175bf215546Sopenharmony_ci PIPE_TEX_FACE_POS_X, 176bf215546Sopenharmony_ci PIPE_TEX_FACE_NEG_X, 177bf215546Sopenharmony_ci PIPE_TEX_FACE_POS_Y, 178bf215546Sopenharmony_ci PIPE_TEX_FACE_NEG_Y, 179bf215546Sopenharmony_ci PIPE_TEX_FACE_POS_Z, 180bf215546Sopenharmony_ci PIPE_TEX_FACE_NEG_Z, 181bf215546Sopenharmony_ci PIPE_TEX_FACE_MAX, 182bf215546Sopenharmony_ci}; 183bf215546Sopenharmony_ci 184bf215546Sopenharmony_cienum pipe_tex_wrap { 185bf215546Sopenharmony_ci PIPE_TEX_WRAP_REPEAT, 186bf215546Sopenharmony_ci PIPE_TEX_WRAP_CLAMP, 187bf215546Sopenharmony_ci PIPE_TEX_WRAP_CLAMP_TO_EDGE, 188bf215546Sopenharmony_ci PIPE_TEX_WRAP_CLAMP_TO_BORDER, 189bf215546Sopenharmony_ci PIPE_TEX_WRAP_MIRROR_REPEAT, 190bf215546Sopenharmony_ci PIPE_TEX_WRAP_MIRROR_CLAMP, 191bf215546Sopenharmony_ci PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE, 192bf215546Sopenharmony_ci PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER, 193bf215546Sopenharmony_ci}; 194bf215546Sopenharmony_ci 195bf215546Sopenharmony_ci/** Between mipmaps, ie mipfilter */ 196bf215546Sopenharmony_cienum pipe_tex_mipfilter { 197bf215546Sopenharmony_ci PIPE_TEX_MIPFILTER_NEAREST, 198bf215546Sopenharmony_ci PIPE_TEX_MIPFILTER_LINEAR, 199bf215546Sopenharmony_ci PIPE_TEX_MIPFILTER_NONE, 200bf215546Sopenharmony_ci}; 201bf215546Sopenharmony_ci 202bf215546Sopenharmony_ci/** Within a mipmap, ie min/mag filter */ 203bf215546Sopenharmony_cienum pipe_tex_filter { 204bf215546Sopenharmony_ci PIPE_TEX_FILTER_NEAREST, 205bf215546Sopenharmony_ci PIPE_TEX_FILTER_LINEAR, 206bf215546Sopenharmony_ci}; 207bf215546Sopenharmony_ci 208bf215546Sopenharmony_cienum pipe_tex_compare { 209bf215546Sopenharmony_ci PIPE_TEX_COMPARE_NONE, 210bf215546Sopenharmony_ci PIPE_TEX_COMPARE_R_TO_TEXTURE, 211bf215546Sopenharmony_ci}; 212bf215546Sopenharmony_ci 213bf215546Sopenharmony_cienum pipe_tex_reduction_mode { 214bf215546Sopenharmony_ci PIPE_TEX_REDUCTION_WEIGHTED_AVERAGE, 215bf215546Sopenharmony_ci PIPE_TEX_REDUCTION_MIN, 216bf215546Sopenharmony_ci PIPE_TEX_REDUCTION_MAX, 217bf215546Sopenharmony_ci}; 218bf215546Sopenharmony_ci 219bf215546Sopenharmony_ci/** 220bf215546Sopenharmony_ci * Clear buffer bits 221bf215546Sopenharmony_ci */ 222bf215546Sopenharmony_ci#define PIPE_CLEAR_DEPTH (1 << 0) 223bf215546Sopenharmony_ci#define PIPE_CLEAR_STENCIL (1 << 1) 224bf215546Sopenharmony_ci#define PIPE_CLEAR_COLOR0 (1 << 2) 225bf215546Sopenharmony_ci#define PIPE_CLEAR_COLOR1 (1 << 3) 226bf215546Sopenharmony_ci#define PIPE_CLEAR_COLOR2 (1 << 4) 227bf215546Sopenharmony_ci#define PIPE_CLEAR_COLOR3 (1 << 5) 228bf215546Sopenharmony_ci#define PIPE_CLEAR_COLOR4 (1 << 6) 229bf215546Sopenharmony_ci#define PIPE_CLEAR_COLOR5 (1 << 7) 230bf215546Sopenharmony_ci#define PIPE_CLEAR_COLOR6 (1 << 8) 231bf215546Sopenharmony_ci#define PIPE_CLEAR_COLOR7 (1 << 9) 232bf215546Sopenharmony_ci/** Combined flags */ 233bf215546Sopenharmony_ci/** All color buffers currently bound */ 234bf215546Sopenharmony_ci#define PIPE_CLEAR_COLOR (PIPE_CLEAR_COLOR0 | PIPE_CLEAR_COLOR1 | \ 235bf215546Sopenharmony_ci PIPE_CLEAR_COLOR2 | PIPE_CLEAR_COLOR3 | \ 236bf215546Sopenharmony_ci PIPE_CLEAR_COLOR4 | PIPE_CLEAR_COLOR5 | \ 237bf215546Sopenharmony_ci PIPE_CLEAR_COLOR6 | PIPE_CLEAR_COLOR7) 238bf215546Sopenharmony_ci#define PIPE_CLEAR_DEPTHSTENCIL (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL) 239bf215546Sopenharmony_ci 240bf215546Sopenharmony_ci/** 241bf215546Sopenharmony_ci * CPU access map flags 242bf215546Sopenharmony_ci */ 243bf215546Sopenharmony_cienum pipe_map_flags 244bf215546Sopenharmony_ci{ 245bf215546Sopenharmony_ci /** 246bf215546Sopenharmony_ci * Resource contents read back (or accessed directly) at transfer 247bf215546Sopenharmony_ci * create time. 248bf215546Sopenharmony_ci */ 249bf215546Sopenharmony_ci PIPE_MAP_READ = 1 << 0, 250bf215546Sopenharmony_ci 251bf215546Sopenharmony_ci /** 252bf215546Sopenharmony_ci * Resource contents will be written back at buffer/texture_unmap 253bf215546Sopenharmony_ci * time (or modified as a result of being accessed directly). 254bf215546Sopenharmony_ci */ 255bf215546Sopenharmony_ci PIPE_MAP_WRITE = 1 << 1, 256bf215546Sopenharmony_ci 257bf215546Sopenharmony_ci /** 258bf215546Sopenharmony_ci * Read/modify/write 259bf215546Sopenharmony_ci */ 260bf215546Sopenharmony_ci PIPE_MAP_READ_WRITE = PIPE_MAP_READ | PIPE_MAP_WRITE, 261bf215546Sopenharmony_ci 262bf215546Sopenharmony_ci /** 263bf215546Sopenharmony_ci * The transfer should map the texture storage directly. The driver may 264bf215546Sopenharmony_ci * return NULL if that isn't possible, and the gallium frontend needs to cope 265bf215546Sopenharmony_ci * with that and use an alternative path without this flag. 266bf215546Sopenharmony_ci * 267bf215546Sopenharmony_ci * E.g. the gallium frontend could have a simpler path which maps textures and 268bf215546Sopenharmony_ci * does read/modify/write cycles on them directly, and a more complicated 269bf215546Sopenharmony_ci * path which uses minimal read and write transfers. 270bf215546Sopenharmony_ci * 271bf215546Sopenharmony_ci * This flag supresses implicit "DISCARD" for buffer_subdata. 272bf215546Sopenharmony_ci */ 273bf215546Sopenharmony_ci PIPE_MAP_DIRECTLY = 1 << 2, 274bf215546Sopenharmony_ci 275bf215546Sopenharmony_ci /** 276bf215546Sopenharmony_ci * Discards the memory within the mapped region. 277bf215546Sopenharmony_ci * 278bf215546Sopenharmony_ci * It should not be used with PIPE_MAP_READ. 279bf215546Sopenharmony_ci * 280bf215546Sopenharmony_ci * See also: 281bf215546Sopenharmony_ci * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_RANGE_BIT flag. 282bf215546Sopenharmony_ci */ 283bf215546Sopenharmony_ci PIPE_MAP_DISCARD_RANGE = 1 << 3, 284bf215546Sopenharmony_ci 285bf215546Sopenharmony_ci /** 286bf215546Sopenharmony_ci * Fail if the resource cannot be mapped immediately. 287bf215546Sopenharmony_ci * 288bf215546Sopenharmony_ci * See also: 289bf215546Sopenharmony_ci * - Direct3D's D3DLOCK_DONOTWAIT flag. 290bf215546Sopenharmony_ci * - Mesa's MESA_MAP_NOWAIT_BIT flag. 291bf215546Sopenharmony_ci * - WDDM's D3DDDICB_LOCKFLAGS.DonotWait flag. 292bf215546Sopenharmony_ci */ 293bf215546Sopenharmony_ci PIPE_MAP_DONTBLOCK = 1 << 4, 294bf215546Sopenharmony_ci 295bf215546Sopenharmony_ci /** 296bf215546Sopenharmony_ci * Do not attempt to synchronize pending operations on the resource when mapping. 297bf215546Sopenharmony_ci * 298bf215546Sopenharmony_ci * It should not be used with PIPE_MAP_READ. 299bf215546Sopenharmony_ci * 300bf215546Sopenharmony_ci * See also: 301bf215546Sopenharmony_ci * - OpenGL's ARB_map_buffer_range extension, MAP_UNSYNCHRONIZED_BIT flag. 302bf215546Sopenharmony_ci * - Direct3D's D3DLOCK_NOOVERWRITE flag. 303bf215546Sopenharmony_ci * - WDDM's D3DDDICB_LOCKFLAGS.IgnoreSync flag. 304bf215546Sopenharmony_ci */ 305bf215546Sopenharmony_ci PIPE_MAP_UNSYNCHRONIZED = 1 << 5, 306bf215546Sopenharmony_ci 307bf215546Sopenharmony_ci /** 308bf215546Sopenharmony_ci * Written ranges will be notified later with 309bf215546Sopenharmony_ci * pipe_context::transfer_flush_region. 310bf215546Sopenharmony_ci * 311bf215546Sopenharmony_ci * It should not be used with PIPE_MAP_READ. 312bf215546Sopenharmony_ci * 313bf215546Sopenharmony_ci * See also: 314bf215546Sopenharmony_ci * - pipe_context::transfer_flush_region 315bf215546Sopenharmony_ci * - OpenGL's ARB_map_buffer_range extension, MAP_FLUSH_EXPLICIT_BIT flag. 316bf215546Sopenharmony_ci */ 317bf215546Sopenharmony_ci PIPE_MAP_FLUSH_EXPLICIT = 1 << 6, 318bf215546Sopenharmony_ci 319bf215546Sopenharmony_ci /** 320bf215546Sopenharmony_ci * Discards all memory backing the resource. 321bf215546Sopenharmony_ci * 322bf215546Sopenharmony_ci * It should not be used with PIPE_MAP_READ. 323bf215546Sopenharmony_ci * 324bf215546Sopenharmony_ci * This is equivalent to: 325bf215546Sopenharmony_ci * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_BUFFER_BIT 326bf215546Sopenharmony_ci * - BufferData(NULL) on a GL buffer 327bf215546Sopenharmony_ci * - Direct3D's D3DLOCK_DISCARD flag. 328bf215546Sopenharmony_ci * - WDDM's D3DDDICB_LOCKFLAGS.Discard flag. 329bf215546Sopenharmony_ci * - D3D10 DDI's D3D10_DDI_MAP_WRITE_DISCARD flag 330bf215546Sopenharmony_ci * - D3D10's D3D10_MAP_WRITE_DISCARD flag. 331bf215546Sopenharmony_ci */ 332bf215546Sopenharmony_ci PIPE_MAP_DISCARD_WHOLE_RESOURCE = 1 << 7, 333bf215546Sopenharmony_ci 334bf215546Sopenharmony_ci /** 335bf215546Sopenharmony_ci * Allows the resource to be used for rendering while mapped. 336bf215546Sopenharmony_ci * 337bf215546Sopenharmony_ci * PIPE_RESOURCE_FLAG_MAP_PERSISTENT must be set when creating 338bf215546Sopenharmony_ci * the resource. 339bf215546Sopenharmony_ci * 340bf215546Sopenharmony_ci * If COHERENT is not set, memory_barrier(PIPE_BARRIER_MAPPED_BUFFER) 341bf215546Sopenharmony_ci * must be called to ensure the device can see what the CPU has written. 342bf215546Sopenharmony_ci */ 343bf215546Sopenharmony_ci PIPE_MAP_PERSISTENT = 1 << 8, 344bf215546Sopenharmony_ci 345bf215546Sopenharmony_ci /** 346bf215546Sopenharmony_ci * If PERSISTENT is set, this ensures any writes done by the device are 347bf215546Sopenharmony_ci * immediately visible to the CPU and vice versa. 348bf215546Sopenharmony_ci * 349bf215546Sopenharmony_ci * PIPE_RESOURCE_FLAG_MAP_COHERENT must be set when creating 350bf215546Sopenharmony_ci * the resource. 351bf215546Sopenharmony_ci */ 352bf215546Sopenharmony_ci PIPE_MAP_COHERENT = 1 << 9, 353bf215546Sopenharmony_ci 354bf215546Sopenharmony_ci /** 355bf215546Sopenharmony_ci * Map a resource in a thread-safe manner, because the calling thread can 356bf215546Sopenharmony_ci * be any thread. It can only be used if both WRITE and UNSYNCHRONIZED are 357bf215546Sopenharmony_ci * set. 358bf215546Sopenharmony_ci */ 359bf215546Sopenharmony_ci PIPE_MAP_THREAD_SAFE = 1 << 10, 360bf215546Sopenharmony_ci 361bf215546Sopenharmony_ci /** 362bf215546Sopenharmony_ci * Map only the depth aspect of a resource 363bf215546Sopenharmony_ci */ 364bf215546Sopenharmony_ci PIPE_MAP_DEPTH_ONLY = 1 << 11, 365bf215546Sopenharmony_ci 366bf215546Sopenharmony_ci /** 367bf215546Sopenharmony_ci * Map only the stencil aspect of a resource 368bf215546Sopenharmony_ci */ 369bf215546Sopenharmony_ci PIPE_MAP_STENCIL_ONLY = 1 << 12, 370bf215546Sopenharmony_ci 371bf215546Sopenharmony_ci /** 372bf215546Sopenharmony_ci * Mapping will be used only once (never remapped). 373bf215546Sopenharmony_ci */ 374bf215546Sopenharmony_ci PIPE_MAP_ONCE = 1 << 13, 375bf215546Sopenharmony_ci 376bf215546Sopenharmony_ci /** 377bf215546Sopenharmony_ci * This and higher bits are reserved for private use by drivers. Drivers 378bf215546Sopenharmony_ci * should use this as (PIPE_MAP_DRV_PRV << i). 379bf215546Sopenharmony_ci */ 380bf215546Sopenharmony_ci PIPE_MAP_DRV_PRV = 1 << 14, 381bf215546Sopenharmony_ci}; 382bf215546Sopenharmony_ci 383bf215546Sopenharmony_ci/** 384bf215546Sopenharmony_ci * Flags for the flush function. 385bf215546Sopenharmony_ci */ 386bf215546Sopenharmony_cienum pipe_flush_flags 387bf215546Sopenharmony_ci{ 388bf215546Sopenharmony_ci PIPE_FLUSH_END_OF_FRAME = (1 << 0), 389bf215546Sopenharmony_ci PIPE_FLUSH_DEFERRED = (1 << 1), 390bf215546Sopenharmony_ci PIPE_FLUSH_FENCE_FD = (1 << 2), 391bf215546Sopenharmony_ci PIPE_FLUSH_ASYNC = (1 << 3), 392bf215546Sopenharmony_ci PIPE_FLUSH_HINT_FINISH = (1 << 4), 393bf215546Sopenharmony_ci PIPE_FLUSH_TOP_OF_PIPE = (1 << 5), 394bf215546Sopenharmony_ci PIPE_FLUSH_BOTTOM_OF_PIPE = (1 << 6), 395bf215546Sopenharmony_ci}; 396bf215546Sopenharmony_ci 397bf215546Sopenharmony_ci/** 398bf215546Sopenharmony_ci * Flags for pipe_context::dump_debug_state. 399bf215546Sopenharmony_ci */ 400bf215546Sopenharmony_ci#define PIPE_DUMP_DEVICE_STATUS_REGISTERS (1 << 0) 401bf215546Sopenharmony_ci 402bf215546Sopenharmony_ci/** 403bf215546Sopenharmony_ci * Create a compute-only context. Use in pipe_screen::context_create. 404bf215546Sopenharmony_ci * This disables draw, blit, and clear*, render_condition, and other graphics 405bf215546Sopenharmony_ci * functions. Interop with other graphics contexts is still allowed. 406bf215546Sopenharmony_ci * This allows scheduling jobs on a compute-only hardware command queue that 407bf215546Sopenharmony_ci * can run in parallel with graphics without stalling it. 408bf215546Sopenharmony_ci */ 409bf215546Sopenharmony_ci#define PIPE_CONTEXT_COMPUTE_ONLY (1 << 0) 410bf215546Sopenharmony_ci 411bf215546Sopenharmony_ci/** 412bf215546Sopenharmony_ci * Gather debug information and expect that pipe_context::dump_debug_state 413bf215546Sopenharmony_ci * will be called. Use in pipe_screen::context_create. 414bf215546Sopenharmony_ci */ 415bf215546Sopenharmony_ci#define PIPE_CONTEXT_DEBUG (1 << 1) 416bf215546Sopenharmony_ci 417bf215546Sopenharmony_ci/** 418bf215546Sopenharmony_ci * Whether out-of-bounds shader loads must return zero and out-of-bounds 419bf215546Sopenharmony_ci * shader stores must be dropped. 420bf215546Sopenharmony_ci */ 421bf215546Sopenharmony_ci#define PIPE_CONTEXT_ROBUST_BUFFER_ACCESS (1 << 2) 422bf215546Sopenharmony_ci 423bf215546Sopenharmony_ci/** 424bf215546Sopenharmony_ci * Prefer threaded pipe_context. It also implies that video codec functions 425bf215546Sopenharmony_ci * will not be used. (they will be either no-ops or NULL when threading is 426bf215546Sopenharmony_ci * enabled) 427bf215546Sopenharmony_ci */ 428bf215546Sopenharmony_ci#define PIPE_CONTEXT_PREFER_THREADED (1 << 3) 429bf215546Sopenharmony_ci 430bf215546Sopenharmony_ci/** 431bf215546Sopenharmony_ci * Create a high priority context. 432bf215546Sopenharmony_ci */ 433bf215546Sopenharmony_ci#define PIPE_CONTEXT_HIGH_PRIORITY (1 << 4) 434bf215546Sopenharmony_ci 435bf215546Sopenharmony_ci/** 436bf215546Sopenharmony_ci * Create a low priority context. 437bf215546Sopenharmony_ci */ 438bf215546Sopenharmony_ci#define PIPE_CONTEXT_LOW_PRIORITY (1 << 5) 439bf215546Sopenharmony_ci 440bf215546Sopenharmony_ci/** Stop execution if the device is reset. */ 441bf215546Sopenharmony_ci#define PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET (1 << 6) 442bf215546Sopenharmony_ci 443bf215546Sopenharmony_ci/** 444bf215546Sopenharmony_ci * Flags for pipe_context::memory_barrier. 445bf215546Sopenharmony_ci */ 446bf215546Sopenharmony_ci#define PIPE_BARRIER_MAPPED_BUFFER (1 << 0) 447bf215546Sopenharmony_ci#define PIPE_BARRIER_SHADER_BUFFER (1 << 1) 448bf215546Sopenharmony_ci#define PIPE_BARRIER_QUERY_BUFFER (1 << 2) 449bf215546Sopenharmony_ci#define PIPE_BARRIER_VERTEX_BUFFER (1 << 3) 450bf215546Sopenharmony_ci#define PIPE_BARRIER_INDEX_BUFFER (1 << 4) 451bf215546Sopenharmony_ci#define PIPE_BARRIER_CONSTANT_BUFFER (1 << 5) 452bf215546Sopenharmony_ci#define PIPE_BARRIER_INDIRECT_BUFFER (1 << 6) 453bf215546Sopenharmony_ci#define PIPE_BARRIER_TEXTURE (1 << 7) 454bf215546Sopenharmony_ci#define PIPE_BARRIER_IMAGE (1 << 8) 455bf215546Sopenharmony_ci#define PIPE_BARRIER_FRAMEBUFFER (1 << 9) 456bf215546Sopenharmony_ci#define PIPE_BARRIER_STREAMOUT_BUFFER (1 << 10) 457bf215546Sopenharmony_ci#define PIPE_BARRIER_GLOBAL_BUFFER (1 << 11) 458bf215546Sopenharmony_ci#define PIPE_BARRIER_UPDATE_BUFFER (1 << 12) 459bf215546Sopenharmony_ci#define PIPE_BARRIER_UPDATE_TEXTURE (1 << 13) 460bf215546Sopenharmony_ci#define PIPE_BARRIER_ALL ((1 << 14) - 1) 461bf215546Sopenharmony_ci 462bf215546Sopenharmony_ci#define PIPE_BARRIER_UPDATE \ 463bf215546Sopenharmony_ci (PIPE_BARRIER_UPDATE_BUFFER | PIPE_BARRIER_UPDATE_TEXTURE) 464bf215546Sopenharmony_ci 465bf215546Sopenharmony_ci/** 466bf215546Sopenharmony_ci * Flags for pipe_context::texture_barrier. 467bf215546Sopenharmony_ci */ 468bf215546Sopenharmony_ci#define PIPE_TEXTURE_BARRIER_SAMPLER (1 << 0) 469bf215546Sopenharmony_ci#define PIPE_TEXTURE_BARRIER_FRAMEBUFFER (1 << 1) 470bf215546Sopenharmony_ci 471bf215546Sopenharmony_ci/** 472bf215546Sopenharmony_ci * Resource binding flags -- gallium frontends must specify in advance all 473bf215546Sopenharmony_ci * the ways a resource might be used. 474bf215546Sopenharmony_ci */ 475bf215546Sopenharmony_ci#define PIPE_BIND_DEPTH_STENCIL (1 << 0) /* create_surface */ 476bf215546Sopenharmony_ci#define PIPE_BIND_RENDER_TARGET (1 << 1) /* create_surface */ 477bf215546Sopenharmony_ci#define PIPE_BIND_BLENDABLE (1 << 2) /* create_surface */ 478bf215546Sopenharmony_ci#define PIPE_BIND_SAMPLER_VIEW (1 << 3) /* create_sampler_view */ 479bf215546Sopenharmony_ci#define PIPE_BIND_VERTEX_BUFFER (1 << 4) /* set_vertex_buffers */ 480bf215546Sopenharmony_ci#define PIPE_BIND_INDEX_BUFFER (1 << 5) /* draw_elements */ 481bf215546Sopenharmony_ci#define PIPE_BIND_CONSTANT_BUFFER (1 << 6) /* set_constant_buffer */ 482bf215546Sopenharmony_ci#define PIPE_BIND_DISPLAY_TARGET (1 << 7) /* flush_front_buffer */ 483bf215546Sopenharmony_ci#define PIPE_BIND_VERTEX_STATE (1 << 8) /* create_vertex_state */ 484bf215546Sopenharmony_ci/* gap */ 485bf215546Sopenharmony_ci#define PIPE_BIND_STREAM_OUTPUT (1 << 10) /* set_stream_output_buffers */ 486bf215546Sopenharmony_ci#define PIPE_BIND_CURSOR (1 << 11) /* mouse cursor */ 487bf215546Sopenharmony_ci#define PIPE_BIND_CUSTOM (1 << 12) /* gallium frontend/winsys usages */ 488bf215546Sopenharmony_ci#define PIPE_BIND_GLOBAL (1 << 13) /* set_global_binding */ 489bf215546Sopenharmony_ci#define PIPE_BIND_SHADER_BUFFER (1 << 14) /* set_shader_buffers */ 490bf215546Sopenharmony_ci#define PIPE_BIND_SHADER_IMAGE (1 << 15) /* set_shader_images */ 491bf215546Sopenharmony_ci#define PIPE_BIND_COMPUTE_RESOURCE (1 << 16) /* set_compute_resources */ 492bf215546Sopenharmony_ci#define PIPE_BIND_COMMAND_ARGS_BUFFER (1 << 17) /* pipe_draw_info.indirect */ 493bf215546Sopenharmony_ci#define PIPE_BIND_QUERY_BUFFER (1 << 18) /* get_query_result_resource */ 494bf215546Sopenharmony_ci 495bf215546Sopenharmony_ci/** 496bf215546Sopenharmony_ci * The first two flags above were previously part of the amorphous 497bf215546Sopenharmony_ci * TEXTURE_USAGE, most of which are now descriptions of the ways a 498bf215546Sopenharmony_ci * particular texture can be bound to the gallium pipeline. The two flags 499bf215546Sopenharmony_ci * below do not fit within that and probably need to be migrated to some 500bf215546Sopenharmony_ci * other place. 501bf215546Sopenharmony_ci * 502bf215546Sopenharmony_ci * Scanout is used to ask for a texture suitable for actual scanout (hence 503bf215546Sopenharmony_ci * the name), which implies extra layout constraints on some hardware. 504bf215546Sopenharmony_ci * It may also have some special meaning regarding mouse cursor images. 505bf215546Sopenharmony_ci * 506bf215546Sopenharmony_ci * The shared flag is quite underspecified, but certainly isn't a 507bf215546Sopenharmony_ci * binding flag - it seems more like a message to the winsys to create 508bf215546Sopenharmony_ci * a shareable allocation. 509bf215546Sopenharmony_ci * 510bf215546Sopenharmony_ci * The third flag has been added to be able to force textures to be created 511bf215546Sopenharmony_ci * in linear mode (no tiling). 512bf215546Sopenharmony_ci */ 513bf215546Sopenharmony_ci#define PIPE_BIND_SCANOUT (1 << 19) /* */ 514bf215546Sopenharmony_ci#define PIPE_BIND_SHARED (1 << 20) /* get_texture_handle ??? */ 515bf215546Sopenharmony_ci#define PIPE_BIND_LINEAR (1 << 21) 516bf215546Sopenharmony_ci#define PIPE_BIND_PROTECTED (1 << 22) /* Resource will be protected/encrypted */ 517bf215546Sopenharmony_ci#define PIPE_BIND_SAMPLER_REDUCTION_MINMAX (1 << 23) /* PIPE_CAP_SAMPLER_REDUCTION_MINMAX */ 518bf215546Sopenharmony_ci/* Resource is the DRI_PRIME blit destination. Only set on on the render GPU. */ 519bf215546Sopenharmony_ci#define PIPE_BIND_PRIME_BLIT_DST (1 << 24) 520bf215546Sopenharmony_ci 521bf215546Sopenharmony_ci 522bf215546Sopenharmony_ci/** 523bf215546Sopenharmony_ci * Flags for the driver about resource behaviour: 524bf215546Sopenharmony_ci */ 525bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_MAP_PERSISTENT (1 << 0) 526bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_MAP_COHERENT (1 << 1) 527bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY (1 << 2) 528bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_SPARSE (1 << 3) 529bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_SINGLE_THREAD_USE (1 << 4) 530bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_ENCRYPTED (1 << 5) 531bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_DONT_OVER_ALLOCATE (1 << 6) 532bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLY (1 << 7) /* for small visible VRAM */ 533bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_UNMAPPABLE (1 << 8) /* implies staging transfers due to VK interop */ 534bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_DRV_PRIV (1 << 9) /* driver/winsys private */ 535bf215546Sopenharmony_ci#define PIPE_RESOURCE_FLAG_FRONTEND_PRIV (1 << 24) /* gallium frontend private */ 536bf215546Sopenharmony_ci 537bf215546Sopenharmony_ci/** 538bf215546Sopenharmony_ci * Hint about the expected lifecycle of a resource. 539bf215546Sopenharmony_ci * Sorted according to GPU vs CPU access. 540bf215546Sopenharmony_ci */ 541bf215546Sopenharmony_cienum pipe_resource_usage { 542bf215546Sopenharmony_ci PIPE_USAGE_DEFAULT, /* fast GPU access */ 543bf215546Sopenharmony_ci PIPE_USAGE_IMMUTABLE, /* fast GPU access, immutable */ 544bf215546Sopenharmony_ci PIPE_USAGE_DYNAMIC, /* uploaded data is used multiple times */ 545bf215546Sopenharmony_ci PIPE_USAGE_STREAM, /* uploaded data is used once */ 546bf215546Sopenharmony_ci PIPE_USAGE_STAGING, /* fast CPU access */ 547bf215546Sopenharmony_ci}; 548bf215546Sopenharmony_ci 549bf215546Sopenharmony_ci/** 550bf215546Sopenharmony_ci * Shaders 551bf215546Sopenharmony_ci */ 552bf215546Sopenharmony_cienum pipe_shader_type { 553bf215546Sopenharmony_ci PIPE_SHADER_VERTEX, 554bf215546Sopenharmony_ci PIPE_SHADER_FRAGMENT, 555bf215546Sopenharmony_ci PIPE_SHADER_GEOMETRY, 556bf215546Sopenharmony_ci PIPE_SHADER_TESS_CTRL, 557bf215546Sopenharmony_ci PIPE_SHADER_TESS_EVAL, 558bf215546Sopenharmony_ci PIPE_SHADER_COMPUTE, 559bf215546Sopenharmony_ci PIPE_SHADER_TYPES, 560bf215546Sopenharmony_ci}; 561bf215546Sopenharmony_ci 562bf215546Sopenharmony_ci/** 563bf215546Sopenharmony_ci * Primitive types: 564bf215546Sopenharmony_ci */ 565bf215546Sopenharmony_cienum pipe_prim_type { 566bf215546Sopenharmony_ci PIPE_PRIM_POINTS, 567bf215546Sopenharmony_ci PIPE_PRIM_LINES, 568bf215546Sopenharmony_ci PIPE_PRIM_LINE_LOOP, 569bf215546Sopenharmony_ci PIPE_PRIM_LINE_STRIP, 570bf215546Sopenharmony_ci PIPE_PRIM_TRIANGLES, 571bf215546Sopenharmony_ci PIPE_PRIM_TRIANGLE_STRIP, 572bf215546Sopenharmony_ci PIPE_PRIM_TRIANGLE_FAN, 573bf215546Sopenharmony_ci PIPE_PRIM_QUADS, 574bf215546Sopenharmony_ci PIPE_PRIM_QUAD_STRIP, 575bf215546Sopenharmony_ci PIPE_PRIM_POLYGON, 576bf215546Sopenharmony_ci PIPE_PRIM_LINES_ADJACENCY, 577bf215546Sopenharmony_ci PIPE_PRIM_LINE_STRIP_ADJACENCY, 578bf215546Sopenharmony_ci PIPE_PRIM_TRIANGLES_ADJACENCY, 579bf215546Sopenharmony_ci PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY, 580bf215546Sopenharmony_ci PIPE_PRIM_PATCHES, 581bf215546Sopenharmony_ci PIPE_PRIM_MAX, 582bf215546Sopenharmony_ci} ENUM_PACKED; 583bf215546Sopenharmony_ci 584bf215546Sopenharmony_ci/** 585bf215546Sopenharmony_ci * Tessellator spacing types 586bf215546Sopenharmony_ci */ 587bf215546Sopenharmony_cienum pipe_tess_spacing { 588bf215546Sopenharmony_ci PIPE_TESS_SPACING_FRACTIONAL_ODD, 589bf215546Sopenharmony_ci PIPE_TESS_SPACING_FRACTIONAL_EVEN, 590bf215546Sopenharmony_ci PIPE_TESS_SPACING_EQUAL, 591bf215546Sopenharmony_ci}; 592bf215546Sopenharmony_ci 593bf215546Sopenharmony_ci/** 594bf215546Sopenharmony_ci * Query object types 595bf215546Sopenharmony_ci */ 596bf215546Sopenharmony_cienum pipe_query_type { 597bf215546Sopenharmony_ci PIPE_QUERY_OCCLUSION_COUNTER, 598bf215546Sopenharmony_ci PIPE_QUERY_OCCLUSION_PREDICATE, 599bf215546Sopenharmony_ci PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE, 600bf215546Sopenharmony_ci PIPE_QUERY_TIMESTAMP, 601bf215546Sopenharmony_ci PIPE_QUERY_TIMESTAMP_DISJOINT, 602bf215546Sopenharmony_ci PIPE_QUERY_TIME_ELAPSED, 603bf215546Sopenharmony_ci PIPE_QUERY_PRIMITIVES_GENERATED, 604bf215546Sopenharmony_ci PIPE_QUERY_PRIMITIVES_EMITTED, 605bf215546Sopenharmony_ci PIPE_QUERY_SO_STATISTICS, 606bf215546Sopenharmony_ci PIPE_QUERY_SO_OVERFLOW_PREDICATE, 607bf215546Sopenharmony_ci PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE, 608bf215546Sopenharmony_ci PIPE_QUERY_GPU_FINISHED, 609bf215546Sopenharmony_ci PIPE_QUERY_PIPELINE_STATISTICS, 610bf215546Sopenharmony_ci PIPE_QUERY_PIPELINE_STATISTICS_SINGLE, 611bf215546Sopenharmony_ci PIPE_QUERY_TYPES, 612bf215546Sopenharmony_ci /* start of driver queries, see pipe_screen::get_driver_query_info */ 613bf215546Sopenharmony_ci PIPE_QUERY_DRIVER_SPECIFIC = 256, 614bf215546Sopenharmony_ci}; 615bf215546Sopenharmony_ci 616bf215546Sopenharmony_ci/** 617bf215546Sopenharmony_ci * Index for PIPE_QUERY_PIPELINE_STATISTICS subqueries. 618bf215546Sopenharmony_ci */ 619bf215546Sopenharmony_cienum pipe_statistics_query_index { 620bf215546Sopenharmony_ci PIPE_STAT_QUERY_IA_VERTICES, 621bf215546Sopenharmony_ci PIPE_STAT_QUERY_IA_PRIMITIVES, 622bf215546Sopenharmony_ci PIPE_STAT_QUERY_VS_INVOCATIONS, 623bf215546Sopenharmony_ci PIPE_STAT_QUERY_GS_INVOCATIONS, 624bf215546Sopenharmony_ci PIPE_STAT_QUERY_GS_PRIMITIVES, 625bf215546Sopenharmony_ci PIPE_STAT_QUERY_C_INVOCATIONS, 626bf215546Sopenharmony_ci PIPE_STAT_QUERY_C_PRIMITIVES, 627bf215546Sopenharmony_ci PIPE_STAT_QUERY_PS_INVOCATIONS, 628bf215546Sopenharmony_ci PIPE_STAT_QUERY_HS_INVOCATIONS, 629bf215546Sopenharmony_ci PIPE_STAT_QUERY_DS_INVOCATIONS, 630bf215546Sopenharmony_ci PIPE_STAT_QUERY_CS_INVOCATIONS, 631bf215546Sopenharmony_ci}; 632bf215546Sopenharmony_ci 633bf215546Sopenharmony_ci/** 634bf215546Sopenharmony_ci * Conditional rendering modes 635bf215546Sopenharmony_ci */ 636bf215546Sopenharmony_cienum pipe_render_cond_flag { 637bf215546Sopenharmony_ci PIPE_RENDER_COND_WAIT, 638bf215546Sopenharmony_ci PIPE_RENDER_COND_NO_WAIT, 639bf215546Sopenharmony_ci PIPE_RENDER_COND_BY_REGION_WAIT, 640bf215546Sopenharmony_ci PIPE_RENDER_COND_BY_REGION_NO_WAIT, 641bf215546Sopenharmony_ci}; 642bf215546Sopenharmony_ci 643bf215546Sopenharmony_ci/** 644bf215546Sopenharmony_ci * Point sprite coord modes 645bf215546Sopenharmony_ci */ 646bf215546Sopenharmony_cienum pipe_sprite_coord_mode { 647bf215546Sopenharmony_ci PIPE_SPRITE_COORD_UPPER_LEFT, 648bf215546Sopenharmony_ci PIPE_SPRITE_COORD_LOWER_LEFT, 649bf215546Sopenharmony_ci}; 650bf215546Sopenharmony_ci 651bf215546Sopenharmony_ci/** 652bf215546Sopenharmony_ci * Texture & format swizzles 653bf215546Sopenharmony_ci */ 654bf215546Sopenharmony_cienum pipe_swizzle { 655bf215546Sopenharmony_ci PIPE_SWIZZLE_X, 656bf215546Sopenharmony_ci PIPE_SWIZZLE_Y, 657bf215546Sopenharmony_ci PIPE_SWIZZLE_Z, 658bf215546Sopenharmony_ci PIPE_SWIZZLE_W, 659bf215546Sopenharmony_ci PIPE_SWIZZLE_0, 660bf215546Sopenharmony_ci PIPE_SWIZZLE_1, 661bf215546Sopenharmony_ci PIPE_SWIZZLE_NONE, 662bf215546Sopenharmony_ci PIPE_SWIZZLE_MAX, /**< Number of enums counter (must be last) */ 663bf215546Sopenharmony_ci}; 664bf215546Sopenharmony_ci 665bf215546Sopenharmony_ci/** 666bf215546Sopenharmony_ci * Viewport swizzles 667bf215546Sopenharmony_ci */ 668bf215546Sopenharmony_cienum pipe_viewport_swizzle { 669bf215546Sopenharmony_ci PIPE_VIEWPORT_SWIZZLE_POSITIVE_X, 670bf215546Sopenharmony_ci PIPE_VIEWPORT_SWIZZLE_NEGATIVE_X, 671bf215546Sopenharmony_ci PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y, 672bf215546Sopenharmony_ci PIPE_VIEWPORT_SWIZZLE_NEGATIVE_Y, 673bf215546Sopenharmony_ci PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z, 674bf215546Sopenharmony_ci PIPE_VIEWPORT_SWIZZLE_NEGATIVE_Z, 675bf215546Sopenharmony_ci PIPE_VIEWPORT_SWIZZLE_POSITIVE_W, 676bf215546Sopenharmony_ci PIPE_VIEWPORT_SWIZZLE_NEGATIVE_W, 677bf215546Sopenharmony_ci}; 678bf215546Sopenharmony_ci 679bf215546Sopenharmony_ci#define PIPE_TIMEOUT_INFINITE 0xffffffffffffffffull 680bf215546Sopenharmony_ci 681bf215546Sopenharmony_ci 682bf215546Sopenharmony_ci/** 683bf215546Sopenharmony_ci * Device reset status. 684bf215546Sopenharmony_ci */ 685bf215546Sopenharmony_cienum pipe_reset_status 686bf215546Sopenharmony_ci{ 687bf215546Sopenharmony_ci PIPE_NO_RESET, 688bf215546Sopenharmony_ci PIPE_GUILTY_CONTEXT_RESET, 689bf215546Sopenharmony_ci PIPE_INNOCENT_CONTEXT_RESET, 690bf215546Sopenharmony_ci PIPE_UNKNOWN_CONTEXT_RESET, 691bf215546Sopenharmony_ci}; 692bf215546Sopenharmony_ci 693bf215546Sopenharmony_ci 694bf215546Sopenharmony_ci/** 695bf215546Sopenharmony_ci * Conservative rasterization modes. 696bf215546Sopenharmony_ci */ 697bf215546Sopenharmony_cienum pipe_conservative_raster_mode 698bf215546Sopenharmony_ci{ 699bf215546Sopenharmony_ci PIPE_CONSERVATIVE_RASTER_OFF, 700bf215546Sopenharmony_ci 701bf215546Sopenharmony_ci /** 702bf215546Sopenharmony_ci * The post-snap mode means the conservative rasterization occurs after 703bf215546Sopenharmony_ci * the conversion from floating-point to fixed-point coordinates 704bf215546Sopenharmony_ci * on the subpixel grid. 705bf215546Sopenharmony_ci */ 706bf215546Sopenharmony_ci PIPE_CONSERVATIVE_RASTER_POST_SNAP, 707bf215546Sopenharmony_ci 708bf215546Sopenharmony_ci /** 709bf215546Sopenharmony_ci * The pre-snap mode means the conservative rasterization occurs before 710bf215546Sopenharmony_ci * the conversion from floating-point to fixed-point coordinates. 711bf215546Sopenharmony_ci */ 712bf215546Sopenharmony_ci PIPE_CONSERVATIVE_RASTER_PRE_SNAP, 713bf215546Sopenharmony_ci}; 714bf215546Sopenharmony_ci 715bf215546Sopenharmony_ci 716bf215546Sopenharmony_ci/** 717bf215546Sopenharmony_ci * resource_get_handle flags. 718bf215546Sopenharmony_ci */ 719bf215546Sopenharmony_ci/* Requires pipe_context::flush_resource before external use. */ 720bf215546Sopenharmony_ci#define PIPE_HANDLE_USAGE_EXPLICIT_FLUSH (1 << 0) 721bf215546Sopenharmony_ci/* Expected external use of the resource: */ 722bf215546Sopenharmony_ci#define PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE (1 << 1) 723bf215546Sopenharmony_ci#define PIPE_HANDLE_USAGE_SHADER_WRITE (1 << 2) 724bf215546Sopenharmony_ci 725bf215546Sopenharmony_ci/** 726bf215546Sopenharmony_ci * pipe_image_view access flags. 727bf215546Sopenharmony_ci */ 728bf215546Sopenharmony_ci#define PIPE_IMAGE_ACCESS_READ (1 << 0) 729bf215546Sopenharmony_ci#define PIPE_IMAGE_ACCESS_WRITE (1 << 1) 730bf215546Sopenharmony_ci#define PIPE_IMAGE_ACCESS_READ_WRITE (PIPE_IMAGE_ACCESS_READ | \ 731bf215546Sopenharmony_ci PIPE_IMAGE_ACCESS_WRITE) 732bf215546Sopenharmony_ci 733bf215546Sopenharmony_ci/** 734bf215546Sopenharmony_ci * Implementation capabilities/limits which are queried through 735bf215546Sopenharmony_ci * pipe_screen::get_param() 736bf215546Sopenharmony_ci */ 737bf215546Sopenharmony_cienum pipe_cap 738bf215546Sopenharmony_ci{ 739bf215546Sopenharmony_ci PIPE_CAP_GRAPHICS, 740bf215546Sopenharmony_ci PIPE_CAP_NPOT_TEXTURES, 741bf215546Sopenharmony_ci PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS, 742bf215546Sopenharmony_ci PIPE_CAP_ANISOTROPIC_FILTER, 743bf215546Sopenharmony_ci PIPE_CAP_POINT_SPRITE, 744bf215546Sopenharmony_ci PIPE_CAP_MAX_RENDER_TARGETS, 745bf215546Sopenharmony_ci PIPE_CAP_OCCLUSION_QUERY, 746bf215546Sopenharmony_ci PIPE_CAP_QUERY_TIME_ELAPSED, 747bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_SHADOW_MAP, 748bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_SWIZZLE, 749bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXTURE_2D_SIZE, 750bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXTURE_3D_LEVELS, 751bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS, 752bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_MIRROR_CLAMP, 753bf215546Sopenharmony_ci PIPE_CAP_BLEND_EQUATION_SEPARATE, 754bf215546Sopenharmony_ci PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS, 755bf215546Sopenharmony_ci PIPE_CAP_PRIMITIVE_RESTART, 756bf215546Sopenharmony_ci /** subset of PRIMITIVE_RESTART where the restart index is always the fixed 757bf215546Sopenharmony_ci * maximum value for the index type 758bf215546Sopenharmony_ci */ 759bf215546Sopenharmony_ci PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX, 760bf215546Sopenharmony_ci /** blend enables and write masks per rendertarget */ 761bf215546Sopenharmony_ci PIPE_CAP_INDEP_BLEND_ENABLE, 762bf215546Sopenharmony_ci /** different blend funcs per rendertarget */ 763bf215546Sopenharmony_ci PIPE_CAP_INDEP_BLEND_FUNC, 764bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS, 765bf215546Sopenharmony_ci PIPE_CAP_FS_COORD_ORIGIN_UPPER_LEFT, 766bf215546Sopenharmony_ci PIPE_CAP_FS_COORD_ORIGIN_LOWER_LEFT, 767bf215546Sopenharmony_ci PIPE_CAP_FS_COORD_PIXEL_CENTER_HALF_INTEGER, 768bf215546Sopenharmony_ci PIPE_CAP_FS_COORD_PIXEL_CENTER_INTEGER, 769bf215546Sopenharmony_ci PIPE_CAP_POINT_COORD_ORIGIN_UPPER_LEFT, 770bf215546Sopenharmony_ci PIPE_CAP_DEPTH_CLIP_DISABLE, 771bf215546Sopenharmony_ci PIPE_CAP_DEPTH_CLIP_DISABLE_SEPARATE, 772bf215546Sopenharmony_ci PIPE_CAP_DEPTH_CLAMP_ENABLE, 773bf215546Sopenharmony_ci PIPE_CAP_SHADER_STENCIL_EXPORT, 774bf215546Sopenharmony_ci PIPE_CAP_VS_INSTANCEID, 775bf215546Sopenharmony_ci PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR, 776bf215546Sopenharmony_ci PIPE_CAP_FRAGMENT_COLOR_CLAMPED, 777bf215546Sopenharmony_ci PIPE_CAP_MIXED_COLORBUFFER_FORMATS, 778bf215546Sopenharmony_ci PIPE_CAP_SEAMLESS_CUBE_MAP, 779bf215546Sopenharmony_ci PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE, 780bf215546Sopenharmony_ci PIPE_CAP_MIN_TEXEL_OFFSET, 781bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXEL_OFFSET, 782bf215546Sopenharmony_ci PIPE_CAP_CONDITIONAL_RENDER, 783bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_BARRIER, 784bf215546Sopenharmony_ci PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS, 785bf215546Sopenharmony_ci PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS, 786bf215546Sopenharmony_ci PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME, 787bf215546Sopenharmony_ci PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS, 788bf215546Sopenharmony_ci PIPE_CAP_VERTEX_COLOR_UNCLAMPED, 789bf215546Sopenharmony_ci PIPE_CAP_VERTEX_COLOR_CLAMPED, 790bf215546Sopenharmony_ci PIPE_CAP_GLSL_FEATURE_LEVEL, 791bf215546Sopenharmony_ci PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY, 792bf215546Sopenharmony_ci PIPE_CAP_ESSL_FEATURE_LEVEL, 793bf215546Sopenharmony_ci PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION, 794bf215546Sopenharmony_ci PIPE_CAP_USER_VERTEX_BUFFERS, 795bf215546Sopenharmony_ci PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY, 796bf215546Sopenharmony_ci PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY, 797bf215546Sopenharmony_ci PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY, 798bf215546Sopenharmony_ci PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY, 799bf215546Sopenharmony_ci PIPE_CAP_COMPUTE, 800bf215546Sopenharmony_ci PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT, 801bf215546Sopenharmony_ci PIPE_CAP_START_INSTANCE, 802bf215546Sopenharmony_ci PIPE_CAP_QUERY_TIMESTAMP, 803bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_MULTISAMPLE, 804bf215546Sopenharmony_ci PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT, 805bf215546Sopenharmony_ci PIPE_CAP_CUBE_MAP_ARRAY, 806bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_BUFFER_OBJECTS, 807bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT, 808bf215546Sopenharmony_ci PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY, 809bf215546Sopenharmony_ci PIPE_CAP_TGSI_TEXCOORD, 810bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_BUFFER_SAMPLER, 811bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_TRANSFER_MODES, 812bf215546Sopenharmony_ci PIPE_CAP_QUERY_PIPELINE_STATISTICS, 813bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK, 814bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXEL_BUFFER_ELEMENTS_UINT, 815bf215546Sopenharmony_ci PIPE_CAP_MAX_VIEWPORTS, 816bf215546Sopenharmony_ci PIPE_CAP_ENDIANNESS, 817bf215546Sopenharmony_ci PIPE_CAP_MIXED_FRAMEBUFFER_SIZES, 818bf215546Sopenharmony_ci PIPE_CAP_VS_LAYER_VIEWPORT, 819bf215546Sopenharmony_ci PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES, 820bf215546Sopenharmony_ci PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, 821bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS, 822bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_GATHER_SM5, 823bf215546Sopenharmony_ci PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT, 824bf215546Sopenharmony_ci PIPE_CAP_FAKE_SW_MSAA, 825bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_QUERY_LOD, 826bf215546Sopenharmony_ci PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET, 827bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET, 828bf215546Sopenharmony_ci PIPE_CAP_SAMPLE_SHADING, 829bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_GATHER_OFFSETS, 830bf215546Sopenharmony_ci PIPE_CAP_VS_WINDOW_SPACE_POSITION, 831bf215546Sopenharmony_ci PIPE_CAP_MAX_VERTEX_STREAMS, 832bf215546Sopenharmony_ci PIPE_CAP_DRAW_INDIRECT, 833bf215546Sopenharmony_ci PIPE_CAP_FS_FINE_DERIVATIVE, 834bf215546Sopenharmony_ci PIPE_CAP_VENDOR_ID, 835bf215546Sopenharmony_ci PIPE_CAP_DEVICE_ID, 836bf215546Sopenharmony_ci PIPE_CAP_ACCELERATED, 837bf215546Sopenharmony_ci PIPE_CAP_VIDEO_MEMORY, 838bf215546Sopenharmony_ci PIPE_CAP_UMA, 839bf215546Sopenharmony_ci PIPE_CAP_CONDITIONAL_RENDER_INVERTED, 840bf215546Sopenharmony_ci PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE, 841bf215546Sopenharmony_ci PIPE_CAP_SAMPLER_VIEW_TARGET, 842bf215546Sopenharmony_ci PIPE_CAP_CLIP_HALFZ, 843bf215546Sopenharmony_ci PIPE_CAP_VERTEXID_NOBASE, 844bf215546Sopenharmony_ci PIPE_CAP_POLYGON_OFFSET_CLAMP, 845bf215546Sopenharmony_ci PIPE_CAP_MULTISAMPLE_Z_RESOLVE, 846bf215546Sopenharmony_ci PIPE_CAP_RESOURCE_FROM_USER_MEMORY, 847bf215546Sopenharmony_ci PIPE_CAP_RESOURCE_FROM_USER_MEMORY_COMPUTE_ONLY, 848bf215546Sopenharmony_ci PIPE_CAP_DEVICE_RESET_STATUS_QUERY, 849bf215546Sopenharmony_ci PIPE_CAP_MAX_SHADER_PATCH_VARYINGS, 850bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_FLOAT_LINEAR, 851bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR, 852bf215546Sopenharmony_ci PIPE_CAP_DEPTH_BOUNDS_TEST, 853bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_QUERY_SAMPLES, 854bf215546Sopenharmony_ci PIPE_CAP_FORCE_PERSAMPLE_INTERP, 855bf215546Sopenharmony_ci PIPE_CAP_SHAREABLE_SHADERS, 856bf215546Sopenharmony_ci PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS, 857bf215546Sopenharmony_ci PIPE_CAP_CLEAR_TEXTURE, 858bf215546Sopenharmony_ci PIPE_CAP_CLEAR_SCISSORED, 859bf215546Sopenharmony_ci PIPE_CAP_DRAW_PARAMETERS, 860bf215546Sopenharmony_ci PIPE_CAP_SHADER_PACK_HALF_FLOAT, 861bf215546Sopenharmony_ci PIPE_CAP_MULTI_DRAW_INDIRECT, 862bf215546Sopenharmony_ci PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS, 863bf215546Sopenharmony_ci PIPE_CAP_MULTI_DRAW_INDIRECT_PARTIAL_STRIDE, 864bf215546Sopenharmony_ci PIPE_CAP_FS_POSITION_IS_SYSVAL, 865bf215546Sopenharmony_ci PIPE_CAP_FS_POINT_IS_SYSVAL, 866bf215546Sopenharmony_ci PIPE_CAP_FS_FACE_IS_INTEGER_SYSVAL, 867bf215546Sopenharmony_ci PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT, 868bf215546Sopenharmony_ci PIPE_CAP_INVALIDATE_BUFFER, 869bf215546Sopenharmony_ci PIPE_CAP_GENERATE_MIPMAP, 870bf215546Sopenharmony_ci PIPE_CAP_STRING_MARKER, 871bf215546Sopenharmony_ci PIPE_CAP_SURFACE_REINTERPRET_BLOCKS, 872bf215546Sopenharmony_ci PIPE_CAP_QUERY_BUFFER_OBJECT, 873bf215546Sopenharmony_ci PIPE_CAP_QUERY_MEMORY_INFO, 874bf215546Sopenharmony_ci PIPE_CAP_PCI_GROUP, 875bf215546Sopenharmony_ci PIPE_CAP_PCI_BUS, 876bf215546Sopenharmony_ci PIPE_CAP_PCI_DEVICE, 877bf215546Sopenharmony_ci PIPE_CAP_PCI_FUNCTION, 878bf215546Sopenharmony_ci PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT, 879bf215546Sopenharmony_ci PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR, 880bf215546Sopenharmony_ci PIPE_CAP_CULL_DISTANCE, 881bf215546Sopenharmony_ci PIPE_CAP_CULL_DISTANCE_NOCOMBINE, 882bf215546Sopenharmony_ci PIPE_CAP_SHADER_GROUP_VOTE, 883bf215546Sopenharmony_ci PIPE_CAP_MAX_WINDOW_RECTANGLES, 884bf215546Sopenharmony_ci PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED, 885bf215546Sopenharmony_ci PIPE_CAP_VIEWPORT_SUBPIXEL_BITS, 886bf215546Sopenharmony_ci PIPE_CAP_RASTERIZER_SUBPIXEL_BITS, 887bf215546Sopenharmony_ci PIPE_CAP_MIXED_COLOR_DEPTH_BITS, 888bf215546Sopenharmony_ci PIPE_CAP_SHADER_ARRAY_COMPONENTS, 889bf215546Sopenharmony_ci PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS, 890bf215546Sopenharmony_ci PIPE_CAP_SHADER_CAN_READ_OUTPUTS, 891bf215546Sopenharmony_ci PIPE_CAP_NATIVE_FENCE_FD, 892bf215546Sopenharmony_ci PIPE_CAP_GLSL_TESS_LEVELS_AS_INPUTS, 893bf215546Sopenharmony_ci PIPE_CAP_FBFETCH, 894bf215546Sopenharmony_ci PIPE_CAP_LEGACY_MATH_RULES, 895bf215546Sopenharmony_ci PIPE_CAP_DOUBLES, 896bf215546Sopenharmony_ci PIPE_CAP_INT64, 897bf215546Sopenharmony_ci PIPE_CAP_INT64_DIVMOD, 898bf215546Sopenharmony_ci PIPE_CAP_TGSI_TEX_TXF_LZ, 899bf215546Sopenharmony_ci PIPE_CAP_SHADER_CLOCK, 900bf215546Sopenharmony_ci PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE, 901bf215546Sopenharmony_ci PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE, 902bf215546Sopenharmony_ci PIPE_CAP_SHADER_BALLOT, 903bf215546Sopenharmony_ci PIPE_CAP_TES_LAYER_VIEWPORT, 904bf215546Sopenharmony_ci PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX, 905bf215546Sopenharmony_ci PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION, 906bf215546Sopenharmony_ci PIPE_CAP_POST_DEPTH_COVERAGE, 907bf215546Sopenharmony_ci PIPE_CAP_BINDLESS_TEXTURE, 908bf215546Sopenharmony_ci PIPE_CAP_NIR_SAMPLERS_AS_DEREF, 909bf215546Sopenharmony_ci PIPE_CAP_QUERY_SO_OVERFLOW, 910bf215546Sopenharmony_ci PIPE_CAP_MEMOBJ, 911bf215546Sopenharmony_ci PIPE_CAP_LOAD_CONSTBUF, 912bf215546Sopenharmony_ci PIPE_CAP_TILE_RASTER_ORDER, 913bf215546Sopenharmony_ci PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES, 914bf215546Sopenharmony_ci PIPE_CAP_FRAMEBUFFER_MSAA_CONSTRAINTS, 915bf215546Sopenharmony_ci PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET, 916bf215546Sopenharmony_ci PIPE_CAP_CONTEXT_PRIORITY_MASK, 917bf215546Sopenharmony_ci PIPE_CAP_FENCE_SIGNAL, 918bf215546Sopenharmony_ci PIPE_CAP_CONSTBUF0_FLAGS, 919bf215546Sopenharmony_ci PIPE_CAP_PACKED_UNIFORMS, 920bf215546Sopenharmony_ci PIPE_CAP_CONSERVATIVE_RASTER_POST_SNAP_TRIANGLES, 921bf215546Sopenharmony_ci PIPE_CAP_CONSERVATIVE_RASTER_POST_SNAP_POINTS_LINES, 922bf215546Sopenharmony_ci PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_TRIANGLES, 923bf215546Sopenharmony_ci PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_POINTS_LINES, 924bf215546Sopenharmony_ci PIPE_CAP_MAX_CONSERVATIVE_RASTER_SUBPIXEL_PRECISION_BIAS, 925bf215546Sopenharmony_ci PIPE_CAP_CONSERVATIVE_RASTER_POST_DEPTH_COVERAGE, 926bf215546Sopenharmony_ci PIPE_CAP_CONSERVATIVE_RASTER_INNER_COVERAGE, 927bf215546Sopenharmony_ci PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS, 928bf215546Sopenharmony_ci PIPE_CAP_MAX_GS_INVOCATIONS, 929bf215546Sopenharmony_ci PIPE_CAP_MAX_SHADER_BUFFER_SIZE_UINT, 930bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE, 931bf215546Sopenharmony_ci PIPE_CAP_MAX_COMBINED_SHADER_BUFFERS, 932bf215546Sopenharmony_ci PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS, 933bf215546Sopenharmony_ci PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS, 934bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET, 935bf215546Sopenharmony_ci PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET, 936bf215546Sopenharmony_ci PIPE_CAP_SURFACE_SAMPLE_COUNT, 937bf215546Sopenharmony_ci PIPE_CAP_IMAGE_ATOMIC_FLOAT_ADD, 938bf215546Sopenharmony_ci PIPE_CAP_QUERY_PIPELINE_STATISTICS_SINGLE, 939bf215546Sopenharmony_ci PIPE_CAP_RGB_OVERRIDE_DST_ALPHA_BLEND, 940bf215546Sopenharmony_ci PIPE_CAP_DEST_SURFACE_SRGB_CONTROL, 941bf215546Sopenharmony_ci PIPE_CAP_NIR_COMPACT_ARRAYS, 942bf215546Sopenharmony_ci PIPE_CAP_MAX_VARYINGS, 943bf215546Sopenharmony_ci PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK, 944bf215546Sopenharmony_ci PIPE_CAP_COMPUTE_SHADER_DERIVATIVES, 945bf215546Sopenharmony_ci PIPE_CAP_IMAGE_LOAD_FORMATTED, 946bf215546Sopenharmony_ci PIPE_CAP_IMAGE_STORE_FORMATTED, 947bf215546Sopenharmony_ci PIPE_CAP_THROTTLE, 948bf215546Sopenharmony_ci PIPE_CAP_DMABUF, 949bf215546Sopenharmony_ci PIPE_CAP_PREFER_COMPUTE_FOR_MULTIMEDIA, 950bf215546Sopenharmony_ci PIPE_CAP_FRAGMENT_SHADER_INTERLOCK, 951bf215546Sopenharmony_ci PIPE_CAP_FBFETCH_COHERENT, 952bf215546Sopenharmony_ci PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED, 953bf215546Sopenharmony_ci PIPE_CAP_ATOMIC_FLOAT_MINMAX, 954bf215546Sopenharmony_ci PIPE_CAP_TGSI_DIV, 955bf215546Sopenharmony_ci PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD, 956bf215546Sopenharmony_ci PIPE_CAP_FRAGMENT_SHADER_DERIVATIVES, 957bf215546Sopenharmony_ci PIPE_CAP_TEXTURE_SHADOW_LOD, 958bf215546Sopenharmony_ci PIPE_CAP_SHADER_SAMPLES_IDENTICAL, 959bf215546Sopenharmony_ci PIPE_CAP_IMAGE_ATOMIC_INC_WRAP, 960bf215546Sopenharmony_ci PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF, 961bf215546Sopenharmony_ci PIPE_CAP_GL_SPIRV, 962bf215546Sopenharmony_ci PIPE_CAP_GL_SPIRV_VARIABLE_POINTERS, 963bf215546Sopenharmony_ci PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION, 964bf215546Sopenharmony_ci PIPE_CAP_TGSI_TG4_COMPONENT_IN_SWIZZLE, 965bf215546Sopenharmony_ci PIPE_CAP_FLATSHADE, 966bf215546Sopenharmony_ci PIPE_CAP_ALPHA_TEST, 967bf215546Sopenharmony_ci PIPE_CAP_POINT_SIZE_FIXED, 968bf215546Sopenharmony_ci PIPE_CAP_TWO_SIDED_COLOR, 969bf215546Sopenharmony_ci PIPE_CAP_CLIP_PLANES, 970bf215546Sopenharmony_ci PIPE_CAP_MAX_VERTEX_BUFFERS, 971bf215546Sopenharmony_ci PIPE_CAP_OPENCL_INTEGER_FUNCTIONS, 972bf215546Sopenharmony_ci PIPE_CAP_INTEGER_MULTIPLY_32X16, 973bf215546Sopenharmony_ci /* Turn draw, dispatch, blit into NOOP */ 974bf215546Sopenharmony_ci PIPE_CAP_FRONTEND_NOOP, 975bf215546Sopenharmony_ci PIPE_CAP_NIR_IMAGES_AS_DEREF, 976bf215546Sopenharmony_ci PIPE_CAP_PACKED_STREAM_OUTPUT, 977bf215546Sopenharmony_ci PIPE_CAP_VIEWPORT_TRANSFORM_LOWERED, 978bf215546Sopenharmony_ci PIPE_CAP_PSIZ_CLAMPED, 979bf215546Sopenharmony_ci PIPE_CAP_GL_BEGIN_END_BUFFER_SIZE, 980bf215546Sopenharmony_ci PIPE_CAP_VIEWPORT_SWIZZLE, 981bf215546Sopenharmony_ci PIPE_CAP_SYSTEM_SVM, 982bf215546Sopenharmony_ci PIPE_CAP_VIEWPORT_MASK, 983bf215546Sopenharmony_ci PIPE_CAP_ALPHA_TO_COVERAGE_DITHER_CONTROL, 984bf215546Sopenharmony_ci PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE, 985bf215546Sopenharmony_ci PIPE_CAP_GLSL_ZERO_INIT, 986bf215546Sopenharmony_ci PIPE_CAP_BLEND_EQUATION_ADVANCED, 987bf215546Sopenharmony_ci PIPE_CAP_NIR_ATOMICS_AS_DEREF, 988bf215546Sopenharmony_ci PIPE_CAP_NO_CLIP_ON_COPY_TEX, 989bf215546Sopenharmony_ci PIPE_CAP_MAX_TEXTURE_MB, 990bf215546Sopenharmony_ci PIPE_CAP_SHADER_ATOMIC_INT64, 991bf215546Sopenharmony_ci PIPE_CAP_DEVICE_PROTECTED_CONTENT, 992bf215546Sopenharmony_ci PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0, 993bf215546Sopenharmony_ci PIPE_CAP_GL_CLAMP, 994bf215546Sopenharmony_ci PIPE_CAP_TEXRECT, 995bf215546Sopenharmony_ci PIPE_CAP_SAMPLER_REDUCTION_MINMAX, 996bf215546Sopenharmony_ci PIPE_CAP_SAMPLER_REDUCTION_MINMAX_ARB, 997bf215546Sopenharmony_ci PIPE_CAP_ALLOW_DYNAMIC_VAO_FASTPATH, 998bf215546Sopenharmony_ci PIPE_CAP_EMULATE_NONFIXED_PRIMITIVE_RESTART, 999bf215546Sopenharmony_ci PIPE_CAP_SUPPORTED_PRIM_MODES, 1000bf215546Sopenharmony_ci PIPE_CAP_SUPPORTED_PRIM_MODES_WITH_RESTART, 1001bf215546Sopenharmony_ci PIPE_CAP_PREFER_BACK_BUFFER_REUSE, 1002bf215546Sopenharmony_ci PIPE_CAP_DRAW_VERTEX_STATE, 1003bf215546Sopenharmony_ci PIPE_CAP_PREFER_POT_ALIGNED_VARYINGS, 1004bf215546Sopenharmony_ci PIPE_CAP_MAX_SPARSE_TEXTURE_SIZE, 1005bf215546Sopenharmony_ci PIPE_CAP_MAX_SPARSE_3D_TEXTURE_SIZE, 1006bf215546Sopenharmony_ci PIPE_CAP_MAX_SPARSE_ARRAY_TEXTURE_LAYERS, 1007bf215546Sopenharmony_ci PIPE_CAP_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS, 1008bf215546Sopenharmony_ci PIPE_CAP_QUERY_SPARSE_TEXTURE_RESIDENCY, 1009bf215546Sopenharmony_ci PIPE_CAP_CLAMP_SPARSE_TEXTURE_LOD, 1010bf215546Sopenharmony_ci PIPE_CAP_ALLOW_DRAW_OUT_OF_ORDER, 1011bf215546Sopenharmony_ci PIPE_CAP_MAX_CONSTANT_BUFFER_SIZE_UINT, 1012bf215546Sopenharmony_ci PIPE_CAP_HARDWARE_GL_SELECT, 1013bf215546Sopenharmony_ci PIPE_CAP_DITHERING, 1014bf215546Sopenharmony_ci PIPE_CAP_FBFETCH_ZS, 1015bf215546Sopenharmony_ci PIPE_CAP_TIMELINE_SEMAPHORE_IMPORT, 1016bf215546Sopenharmony_ci 1017bf215546Sopenharmony_ci PIPE_CAP_LAST, 1018bf215546Sopenharmony_ci /* XXX do not add caps after PIPE_CAP_LAST! */ 1019bf215546Sopenharmony_ci}; 1020bf215546Sopenharmony_ci 1021bf215546Sopenharmony_cienum pipe_texture_transfer_mode { 1022bf215546Sopenharmony_ci PIPE_TEXTURE_TRANSFER_DEFAULT = 0, 1023bf215546Sopenharmony_ci PIPE_TEXTURE_TRANSFER_BLIT = (1 << 0), 1024bf215546Sopenharmony_ci PIPE_TEXTURE_TRANSFER_COMPUTE = (1 << 1), 1025bf215546Sopenharmony_ci}; 1026bf215546Sopenharmony_ci 1027bf215546Sopenharmony_ci/** 1028bf215546Sopenharmony_ci * Possible bits for PIPE_CAP_CONTEXT_PRIORITY_MASK param, which should 1029bf215546Sopenharmony_ci * return a bitmask of the supported priorities. If the driver does not 1030bf215546Sopenharmony_ci * support prioritized contexts, it can return 0. 1031bf215546Sopenharmony_ci * 1032bf215546Sopenharmony_ci * Note that these match __DRI2_RENDERER_HAS_CONTEXT_PRIORITY_* 1033bf215546Sopenharmony_ci */ 1034bf215546Sopenharmony_ci#define PIPE_CONTEXT_PRIORITY_LOW (1 << 0) 1035bf215546Sopenharmony_ci#define PIPE_CONTEXT_PRIORITY_MEDIUM (1 << 1) 1036bf215546Sopenharmony_ci#define PIPE_CONTEXT_PRIORITY_HIGH (1 << 2) 1037bf215546Sopenharmony_ci 1038bf215546Sopenharmony_ci#define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0) 1039bf215546Sopenharmony_ci#define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600 (1 << 1) 1040bf215546Sopenharmony_ci#define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_FREEDRENO (1 << 2) 1041bf215546Sopenharmony_ci 1042bf215546Sopenharmony_cienum pipe_endian 1043bf215546Sopenharmony_ci{ 1044bf215546Sopenharmony_ci PIPE_ENDIAN_LITTLE = 0, 1045bf215546Sopenharmony_ci PIPE_ENDIAN_BIG = 1, 1046bf215546Sopenharmony_ci#if UTIL_ARCH_LITTLE_ENDIAN 1047bf215546Sopenharmony_ci PIPE_ENDIAN_NATIVE = PIPE_ENDIAN_LITTLE 1048bf215546Sopenharmony_ci#elif UTIL_ARCH_BIG_ENDIAN 1049bf215546Sopenharmony_ci PIPE_ENDIAN_NATIVE = PIPE_ENDIAN_BIG 1050bf215546Sopenharmony_ci#endif 1051bf215546Sopenharmony_ci}; 1052bf215546Sopenharmony_ci 1053bf215546Sopenharmony_ci/** 1054bf215546Sopenharmony_ci * Implementation limits which are queried through 1055bf215546Sopenharmony_ci * pipe_screen::get_paramf() 1056bf215546Sopenharmony_ci */ 1057bf215546Sopenharmony_cienum pipe_capf 1058bf215546Sopenharmony_ci{ 1059bf215546Sopenharmony_ci PIPE_CAPF_MIN_LINE_WIDTH, 1060bf215546Sopenharmony_ci PIPE_CAPF_MIN_LINE_WIDTH_AA, 1061bf215546Sopenharmony_ci PIPE_CAPF_MAX_LINE_WIDTH, 1062bf215546Sopenharmony_ci PIPE_CAPF_MAX_LINE_WIDTH_AA, 1063bf215546Sopenharmony_ci PIPE_CAPF_LINE_WIDTH_GRANULARITY, 1064bf215546Sopenharmony_ci PIPE_CAPF_MIN_POINT_SIZE, 1065bf215546Sopenharmony_ci PIPE_CAPF_MIN_POINT_SIZE_AA, 1066bf215546Sopenharmony_ci PIPE_CAPF_MAX_POINT_SIZE, 1067bf215546Sopenharmony_ci PIPE_CAPF_MAX_POINT_SIZE_AA, 1068bf215546Sopenharmony_ci PIPE_CAPF_POINT_SIZE_GRANULARITY, 1069bf215546Sopenharmony_ci PIPE_CAPF_MAX_TEXTURE_ANISOTROPY, 1070bf215546Sopenharmony_ci PIPE_CAPF_MAX_TEXTURE_LOD_BIAS, 1071bf215546Sopenharmony_ci PIPE_CAPF_MIN_CONSERVATIVE_RASTER_DILATE, 1072bf215546Sopenharmony_ci PIPE_CAPF_MAX_CONSERVATIVE_RASTER_DILATE, 1073bf215546Sopenharmony_ci PIPE_CAPF_CONSERVATIVE_RASTER_DILATE_GRANULARITY, 1074bf215546Sopenharmony_ci}; 1075bf215546Sopenharmony_ci 1076bf215546Sopenharmony_ci/** Shader caps not specific to any single stage */ 1077bf215546Sopenharmony_cienum pipe_shader_cap 1078bf215546Sopenharmony_ci{ 1079bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_INSTRUCTIONS, /* if 0, it means the stage is unsupported */ 1080bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS, 1081bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS, 1082bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS, 1083bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH, 1084bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_INPUTS, 1085bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_OUTPUTS, 1086bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_CONST_BUFFER0_SIZE, 1087bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_CONST_BUFFERS, 1088bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_TEMPS, 1089bf215546Sopenharmony_ci /* boolean caps */ 1090bf215546Sopenharmony_ci PIPE_SHADER_CAP_CONT_SUPPORTED, 1091bf215546Sopenharmony_ci PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR, 1092bf215546Sopenharmony_ci PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR, 1093bf215546Sopenharmony_ci PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR, 1094bf215546Sopenharmony_ci PIPE_SHADER_CAP_INDIRECT_CONST_ADDR, 1095bf215546Sopenharmony_ci PIPE_SHADER_CAP_SUBROUTINES, /* BGNSUB, ENDSUB, CAL, RET */ 1096bf215546Sopenharmony_ci PIPE_SHADER_CAP_INTEGERS, 1097bf215546Sopenharmony_ci PIPE_SHADER_CAP_INT64_ATOMICS, 1098bf215546Sopenharmony_ci PIPE_SHADER_CAP_FP16, 1099bf215546Sopenharmony_ci PIPE_SHADER_CAP_FP16_DERIVATIVES, 1100bf215546Sopenharmony_ci PIPE_SHADER_CAP_FP16_CONST_BUFFERS, 1101bf215546Sopenharmony_ci PIPE_SHADER_CAP_INT16, 1102bf215546Sopenharmony_ci PIPE_SHADER_CAP_GLSL_16BIT_CONSTS, 1103bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS, 1104bf215546Sopenharmony_ci PIPE_SHADER_CAP_PREFERRED_IR, 1105bf215546Sopenharmony_ci PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED, 1106bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS, 1107bf215546Sopenharmony_ci PIPE_SHADER_CAP_DROUND_SUPPORTED, /* all rounding modes */ 1108bf215546Sopenharmony_ci PIPE_SHADER_CAP_DFRACEXP_DLDEXP_SUPPORTED, 1109bf215546Sopenharmony_ci PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE, 1110bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_SHADER_BUFFERS, 1111bf215546Sopenharmony_ci PIPE_SHADER_CAP_SUPPORTED_IRS, 1112bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_SHADER_IMAGES, 1113bf215546Sopenharmony_ci PIPE_SHADER_CAP_LDEXP_SUPPORTED, 1114bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS, 1115bf215546Sopenharmony_ci PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS, 1116bf215546Sopenharmony_ci}; 1117bf215546Sopenharmony_ci 1118bf215546Sopenharmony_ci/** 1119bf215546Sopenharmony_ci * Shader intermediate representation. 1120bf215546Sopenharmony_ci * 1121bf215546Sopenharmony_ci * Note that if the driver requests something other than TGSI, it must 1122bf215546Sopenharmony_ci * always be prepared to receive TGSI in addition to its preferred IR. 1123bf215546Sopenharmony_ci * If the driver requests TGSI as its preferred IR, it will *always* 1124bf215546Sopenharmony_ci * get TGSI. 1125bf215546Sopenharmony_ci * 1126bf215546Sopenharmony_ci * Note that PIPE_SHADER_IR_TGSI should be zero for backwards compat with 1127bf215546Sopenharmony_ci * gallium frontends that only understand TGSI. 1128bf215546Sopenharmony_ci */ 1129bf215546Sopenharmony_cienum pipe_shader_ir 1130bf215546Sopenharmony_ci{ 1131bf215546Sopenharmony_ci PIPE_SHADER_IR_TGSI = 0, 1132bf215546Sopenharmony_ci PIPE_SHADER_IR_NATIVE, 1133bf215546Sopenharmony_ci PIPE_SHADER_IR_NIR, 1134bf215546Sopenharmony_ci PIPE_SHADER_IR_NIR_SERIALIZED, 1135bf215546Sopenharmony_ci}; 1136bf215546Sopenharmony_ci 1137bf215546Sopenharmony_ci/** 1138bf215546Sopenharmony_ci * Compute-specific implementation capability. They can be queried 1139bf215546Sopenharmony_ci * using pipe_screen::get_compute_param. 1140bf215546Sopenharmony_ci */ 1141bf215546Sopenharmony_cienum pipe_compute_cap 1142bf215546Sopenharmony_ci{ 1143bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_ADDRESS_BITS, 1144bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_IR_TARGET, 1145bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_GRID_DIMENSION, 1146bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_GRID_SIZE, 1147bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE, 1148bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK, 1149bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE, 1150bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE, 1151bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_PRIVATE_SIZE, 1152bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_INPUT_SIZE, 1153bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE, 1154bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY, 1155bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS, 1156bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_IMAGES_SUPPORTED, 1157bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_SUBGROUP_SIZE, 1158bf215546Sopenharmony_ci PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK, 1159bf215546Sopenharmony_ci}; 1160bf215546Sopenharmony_ci 1161bf215546Sopenharmony_ci/** 1162bf215546Sopenharmony_ci * Resource parameters. They can be queried using 1163bf215546Sopenharmony_ci * pipe_screen::get_resource_param. 1164bf215546Sopenharmony_ci */ 1165bf215546Sopenharmony_cienum pipe_resource_param 1166bf215546Sopenharmony_ci{ 1167bf215546Sopenharmony_ci PIPE_RESOURCE_PARAM_NPLANES, 1168bf215546Sopenharmony_ci PIPE_RESOURCE_PARAM_STRIDE, 1169bf215546Sopenharmony_ci PIPE_RESOURCE_PARAM_OFFSET, 1170bf215546Sopenharmony_ci PIPE_RESOURCE_PARAM_MODIFIER, 1171bf215546Sopenharmony_ci PIPE_RESOURCE_PARAM_HANDLE_TYPE_SHARED, 1172bf215546Sopenharmony_ci PIPE_RESOURCE_PARAM_HANDLE_TYPE_KMS, 1173bf215546Sopenharmony_ci PIPE_RESOURCE_PARAM_HANDLE_TYPE_FD, 1174bf215546Sopenharmony_ci PIPE_RESOURCE_PARAM_LAYER_STRIDE, 1175bf215546Sopenharmony_ci}; 1176bf215546Sopenharmony_ci 1177bf215546Sopenharmony_ci/** 1178bf215546Sopenharmony_ci * Types of parameters for pipe_context::set_context_param. 1179bf215546Sopenharmony_ci */ 1180bf215546Sopenharmony_cienum pipe_context_param 1181bf215546Sopenharmony_ci{ 1182bf215546Sopenharmony_ci /* A hint for the driver that it should pin its execution threads to 1183bf215546Sopenharmony_ci * a group of cores sharing a specific L3 cache if the CPU has multiple 1184bf215546Sopenharmony_ci * L3 caches. This is needed for good multithreading performance on 1185bf215546Sopenharmony_ci * AMD Zen CPUs. "value" is the L3 cache index. Drivers that don't have 1186bf215546Sopenharmony_ci * any internal threads or don't run on affected CPUs can ignore this. 1187bf215546Sopenharmony_ci */ 1188bf215546Sopenharmony_ci PIPE_CONTEXT_PARAM_PIN_THREADS_TO_L3_CACHE, 1189bf215546Sopenharmony_ci}; 1190bf215546Sopenharmony_ci 1191bf215546Sopenharmony_ci/** 1192bf215546Sopenharmony_ci * Composite query types 1193bf215546Sopenharmony_ci */ 1194bf215546Sopenharmony_ci 1195bf215546Sopenharmony_ci/** 1196bf215546Sopenharmony_ci * Query result for PIPE_QUERY_SO_STATISTICS. 1197bf215546Sopenharmony_ci */ 1198bf215546Sopenharmony_cistruct pipe_query_data_so_statistics 1199bf215546Sopenharmony_ci{ 1200bf215546Sopenharmony_ci uint64_t num_primitives_written; 1201bf215546Sopenharmony_ci uint64_t primitives_storage_needed; 1202bf215546Sopenharmony_ci}; 1203bf215546Sopenharmony_ci 1204bf215546Sopenharmony_ci/** 1205bf215546Sopenharmony_ci * Query result for PIPE_QUERY_TIMESTAMP_DISJOINT. 1206bf215546Sopenharmony_ci */ 1207bf215546Sopenharmony_cistruct pipe_query_data_timestamp_disjoint 1208bf215546Sopenharmony_ci{ 1209bf215546Sopenharmony_ci uint64_t frequency; 1210bf215546Sopenharmony_ci bool disjoint; 1211bf215546Sopenharmony_ci}; 1212bf215546Sopenharmony_ci 1213bf215546Sopenharmony_ci/** 1214bf215546Sopenharmony_ci * Query result for PIPE_QUERY_PIPELINE_STATISTICS. 1215bf215546Sopenharmony_ci */ 1216bf215546Sopenharmony_cistruct pipe_query_data_pipeline_statistics 1217bf215546Sopenharmony_ci{ 1218bf215546Sopenharmony_ci union { 1219bf215546Sopenharmony_ci struct { 1220bf215546Sopenharmony_ci uint64_t ia_vertices; /**< Num vertices read by the vertex fetcher. */ 1221bf215546Sopenharmony_ci uint64_t ia_primitives; /**< Num primitives read by the vertex fetcher. */ 1222bf215546Sopenharmony_ci uint64_t vs_invocations; /**< Num vertex shader invocations. */ 1223bf215546Sopenharmony_ci uint64_t gs_invocations; /**< Num geometry shader invocations. */ 1224bf215546Sopenharmony_ci uint64_t gs_primitives; /**< Num primitives output by a geometry shader. */ 1225bf215546Sopenharmony_ci uint64_t c_invocations; /**< Num primitives sent to the rasterizer. */ 1226bf215546Sopenharmony_ci uint64_t c_primitives; /**< Num primitives that were rendered. */ 1227bf215546Sopenharmony_ci uint64_t ps_invocations; /**< Num pixel shader invocations. */ 1228bf215546Sopenharmony_ci uint64_t hs_invocations; /**< Num hull shader invocations. */ 1229bf215546Sopenharmony_ci uint64_t ds_invocations; /**< Num domain shader invocations. */ 1230bf215546Sopenharmony_ci uint64_t cs_invocations; /**< Num compute shader invocations. */ 1231bf215546Sopenharmony_ci }; 1232bf215546Sopenharmony_ci uint64_t counters[11]; 1233bf215546Sopenharmony_ci }; 1234bf215546Sopenharmony_ci}; 1235bf215546Sopenharmony_ci 1236bf215546Sopenharmony_ci/** 1237bf215546Sopenharmony_ci * For batch queries. 1238bf215546Sopenharmony_ci */ 1239bf215546Sopenharmony_ciunion pipe_numeric_type_union 1240bf215546Sopenharmony_ci{ 1241bf215546Sopenharmony_ci uint64_t u64; 1242bf215546Sopenharmony_ci uint32_t u32; 1243bf215546Sopenharmony_ci float f; 1244bf215546Sopenharmony_ci}; 1245bf215546Sopenharmony_ci 1246bf215546Sopenharmony_ci/** 1247bf215546Sopenharmony_ci * Query result (returned by pipe_context::get_query_result). 1248bf215546Sopenharmony_ci */ 1249bf215546Sopenharmony_ciunion pipe_query_result 1250bf215546Sopenharmony_ci{ 1251bf215546Sopenharmony_ci /* PIPE_QUERY_OCCLUSION_PREDICATE */ 1252bf215546Sopenharmony_ci /* PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE */ 1253bf215546Sopenharmony_ci /* PIPE_QUERY_SO_OVERFLOW_PREDICATE */ 1254bf215546Sopenharmony_ci /* PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE */ 1255bf215546Sopenharmony_ci /* PIPE_QUERY_GPU_FINISHED */ 1256bf215546Sopenharmony_ci bool b; 1257bf215546Sopenharmony_ci 1258bf215546Sopenharmony_ci /* PIPE_QUERY_OCCLUSION_COUNTER */ 1259bf215546Sopenharmony_ci /* PIPE_QUERY_TIMESTAMP */ 1260bf215546Sopenharmony_ci /* PIPE_QUERY_TIME_ELAPSED */ 1261bf215546Sopenharmony_ci /* PIPE_QUERY_PRIMITIVES_GENERATED */ 1262bf215546Sopenharmony_ci /* PIPE_QUERY_PRIMITIVES_EMITTED */ 1263bf215546Sopenharmony_ci /* PIPE_DRIVER_QUERY_TYPE_UINT64 */ 1264bf215546Sopenharmony_ci /* PIPE_DRIVER_QUERY_TYPE_BYTES */ 1265bf215546Sopenharmony_ci /* PIPE_DRIVER_QUERY_TYPE_MICROSECONDS */ 1266bf215546Sopenharmony_ci /* PIPE_DRIVER_QUERY_TYPE_HZ */ 1267bf215546Sopenharmony_ci uint64_t u64; 1268bf215546Sopenharmony_ci 1269bf215546Sopenharmony_ci /* PIPE_DRIVER_QUERY_TYPE_UINT */ 1270bf215546Sopenharmony_ci uint32_t u32; 1271bf215546Sopenharmony_ci 1272bf215546Sopenharmony_ci /* PIPE_DRIVER_QUERY_TYPE_FLOAT */ 1273bf215546Sopenharmony_ci /* PIPE_DRIVER_QUERY_TYPE_PERCENTAGE */ 1274bf215546Sopenharmony_ci float f; 1275bf215546Sopenharmony_ci 1276bf215546Sopenharmony_ci /* PIPE_QUERY_SO_STATISTICS */ 1277bf215546Sopenharmony_ci struct pipe_query_data_so_statistics so_statistics; 1278bf215546Sopenharmony_ci 1279bf215546Sopenharmony_ci /* PIPE_QUERY_TIMESTAMP_DISJOINT */ 1280bf215546Sopenharmony_ci struct pipe_query_data_timestamp_disjoint timestamp_disjoint; 1281bf215546Sopenharmony_ci 1282bf215546Sopenharmony_ci /* PIPE_QUERY_PIPELINE_STATISTICS */ 1283bf215546Sopenharmony_ci struct pipe_query_data_pipeline_statistics pipeline_statistics; 1284bf215546Sopenharmony_ci 1285bf215546Sopenharmony_ci /* batch queries (variable length) */ 1286bf215546Sopenharmony_ci union pipe_numeric_type_union batch[1]; 1287bf215546Sopenharmony_ci}; 1288bf215546Sopenharmony_ci 1289bf215546Sopenharmony_cienum pipe_query_value_type 1290bf215546Sopenharmony_ci{ 1291bf215546Sopenharmony_ci PIPE_QUERY_TYPE_I32, 1292bf215546Sopenharmony_ci PIPE_QUERY_TYPE_U32, 1293bf215546Sopenharmony_ci PIPE_QUERY_TYPE_I64, 1294bf215546Sopenharmony_ci PIPE_QUERY_TYPE_U64, 1295bf215546Sopenharmony_ci}; 1296bf215546Sopenharmony_ci 1297bf215546Sopenharmony_cienum pipe_query_flags 1298bf215546Sopenharmony_ci{ 1299bf215546Sopenharmony_ci PIPE_QUERY_WAIT = (1 << 0), 1300bf215546Sopenharmony_ci PIPE_QUERY_PARTIAL = (1 << 1), 1301bf215546Sopenharmony_ci}; 1302bf215546Sopenharmony_ci 1303bf215546Sopenharmony_ciunion pipe_color_union 1304bf215546Sopenharmony_ci{ 1305bf215546Sopenharmony_ci float f[4]; 1306bf215546Sopenharmony_ci int i[4]; 1307bf215546Sopenharmony_ci unsigned int ui[4]; 1308bf215546Sopenharmony_ci}; 1309bf215546Sopenharmony_ci 1310bf215546Sopenharmony_cienum pipe_driver_query_type 1311bf215546Sopenharmony_ci{ 1312bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_UINT64, 1313bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_UINT, 1314bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_FLOAT, 1315bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_PERCENTAGE, 1316bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_BYTES, 1317bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_MICROSECONDS, 1318bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_HZ, 1319bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_DBM, 1320bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_TEMPERATURE, 1321bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_VOLTS, 1322bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_AMPS, 1323bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_TYPE_WATTS, 1324bf215546Sopenharmony_ci}; 1325bf215546Sopenharmony_ci 1326bf215546Sopenharmony_ci/* Whether an average value per frame or a cumulative value should be 1327bf215546Sopenharmony_ci * displayed. 1328bf215546Sopenharmony_ci */ 1329bf215546Sopenharmony_cienum pipe_driver_query_result_type 1330bf215546Sopenharmony_ci{ 1331bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_RESULT_TYPE_AVERAGE, 1332bf215546Sopenharmony_ci PIPE_DRIVER_QUERY_RESULT_TYPE_CUMULATIVE, 1333bf215546Sopenharmony_ci}; 1334bf215546Sopenharmony_ci 1335bf215546Sopenharmony_ci/** 1336bf215546Sopenharmony_ci * Some hardware requires some hardware-specific queries to be submitted 1337bf215546Sopenharmony_ci * as batched queries. The corresponding query objects are created using 1338bf215546Sopenharmony_ci * create_batch_query, and at most one such query may be active at 1339bf215546Sopenharmony_ci * any time. 1340bf215546Sopenharmony_ci */ 1341bf215546Sopenharmony_ci#define PIPE_DRIVER_QUERY_FLAG_BATCH (1 << 0) 1342bf215546Sopenharmony_ci 1343bf215546Sopenharmony_ci/* Do not list this query in the HUD. */ 1344bf215546Sopenharmony_ci#define PIPE_DRIVER_QUERY_FLAG_DONT_LIST (1 << 1) 1345bf215546Sopenharmony_ci 1346bf215546Sopenharmony_cistruct pipe_driver_query_info 1347bf215546Sopenharmony_ci{ 1348bf215546Sopenharmony_ci const char *name; 1349bf215546Sopenharmony_ci unsigned query_type; /* PIPE_QUERY_DRIVER_SPECIFIC + i */ 1350bf215546Sopenharmony_ci union pipe_numeric_type_union max_value; /* max value that can be returned */ 1351bf215546Sopenharmony_ci enum pipe_driver_query_type type; 1352bf215546Sopenharmony_ci enum pipe_driver_query_result_type result_type; 1353bf215546Sopenharmony_ci unsigned group_id; 1354bf215546Sopenharmony_ci unsigned flags; 1355bf215546Sopenharmony_ci}; 1356bf215546Sopenharmony_ci 1357bf215546Sopenharmony_cistruct pipe_driver_query_group_info 1358bf215546Sopenharmony_ci{ 1359bf215546Sopenharmony_ci const char *name; 1360bf215546Sopenharmony_ci unsigned max_active_queries; 1361bf215546Sopenharmony_ci unsigned num_queries; 1362bf215546Sopenharmony_ci}; 1363bf215546Sopenharmony_ci 1364bf215546Sopenharmony_cienum pipe_fd_type 1365bf215546Sopenharmony_ci{ 1366bf215546Sopenharmony_ci PIPE_FD_TYPE_NATIVE_SYNC, 1367bf215546Sopenharmony_ci PIPE_FD_TYPE_SYNCOBJ, 1368bf215546Sopenharmony_ci PIPE_FD_TYPE_TIMELINE_SEMAPHORE, 1369bf215546Sopenharmony_ci}; 1370bf215546Sopenharmony_ci 1371bf215546Sopenharmony_ci/** 1372bf215546Sopenharmony_ci * counter type and counter data type enums used by INTEL_performance_query 1373bf215546Sopenharmony_ci * APIs in gallium drivers. 1374bf215546Sopenharmony_ci */ 1375bf215546Sopenharmony_cienum pipe_perf_counter_type 1376bf215546Sopenharmony_ci{ 1377bf215546Sopenharmony_ci PIPE_PERF_COUNTER_TYPE_EVENT, 1378bf215546Sopenharmony_ci PIPE_PERF_COUNTER_TYPE_DURATION_NORM, 1379bf215546Sopenharmony_ci PIPE_PERF_COUNTER_TYPE_DURATION_RAW, 1380bf215546Sopenharmony_ci PIPE_PERF_COUNTER_TYPE_THROUGHPUT, 1381bf215546Sopenharmony_ci PIPE_PERF_COUNTER_TYPE_RAW, 1382bf215546Sopenharmony_ci PIPE_PERF_COUNTER_TYPE_TIMESTAMP, 1383bf215546Sopenharmony_ci}; 1384bf215546Sopenharmony_ci 1385bf215546Sopenharmony_cienum pipe_perf_counter_data_type 1386bf215546Sopenharmony_ci{ 1387bf215546Sopenharmony_ci PIPE_PERF_COUNTER_DATA_TYPE_BOOL32, 1388bf215546Sopenharmony_ci PIPE_PERF_COUNTER_DATA_TYPE_UINT32, 1389bf215546Sopenharmony_ci PIPE_PERF_COUNTER_DATA_TYPE_UINT64, 1390bf215546Sopenharmony_ci PIPE_PERF_COUNTER_DATA_TYPE_FLOAT, 1391bf215546Sopenharmony_ci PIPE_PERF_COUNTER_DATA_TYPE_DOUBLE, 1392bf215546Sopenharmony_ci}; 1393bf215546Sopenharmony_ci 1394bf215546Sopenharmony_ci#define PIPE_UUID_SIZE 16 1395bf215546Sopenharmony_ci#define PIPE_LUID_SIZE 8 1396bf215546Sopenharmony_ci 1397bf215546Sopenharmony_ci#ifdef PIPE_OS_UNIX 1398bf215546Sopenharmony_ci#define PIPE_MEMORY_FD 1399bf215546Sopenharmony_ci#endif 1400bf215546Sopenharmony_ci 1401bf215546Sopenharmony_ci#ifdef __cplusplus 1402bf215546Sopenharmony_ci} 1403bf215546Sopenharmony_ci#endif 1404bf215546Sopenharmony_ci 1405bf215546Sopenharmony_ci#endif 1406