p_defines.h revision 167d35c303461dd5d126b7b11f7e6da4377b8b59
17234550cf759fdf3ab325465090c7f5eb3b5d320Brian/************************************************************************** 27234550cf759fdf3ab325465090c7f5eb3b5d320Brian * 37234550cf759fdf3ab325465090c7f5eb3b5d320Brian * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. 47234550cf759fdf3ab325465090c7f5eb3b5d320Brian * All Rights Reserved. 57234550cf759fdf3ab325465090c7f5eb3b5d320Brian * 67234550cf759fdf3ab325465090c7f5eb3b5d320Brian * Permission is hereby granted, free of charge, to any person obtaining a 77234550cf759fdf3ab325465090c7f5eb3b5d320Brian * copy of this software and associated documentation files (the 87234550cf759fdf3ab325465090c7f5eb3b5d320Brian * "Software"), to deal in the Software without restriction, including 97234550cf759fdf3ab325465090c7f5eb3b5d320Brian * without limitation the rights to use, copy, modify, merge, publish, 107234550cf759fdf3ab325465090c7f5eb3b5d320Brian * distribute, sub license, and/or sell copies of the Software, and to 117234550cf759fdf3ab325465090c7f5eb3b5d320Brian * permit persons to whom the Software is furnished to do so, subject to 127234550cf759fdf3ab325465090c7f5eb3b5d320Brian * the following conditions: 137234550cf759fdf3ab325465090c7f5eb3b5d320Brian * 147234550cf759fdf3ab325465090c7f5eb3b5d320Brian * The above copyright notice and this permission notice (including the 157234550cf759fdf3ab325465090c7f5eb3b5d320Brian * next paragraph) shall be included in all copies or substantial portions 167234550cf759fdf3ab325465090c7f5eb3b5d320Brian * of the Software. 177234550cf759fdf3ab325465090c7f5eb3b5d320Brian * 187234550cf759fdf3ab325465090c7f5eb3b5d320Brian * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 197234550cf759fdf3ab325465090c7f5eb3b5d320Brian * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 207234550cf759fdf3ab325465090c7f5eb3b5d320Brian * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 217234550cf759fdf3ab325465090c7f5eb3b5d320Brian * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 227234550cf759fdf3ab325465090c7f5eb3b5d320Brian * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 237234550cf759fdf3ab325465090c7f5eb3b5d320Brian * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 247234550cf759fdf3ab325465090c7f5eb3b5d320Brian * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 257234550cf759fdf3ab325465090c7f5eb3b5d320Brian * 267234550cf759fdf3ab325465090c7f5eb3b5d320Brian **************************************************************************/ 277234550cf759fdf3ab325465090c7f5eb3b5d320Brian 28943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#ifndef PIPE_DEFINES_H 29943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_DEFINES_H 308e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 31121b6d68c212bba93d0c89df0fa38cc1dc7c09f2Vinson Lee#include "p_compiler.h" 3226df9d1a304f03e9692e7bac0a3bc83330f30c6amichal 33e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#ifdef __cplusplus 34e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonsecaextern "C" { 35e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#endif 36e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca 373a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca/** 383a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca * Gallium error codes. 393a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca * 403a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca * - A zero value always means success. 413a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca * - A negative value always means failure. 423a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca * - The meaning of a positive value is function dependent. 433a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca */ 443a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonsecaenum pipe_error { 453a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca PIPE_OK = 0, 463a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca PIPE_ERROR = -1, /**< Generic error */ 473a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca PIPE_ERROR_BAD_INPUT = -2, 483a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca PIPE_ERROR_OUT_OF_MEMORY = -3, 493a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca PIPE_ERROR_RETRY = -4 503a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca /* TODO */ 513a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca}; 523a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca 533a49497f102f2b64a8755d3cf65b7c0386e95aacJosé Fonseca 54943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_ONE 0x1 55943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_SRC_COLOR 0x2 56943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_SRC_ALPHA 0x3 57943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_DST_ALPHA 0x4 58943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_DST_COLOR 0x5 59943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE 0x6 60943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_CONST_COLOR 0x7 61943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_CONST_ALPHA 0x8 62943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_SRC1_COLOR 0x9 63943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_SRC1_ALPHA 0x0A 64943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_ZERO 0x11 65943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_INV_SRC_COLOR 0x12 66943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_INV_SRC_ALPHA 0x13 67943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_INV_DST_ALPHA 0x14 68943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_INV_DST_COLOR 0x15 69943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_INV_CONST_COLOR 0x17 70943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_INV_CONST_ALPHA 0x18 71943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_INV_SRC1_COLOR 0x19 72943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLENDFACTOR_INV_SRC1_ALPHA 0x1A 738e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 74943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLEND_ADD 0 75943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLEND_SUBTRACT 1 76943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLEND_REVERSE_SUBTRACT 2 77943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLEND_MIN 3 78943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_BLEND_MAX 4 798e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 80943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_CLEAR 0 81943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_NOR 1 82943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_AND_INVERTED 2 83943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_COPY_INVERTED 3 84943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_AND_REVERSE 4 85943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_INVERT 5 86943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_XOR 6 87943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_NAND 7 88943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_AND 8 89943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_EQUIV 9 90943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_NOOP 10 91943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_OR_INVERTED 11 92943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_COPY 12 93943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_OR_REVERSE 13 94943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_OR 14 95943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_LOGICOP_SET 15 968e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 9786352ff70d8c9a31fe0ebb4d02ce4bb4644fe54aBrian#define PIPE_MASK_R 0x1 9886352ff70d8c9a31fe0ebb4d02ce4bb4644fe54aBrian#define PIPE_MASK_G 0x2 9986352ff70d8c9a31fe0ebb4d02ce4bb4644fe54aBrian#define PIPE_MASK_B 0x4 10086352ff70d8c9a31fe0ebb4d02ce4bb4644fe54aBrian#define PIPE_MASK_A 0x8 1015936b439e88308a2eabb8a5570e91dd8fff89397Brian#define PIPE_MASK_RGBA 0xf 1025936b439e88308a2eabb8a5570e91dd8fff89397Brian 10386352ff70d8c9a31fe0ebb4d02ce4bb4644fe54aBrian 104efe6c50089e945902917c8091c92ce3a6155caacBrian/** 105efe6c50089e945902917c8091c92ce3a6155caacBrian * Inequality functions. Used for depth test, stencil compare, alpha 106efe6c50089e945902917c8091c92ce3a6155caacBrian * test, shadow compare, etc. 107efe6c50089e945902917c8091c92ce3a6155caacBrian */ 108efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_NEVER 0 109efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_LESS 1 110efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_EQUAL 2 111efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_LEQUAL 3 112efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_GREATER 4 113efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_NOTEQUAL 5 114efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_GEQUAL 6 115efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_ALWAYS 7 116008fb50174fb6717f3b71836427bc6be4e44613cBrian 1172137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian/** Polygon fill mode */ 1182137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian#define PIPE_POLYGON_MODE_FILL 0 1192137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian#define PIPE_POLYGON_MODE_LINE 1 1202137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian#define PIPE_POLYGON_MODE_POINT 2 1212137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian 1220bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell/** Polygon face specification, eg for culling */ 1230bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell#define PIPE_FACE_NONE 0 1240bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell#define PIPE_FACE_FRONT 1 1250bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell#define PIPE_FACE_BACK 2 1260bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell#define PIPE_FACE_FRONT_AND_BACK (PIPE_FACE_FRONT | PIPE_FACE_BACK) 1272137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian 128f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian/** Stencil ops */ 129943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_KEEP 0 130943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_ZERO 1 131943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_REPLACE 2 132943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_INCR 3 133943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_DECR 4 134943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_INCR_WRAP 5 135943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_DECR_WRAP 6 136943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_INVERT 7 137008fb50174fb6717f3b71836427bc6be4e44613cBrian 13872b3e3fee37413fefe205fa03a111a0180ed19c1Luca Barbieri/** Texture types. 13972b3e3fee37413fefe205fa03a111a0180ed19c1Luca Barbieri * See the documentation for info on PIPE_TEXTURE_RECT vs PIPE_TEXTURE_2D */ 1401c5f27a18b775b3784fcd265d60e0affa0b31581Michel Dänzerenum pipe_texture_target { 1414c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger PIPE_BUFFER = 0, 1424c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger PIPE_TEXTURE_1D = 1, 1434c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger PIPE_TEXTURE_2D = 2, 1444c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger PIPE_TEXTURE_3D = 3, 1454c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger PIPE_TEXTURE_CUBE = 4, 1464c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger PIPE_TEXTURE_RECT = 5, 1474c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger PIPE_TEXTURE_1D_ARRAY = 6, 1484c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger PIPE_TEXTURE_2D_ARRAY = 7, 149e1d0f4780861121e564c833d6061082491126154Marek Olšák PIPE_MAX_TEXTURE_TYPES 1501c5f27a18b775b3784fcd265d60e0affa0b31581Michel Dänzer}; 151eb147ed775bedec9d849cdc817f208b5fe5eade3Brian 152eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_POS_X 0 153eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_NEG_X 1 154eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_POS_Y 2 155eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_NEG_Y 3 156eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_POS_Z 4 157eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_NEG_Z 5 15895b7771ea705b71bbd8185cd8e39b546e18e09a9Brian Paul#define PIPE_TEX_FACE_MAX 6 159eb147ed775bedec9d849cdc817f208b5fe5eade3Brian 160943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_REPEAT 0 161943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_CLAMP 1 162943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_CLAMP_TO_EDGE 2 163943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_CLAMP_TO_BORDER 3 164943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_MIRROR_REPEAT 4 165943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_MIRROR_CLAMP 5 166943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE 6 167943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER 7 16802a47549ad182d28d330063d4f452108e3a4b452Brian 16978b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell/* Between mipmaps, ie mipfilter 17078b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell */ 17178b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_MIPFILTER_NEAREST 0 17278b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_MIPFILTER_LINEAR 1 17378b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_MIPFILTER_NONE 2 17478b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell 17578b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell/* Within a mipmap, ie min/mag filter 17678b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell */ 17778b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_FILTER_NEAREST 0 17878b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_FILTER_LINEAR 1 17902a47549ad182d28d330063d4f452108e3a4b452Brian 180943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_COMPARE_NONE 0 181943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_COMPARE_R_TO_TEXTURE 1 1828f2888758129b0a40d71fa4ce10d606b4bcf7631Brian 1838e6a3807981bb96bb6747683dbc9f92ae7117dd2Keith Whitwell/** 184eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer * Clear buffer bits 185eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer */ 186eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer/** All color buffers currently bound */ 187eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer#define PIPE_CLEAR_COLOR (1 << 0) 1880cd70b554cb0bb9280f83fddf4f1451fddd37230Roland Scheidegger#define PIPE_CLEAR_DEPTH (1 << 1) 1890cd70b554cb0bb9280f83fddf4f1451fddd37230Roland Scheidegger#define PIPE_CLEAR_STENCIL (1 << 2) 190eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer/** Depth/stencil combined */ 1910cd70b554cb0bb9280f83fddf4f1451fddd37230Roland Scheidegger#define PIPE_CLEAR_DEPTHSTENCIL (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL) 192eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer 193eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer/** 1944617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer * Transfer object usage flags 1954617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer */ 1964617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzerenum pipe_transfer_usage { 197287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell /** 198287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Resource contents read back (or accessed directly) at transfer 199287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * create time. 200287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell */ 201f199dbdb76892ec31d19f114f042bc6ec82d9e46Maarten Maathuis PIPE_TRANSFER_READ = (1 << 0), 202287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 203287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell /** 204287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Resource contents will be written back at transfer_destroy 205287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * time (or modified as a result of being accessed directly). 206287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell */ 207f199dbdb76892ec31d19f114f042bc6ec82d9e46Maarten Maathuis PIPE_TRANSFER_WRITE = (1 << 1), 208287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 209287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell /** 210287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Read/modify/write 211287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell */ 2129db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer PIPE_TRANSFER_READ_WRITE = PIPE_TRANSFER_READ | PIPE_TRANSFER_WRITE, 213287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 2149db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer /** 2159db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer * The transfer should map the texture storage directly. The driver may 2169db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer * return NULL if that isn't possible, and the state tracker needs to cope 2179db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer * with that and use an alternative path without this flag. 2189db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer * 2199db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer * E.g. the state tracker could have a simpler path which maps textures and 2209db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer * does read/modify/write cycles on them directly, and a more complicated 2219db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer * path which uses minimal read and write transfers. 2229db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer */ 223287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell PIPE_TRANSFER_MAP_DIRECTLY = (1 << 2), 224287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 225287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell /** 226287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Discards the memory within the mapped region. 227287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * 2287aeb610fe1b2656070f25e0647ccccfbfc89941cJosé Fonseca * It should not be used with PIPE_TRANSFER_READ. 229287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * 230287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * See also: 231287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_RANGE_BIT flag. 232287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell */ 233fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell PIPE_TRANSFER_DISCARD = (1 << 8), /* DEPRECATED */ 234fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell PIPE_TRANSFER_DISCARD_RANGE = (1 << 8), 2354617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer 236287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell /** 237287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Fail if the resource cannot be mapped immediately. 238287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * 239287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * See also: 240287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * - Direct3D's D3DLOCK_DONOTWAIT flag. 241287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * - Mesa3D's MESA_MAP_NOWAIT_BIT flag. 242287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * - WDDM's D3DDDICB_LOCKFLAGS.DonotWait flag. 243287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell */ 244287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell PIPE_TRANSFER_DONTBLOCK = (1 << 9), 2454617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer 246287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell /** 247287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Do not attempt to synchronize pending operations on the resource when mapping. 248287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * 2497aeb610fe1b2656070f25e0647ccccfbfc89941cJosé Fonseca * It should not be used with PIPE_TRANSFER_READ. 250287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * 251287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * See also: 252287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * - OpenGL's ARB_map_buffer_range extension, MAP_UNSYNCHRONIZED_BIT flag. 253287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * - Direct3D's D3DLOCK_NOOVERWRITE flag. 254287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * - WDDM's D3DDDICB_LOCKFLAGS.IgnoreSync flag. 255287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell */ 256287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell PIPE_TRANSFER_UNSYNCHRONIZED = (1 << 10), 257287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell PIPE_TRANSFER_NOOVERWRITE = (1 << 10), /* are these really the same?? */ 258287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 259287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell /** 260287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Written ranges will be notified later with 261287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * pipe_context::transfer_flush_region. 262287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * 2637aeb610fe1b2656070f25e0647ccccfbfc89941cJosé Fonseca * It should not be used with PIPE_TRANSFER_READ. 264287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * 265287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * See also: 266287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * - pipe_context::transfer_flush_region 267287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * - OpenGL's ARB_map_buffer_range extension, MAP_FLUSH_EXPLICIT_BIT flag. 268287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell */ 269fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell PIPE_TRANSFER_FLUSH_EXPLICIT = (1 << 11), 270fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell 271fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell /** 272fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * Discards all memory backing the resource. 273fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * 2747aeb610fe1b2656070f25e0647ccccfbfc89941cJosé Fonseca * It should not be used with PIPE_TRANSFER_READ. 275fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * 276fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * This is equivalent to: 277fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_BUFFER_BIT 278fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * - BufferData(NULL) on a GL buffer 279fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * - Direct3D's D3DLOCK_DISCARD flag. 280fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * - WDDM's D3DDDICB_LOCKFLAGS.Discard flag. 281fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * - D3D10 DDI's D3D10_DDI_MAP_WRITE_DISCARD flag 282fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell * - D3D10's D3D10_MAP_WRITE_DISCARD flag. 283fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell */ 284fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE = (1 << 12) 285287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 286287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell}; 287244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca 288244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca 289244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca/* 290287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Resource binding flags -- state tracker must specify in advance all 291287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * the ways a resource might be used. 292244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca */ 2934c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger#define PIPE_BIND_DEPTH_STENCIL (1 << 0) /* create_surface */ 2944c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger#define PIPE_BIND_RENDER_TARGET (1 << 1) /* create_surface */ 2954c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger#define PIPE_BIND_SAMPLER_VIEW (1 << 2) /* create_sampler_view */ 296287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_VERTEX_BUFFER (1 << 3) /* set_vertex_buffers */ 297287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_INDEX_BUFFER (1 << 4) /* draw_elements */ 298287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_CONSTANT_BUFFER (1 << 5) /* set_constant_buffer */ 299287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_DISPLAY_TARGET (1 << 8) /* flush_front_buffer */ 300287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_TRANSFER_WRITE (1 << 9) /* get_transfer */ 301287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_TRANSFER_READ (1 << 10) /* get_transfer */ 302a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusin#define PIPE_BIND_STREAM_OUTPUT (1 << 11) /* set_stream_output_buffers */ 303287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_CUSTOM (1 << 16) /* state-tracker/winsys usages */ 304287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 30550d77c79fbcdf6a33691bfa120d54528d28091a4Brian Paul/* The first two flags above were previously part of the amorphous 306287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * TEXTURE_USAGE, most of which are now descriptions of the ways a 30750d77c79fbcdf6a33691bfa120d54528d28091a4Brian Paul * particular texture can be bound to the gallium pipeline. The two flags 30850d77c79fbcdf6a33691bfa120d54528d28091a4Brian Paul * below do not fit within that and probably need to be migrated to some 309287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * other place. 310244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca * 311287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * It seems like scanout is used by the Xorg state tracker to ask for 312287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * a texture suitable for actual scanout (hence the name), which 313287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * implies extra layout constraints on some hardware. It may also 314287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * have some special meaning regarding mouse cursor images. 315244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca * 316287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * The shared flag is quite underspecified, but certainly isn't a 317287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * binding flag - it seems more like a message to the winsys to create 31850d77c79fbcdf6a33691bfa120d54528d28091a4Brian Paul * a shareable allocation. 319244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca */ 320287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_SCANOUT (1 << 14) /* */ 321287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_SHARED (1 << 15) /* get_texture_handle ??? */ 322244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca 323244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca 324287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell/* Flags for the driver about resource behaviour: 325244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca */ 326287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_RESOURCE_FLAG_GEN_MIPS (1 << 0) /* Driver performs autogen mips */ 327287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_RESOURCE_FLAG_DRV_PRIV (1 << 16) /* driver/winsys private */ 328287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_RESOURCE_FLAG_ST_PRIV (1 << 24) /* state-tracker/winsys private */ 329244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca 330287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell/* Hint about the expected lifecycle of a resource. 331244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca */ 332287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_DEFAULT 0 /* many uploads, draws intermixed */ 333287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_DYNAMIC 1 /* many uploads, draws intermixed */ 334287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_STATIC 2 /* same as immutable?? */ 335287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_IMMUTABLE 3 /* no change after first upload */ 336287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_STREAM 4 /* upload, draw, upload, draw */ 337a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusin#define PIPE_USAGE_STAGING 5 /* supports data transfers from the GPU to the CPU */ 338244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca 339756d52ec12c41ee90ee9598dc9028cc134806bd2Michel Dänzer 34094a4910c9a1ef48470f45c01c379254cb033119fBrian/** 341c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian * Shaders 342c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian */ 343c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian#define PIPE_SHADER_VERTEX 0 344c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian#define PIPE_SHADER_FRAGMENT 1 34589d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_SHADER_GEOMETRY 2 34689d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_SHADER_TYPES 3 347c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian 348c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian 349c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian/** 35094a4910c9a1ef48470f45c01c379254cb033119fBrian * Primitive types: 35194a4910c9a1ef48470f45c01c379254cb033119fBrian */ 35289d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_POINTS 0 35389d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINES 1 35489d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINE_LOOP 2 35589d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINE_STRIP 3 35689d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLES 4 35789d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLE_STRIP 5 35889d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLE_FAN 6 35989d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_QUADS 7 36089d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_QUAD_STRIP 8 36189d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_POLYGON 9 36289d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINES_ADJACENCY 10 36389d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINE_STRIP_ADJACENCY 11 36489d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLES_ADJACENCY 12 36589d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY 13 36689d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_MAX 14 36794a4910c9a1ef48470f45c01c379254cb033119fBrian 36840a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell 36909fbb3837b6aa5dfc6c94f41ab5443820177c569Brian/** 37009fbb3837b6aa5dfc6c94f41ab5443820177c569Brian * Query object types 37109fbb3837b6aa5dfc6c94f41ab5443820177c569Brian */ 37209fbb3837b6aa5dfc6c94f41ab5443820177c569Brian#define PIPE_QUERY_OCCLUSION_COUNTER 0 37309fbb3837b6aa5dfc6c94f41ab5443820177c569Brian#define PIPE_QUERY_PRIMITIVES_GENERATED 1 37409fbb3837b6aa5dfc6c94f41ab5443820177c569Brian#define PIPE_QUERY_PRIMITIVES_EMITTED 2 375cdbd5f4203391ee7eb12911bc86fea34dc61c957Mathias Fröhlich#define PIPE_QUERY_TIME_ELAPSED 3 376be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin#define PIPE_QUERY_SO_STATISTICS 5 377b6c360b46c2b2b1548e2aeaa1a1cd201dfcf82aeZack Rusin#define PIPE_QUERY_GPU_FINISHED 6 378e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin#define PIPE_QUERY_TIMESTAMP_DISJOINT 7 3790657fc00dd9e69f71d679d480b5d5f4c33cfae35Zack Rusin#define PIPE_QUERY_OCCLUSION_PREDICATE 8 3800657fc00dd9e69f71d679d480b5d5f4c33cfae35Zack Rusin#define PIPE_QUERY_TYPES 9 38109fbb3837b6aa5dfc6c94f41ab5443820177c569Brian 38237cf13ed9a429c755f121daa1776b1b30a985ab3Brian 3831b4852345954af9b582b03a91a3d8399b8fb0e92Brian/** 384c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul * Conditional rendering modes 385c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul */ 386c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul#define PIPE_RENDER_COND_WAIT 0 387c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul#define PIPE_RENDER_COND_NO_WAIT 1 388c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul#define PIPE_RENDER_COND_BY_REGION_WAIT 2 389c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul#define PIPE_RENDER_COND_BY_REGION_NO_WAIT 3 390c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul 391c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul 392c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul/** 3931b4852345954af9b582b03a91a3d8399b8fb0e92Brian * Point sprite coord modes 3941b4852345954af9b582b03a91a3d8399b8fb0e92Brian */ 3954a4daa75a85db22cd37ebd533ebbccb427e07077Roland Scheidegger#define PIPE_SPRITE_COORD_UPPER_LEFT 0 3964a4daa75a85db22cd37ebd533ebbccb427e07077Roland Scheidegger#define PIPE_SPRITE_COORD_LOWER_LEFT 1 3971b4852345954af9b582b03a91a3d8399b8fb0e92Brian 398c6499a741c99394e81d1d86ffd066f3d9749875cBrian 399c6499a741c99394e81d1d86ffd066f3d9749875cBrian/** 400f6106566081978f663cf08e54bb8908cb58a5316Michal Krol * Texture swizzles 401f6106566081978f663cf08e54bb8908cb58a5316Michal Krol */ 402f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_RED 0 403f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_GREEN 1 404f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_BLUE 2 405f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_ALPHA 3 406f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_ZERO 4 407f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_ONE 5 408f6106566081978f663cf08e54bb8908cb58a5316Michal Krol 409f6106566081978f663cf08e54bb8908cb58a5316Michal Krol 410b39bccbd4ed71e9585da4cf5acf7b887b2e90899Marek Olšák#define PIPE_TIMEOUT_INFINITE 0xffffffffffffffffull 411b39bccbd4ed71e9585da4cf5acf7b887b2e90899Marek Olšák 412f6106566081978f663cf08e54bb8908cb58a5316Michal Krol/** 413aebc08b5ccc6ac2a7c6673e93c63b097c7734e6dBrian Paul * Implementation capabilities/limits which are queried through 414aebc08b5ccc6ac2a7c6673e93c63b097c7734e6dBrian Paul * pipe_screen::get_param() and pipe_screen::get_paramf(). 415c6499a741c99394e81d1d86ffd066f3d9749875cBrian */ 416e1238b5cad3845c029f60d92c08e810274517d33José Fonsecaenum pipe_cap { 417167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS = 0, 418167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_NPOT_TEXTURES = 1, 419167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TWO_SIDED_STENCIL = 2, 420167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_GLSL = 3, /* XXX need something better */ 421167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_DUAL_SOURCE_BLEND = 4, 422167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_ANISOTROPIC_FILTER = 5, 423167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_POINT_SPRITE = 6, 424167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_RENDER_TARGETS = 7, 425167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_OCCLUSION_QUERY = 8, 426167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TIMER_QUERY = 9, 427167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TEXTURE_SHADOW_MAP = 10, 428167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TEXTURE_SWIZZLE = 11, 429167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_TEXTURE_2D_LEVELS = 12, 430167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_TEXTURE_3D_LEVELS = 13, 431167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS = 14, 432167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_LINE_WIDTH = 15, 433167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_LINE_WIDTH_AA = 16, 434167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_POINT_WIDTH = 17, 435167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_POINT_WIDTH_AA = 18, 436167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_TEXTURE_ANISOTROPY = 19, 437167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_TEXTURE_LOD_BIAS = 20, 438167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_GUARD_BAND_LEFT = 21, /*< float */ 439167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_GUARD_BAND_TOP = 22, /*< float */ 440167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_GUARD_BAND_RIGHT = 23, /*< float */ 441167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_GUARD_BAND_BOTTOM = 24, /*< float */ 442167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TEXTURE_MIRROR_CLAMP = 25, 443167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TEXTURE_MIRROR_REPEAT = 26, 444167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS = 27, 445167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_BLEND_EQUATION_SEPARATE = 28, 446167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_SM3 = 29, /*< Shader Model, supported */ 447167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_STREAM_OUTPUT = 30, 448167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_PRIMITIVE_RESTART = 31, 449e1238b5cad3845c029f60d92c08e810274517d33José Fonseca /** Maximum texture image units accessible from vertex and fragment shaders 450e1238b5cad3845c029f60d92c08e810274517d33José Fonseca * combined */ 451167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_MAX_COMBINED_SAMPLERS = 32, 452e1238b5cad3845c029f60d92c08e810274517d33José Fonseca /** blend enables and write masks per rendertarget */ 453167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_INDEP_BLEND_ENABLE = 33, 454e1238b5cad3845c029f60d92c08e810274517d33José Fonseca /** different blend funcs per rendertarget */ 455167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_INDEP_BLEND_FUNC = 34, 456167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE = 35, 457167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_ARRAY_TEXTURES = 36, 458167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT = 37, 459167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT = 38, 460167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER = 39, 461167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER = 40, 462167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_DEPTH_CLAMP = 41, 463167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_SHADER_STENCIL_EXPORT = 42, 464167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_TGSI_INSTANCEID = 43, 465167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR = 44, 466167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL = 45, 467e1238b5cad3845c029f60d92c08e810274517d33José Fonseca}; 468be66a8f43172327e3cdde27281e40377cacbb121Brian Paul 469a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579dLuca Barbieri/* Shader caps not specific to any single stage */ 470a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579dLuca Barbierienum pipe_shader_cap 471a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579dLuca Barbieri{ 472167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_INSTRUCTIONS = 0, /* if 0, it means the stage is unsupported */ 473167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS = 1, 474167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS = 2, 475167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS = 3, 476167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH = 4, 477167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_INPUTS = 5, 478167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_CONSTS = 6, 479167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_CONST_BUFFERS = 7, 480167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_TEMPS = 8, 481167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_ADDRS = 9, 482167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_MAX_PREDS = 10, 483cbfdf262ccf8b573f1fa4c0065a8eb1fb87d93daMarek Olšák /* boolean caps */ 484167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED = 11, 485167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR = 12, 486167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR = 13, 487167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR = 14, 488167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_INDIRECT_CONST_ADDR = 15, 489167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer PIPE_SHADER_CAP_SUBROUTINES = 16, /* BGNSUB, ENDSUB, CAL, RET */ 490a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579dLuca Barbieri}; 49107aaf3a7a730d65052ec34a82cce9b373673b556Brian Paul 492c6499a741c99394e81d1d86ffd066f3d9749875cBrian 493be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin/** 494be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin * Composite query types 495be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin */ 496be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusinstruct pipe_query_data_so_statistics 497be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin{ 498be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin uint64_t num_primitives_written; 499be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin uint64_t primitives_storage_needed; 500be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin}; 501e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusinstruct pipe_query_data_timestamp_disjoint 502e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin{ 503e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin uint64_t frequency; 504e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin boolean disjoint; 505e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin}; 506f547472bfa0a797adacc2a7688b4c1ba65381a80Younes Manton 507e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#ifdef __cplusplus 508e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca} 509e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#endif 510e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca 5117234550cf759fdf3ab325465090c7f5eb3b5d320Brian#endif 512