p_defines.h revision a4f26f2bea94baea56354fe629ccd971a6d4eb1c
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
10294822c6d83b7811db2a02bb4416df02ae225ba47Christoph Bumiller#define PIPE_MASK_Z  0x10
10394822c6d83b7811db2a02bb4416df02ae225ba47Christoph Bumiller#define PIPE_MASK_S  0x20
10494822c6d83b7811db2a02bb4416df02ae225ba47Christoph Bumiller#define PIPE_MASK_ZS 0x30
1055936b439e88308a2eabb8a5570e91dd8fff89397Brian
10686352ff70d8c9a31fe0ebb4d02ce4bb4644fe54aBrian
107efe6c50089e945902917c8091c92ce3a6155caacBrian/**
108efe6c50089e945902917c8091c92ce3a6155caacBrian * Inequality functions.  Used for depth test, stencil compare, alpha
109efe6c50089e945902917c8091c92ce3a6155caacBrian * test, shadow compare, etc.
110efe6c50089e945902917c8091c92ce3a6155caacBrian */
111efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_NEVER    0
112efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_LESS     1
113efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_EQUAL    2
114efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_LEQUAL   3
115efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_GREATER  4
116efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_NOTEQUAL 5
117efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_GEQUAL   6
118efe6c50089e945902917c8091c92ce3a6155caacBrian#define PIPE_FUNC_ALWAYS   7
119008fb50174fb6717f3b71836427bc6be4e44613cBrian
1202137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian/** Polygon fill mode */
1212137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian#define PIPE_POLYGON_MODE_FILL  0
1222137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian#define PIPE_POLYGON_MODE_LINE  1
1232137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian#define PIPE_POLYGON_MODE_POINT 2
1242137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian
1250bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell/** Polygon face specification, eg for culling */
1260bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell#define PIPE_FACE_NONE           0
1270bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell#define PIPE_FACE_FRONT          1
1280bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell#define PIPE_FACE_BACK           2
1290bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell#define PIPE_FACE_FRONT_AND_BACK (PIPE_FACE_FRONT | PIPE_FACE_BACK)
1302137e3053ec87e4463fdbd952537d1bbd1a3dbcdBrian
131f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian/** Stencil ops */
132943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_KEEP       0
133943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_ZERO       1
134943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_REPLACE    2
135943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_INCR       3
136943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_DECR       4
137943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_INCR_WRAP  5
138943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_DECR_WRAP  6
139943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STENCIL_OP_INVERT     7
140008fb50174fb6717f3b71836427bc6be4e44613cBrian
14172b3e3fee37413fefe205fa03a111a0180ed19c1Luca Barbieri/** Texture types.
14272b3e3fee37413fefe205fa03a111a0180ed19c1Luca Barbieri * See the documentation for info on PIPE_TEXTURE_RECT vs PIPE_TEXTURE_2D */
1431c5f27a18b775b3784fcd265d60e0affa0b31581Michel Dänzerenum pipe_texture_target {
1444c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger   PIPE_BUFFER           = 0,
1454c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger   PIPE_TEXTURE_1D       = 1,
1464c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger   PIPE_TEXTURE_2D       = 2,
1474c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger   PIPE_TEXTURE_3D       = 3,
1484c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger   PIPE_TEXTURE_CUBE     = 4,
1494c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger   PIPE_TEXTURE_RECT     = 5,
1504c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger   PIPE_TEXTURE_1D_ARRAY = 6,
1514c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger   PIPE_TEXTURE_2D_ARRAY = 7,
152e1d0f4780861121e564c833d6061082491126154Marek Olšák   PIPE_MAX_TEXTURE_TYPES
1531c5f27a18b775b3784fcd265d60e0affa0b31581Michel Dänzer};
154eb147ed775bedec9d849cdc817f208b5fe5eade3Brian
155eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_POS_X 0
156eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_NEG_X 1
157eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_POS_Y 2
158eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_NEG_Y 3
159eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_POS_Z 4
160eb147ed775bedec9d849cdc817f208b5fe5eade3Brian#define PIPE_TEX_FACE_NEG_Z 5
16195b7771ea705b71bbd8185cd8e39b546e18e09a9Brian Paul#define PIPE_TEX_FACE_MAX   6
162eb147ed775bedec9d849cdc817f208b5fe5eade3Brian
163943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_REPEAT                   0
164943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_CLAMP                    1
165943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_CLAMP_TO_EDGE            2
166943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_CLAMP_TO_BORDER          3
167943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_MIRROR_REPEAT            4
168943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_MIRROR_CLAMP             5
169943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE     6
170943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER   7
17102a47549ad182d28d330063d4f452108e3a4b452Brian
17278b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell/* Between mipmaps, ie mipfilter
17378b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell */
17478b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_MIPFILTER_NEAREST  0
17578b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_MIPFILTER_LINEAR   1
17678b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_MIPFILTER_NONE     2
17778b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell
17878b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell/* Within a mipmap, ie min/mag filter
17978b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell */
18078b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_FILTER_NEAREST      0
18178b1a29a0da8d1877408421df5012d37084a96deKeith Whitwell#define PIPE_TEX_FILTER_LINEAR       1
18202a47549ad182d28d330063d4f452108e3a4b452Brian
183943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_COMPARE_NONE          0
184943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_TEX_COMPARE_R_TO_TEXTURE  1
1858f2888758129b0a40d71fa4ce10d606b4bcf7631Brian
1868e6a3807981bb96bb6747683dbc9f92ae7117dd2Keith Whitwell/**
187eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer * Clear buffer bits
188eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer */
189eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer/** All color buffers currently bound */
190eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer#define PIPE_CLEAR_COLOR        (1 << 0)
1910cd70b554cb0bb9280f83fddf4f1451fddd37230Roland Scheidegger#define PIPE_CLEAR_DEPTH        (1 << 1)
1920cd70b554cb0bb9280f83fddf4f1451fddd37230Roland Scheidegger#define PIPE_CLEAR_STENCIL      (1 << 2)
193eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer/** Depth/stencil combined */
1940cd70b554cb0bb9280f83fddf4f1451fddd37230Roland Scheidegger#define PIPE_CLEAR_DEPTHSTENCIL (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)
195eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer
196eb168e26aa63f11a47d70c4555cae30691a2cd57Michel Dänzer/**
1974617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer * Transfer object usage flags
1984617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer */
1994617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzerenum pipe_transfer_usage {
200287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   /**
201287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * Resource contents read back (or accessed directly) at transfer
202287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * create time.
203287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    */
204f199dbdb76892ec31d19f114f042bc6ec82d9e46Maarten Maathuis   PIPE_TRANSFER_READ = (1 << 0),
205287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell
206287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   /**
207287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * Resource contents will be written back at transfer_destroy
208287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * time (or modified as a result of being accessed directly).
209287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    */
210f199dbdb76892ec31d19f114f042bc6ec82d9e46Maarten Maathuis   PIPE_TRANSFER_WRITE = (1 << 1),
211287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell
212287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   /**
213287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * Read/modify/write
214287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    */
2159db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer   PIPE_TRANSFER_READ_WRITE = PIPE_TRANSFER_READ | PIPE_TRANSFER_WRITE,
216287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell
2179db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer   /**
2189db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer    * The transfer should map the texture storage directly. The driver may
2199db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer    * return NULL if that isn't possible, and the state tracker needs to cope
2209db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer    * with that and use an alternative path without this flag.
2219db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer    *
2229db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer    * E.g. the state tracker could have a simpler path which maps textures and
2239db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer    * does read/modify/write cycles on them directly, and a more complicated
2249db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer    * path which uses minimal read and write transfers.
2259db647bb7ac5b8e560c49222b4e0c98a3acc4672Michel Dänzer    */
226287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   PIPE_TRANSFER_MAP_DIRECTLY = (1 << 2),
2274617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer
228287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   /**
229287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * Discards the memory within the mapped region.
230287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    *
2317aeb610fe1b2656070f25e0647ccccfbfc89941cJosé Fonseca    * It should not be used with PIPE_TRANSFER_READ.
232287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    *
233287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * See also:
234287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_RANGE_BIT flag.
235287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    */
236fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell   PIPE_TRANSFER_DISCARD = (1 << 8), /* DEPRECATED */
237fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell   PIPE_TRANSFER_DISCARD_RANGE = (1 << 8),
2384617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer
239287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   /**
240287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * Fail if the resource cannot be mapped immediately.
241287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    *
242287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * See also:
243287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * - Direct3D's D3DLOCK_DONOTWAIT flag.
244287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * - Mesa3D's MESA_MAP_NOWAIT_BIT flag.
245287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * - WDDM's D3DDDICB_LOCKFLAGS.DonotWait flag.
246287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    */
247287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   PIPE_TRANSFER_DONTBLOCK = (1 << 9),
2484617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer
249287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   /**
250287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * Do not attempt to synchronize pending operations on the resource when mapping.
251287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    *
2527aeb610fe1b2656070f25e0647ccccfbfc89941cJosé Fonseca    * It should not be used with PIPE_TRANSFER_READ.
253287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    *
254287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * See also:
255287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * - OpenGL's ARB_map_buffer_range extension, MAP_UNSYNCHRONIZED_BIT flag.
256287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * - Direct3D's D3DLOCK_NOOVERWRITE flag.
257287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * - WDDM's D3DDDICB_LOCKFLAGS.IgnoreSync flag.
258287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    */
259287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   PIPE_TRANSFER_UNSYNCHRONIZED = (1 << 10),
260287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   PIPE_TRANSFER_NOOVERWRITE = (1 << 10), /* are these really the same?? */
261287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell
262287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell   /**
263287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * Written ranges will be notified later with
264287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * pipe_context::transfer_flush_region.
265287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    *
2667aeb610fe1b2656070f25e0647ccccfbfc89941cJosé Fonseca    * It should not be used with PIPE_TRANSFER_READ.
267287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    *
268287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * See also:
269287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * - pipe_context::transfer_flush_region
270287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    * - OpenGL's ARB_map_buffer_range extension, MAP_FLUSH_EXPLICIT_BIT flag.
271287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell    */
272fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell   PIPE_TRANSFER_FLUSH_EXPLICIT = (1 << 11),
273fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell
274fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell   /**
275fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    * Discards all memory backing the resource.
276fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    *
2777aeb610fe1b2656070f25e0647ccccfbfc89941cJosé Fonseca    * It should not be used with PIPE_TRANSFER_READ.
278fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    *
279fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    * This is equivalent to:
280fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_BUFFER_BIT
281fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    * - BufferData(NULL) on a GL buffer
282fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    * - Direct3D's D3DLOCK_DISCARD flag.
283fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    * - WDDM's D3DDDICB_LOCKFLAGS.Discard flag.
284fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    * - D3D10 DDI's D3D10_DDI_MAP_WRITE_DISCARD flag
285fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    * - D3D10's D3D10_MAP_WRITE_DISCARD flag.
286fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell    */
287fad8497d3b1cead6f0a5056deaa49350ed4e4d41Keith Whitwell   PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE = (1 << 12)
288287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell
289287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell};
290244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca
291244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca
292244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca/*
293287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Resource binding flags -- state tracker must specify in advance all
294287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * the ways a resource might be used.
295244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca */
2964c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger#define PIPE_BIND_DEPTH_STENCIL        (1 << 0) /* create_surface */
2974c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger#define PIPE_BIND_RENDER_TARGET        (1 << 1) /* create_surface */
298a4f26f2bea94baea56354fe629ccd971a6d4eb1cChristoph Bumiller#define PIPE_BIND_BLENDABLE            (1 << 2) /* create_surface */
299a4f26f2bea94baea56354fe629ccd971a6d4eb1cChristoph Bumiller#define PIPE_BIND_SAMPLER_VIEW         (1 << 3) /* create_sampler_view */
300a4f26f2bea94baea56354fe629ccd971a6d4eb1cChristoph Bumiller#define PIPE_BIND_VERTEX_BUFFER        (1 << 4) /* set_vertex_buffers */
301a4f26f2bea94baea56354fe629ccd971a6d4eb1cChristoph Bumiller#define PIPE_BIND_INDEX_BUFFER         (1 << 5) /* draw_elements */
302a4f26f2bea94baea56354fe629ccd971a6d4eb1cChristoph Bumiller#define PIPE_BIND_CONSTANT_BUFFER      (1 << 6) /* set_constant_buffer */
303287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_DISPLAY_TARGET       (1 << 8) /* flush_front_buffer */
304287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_TRANSFER_WRITE       (1 << 9) /* get_transfer */
305287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_TRANSFER_READ        (1 << 10) /* get_transfer */
306a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusin#define PIPE_BIND_STREAM_OUTPUT        (1 << 11) /* set_stream_output_buffers */
3073b2bc4ac5b63429738687fd296180149b54e67a4Marcin Slusarz#define PIPE_BIND_CURSOR               (1 << 16) /* mouse cursor */
3083b2bc4ac5b63429738687fd296180149b54e67a4Marcin Slusarz#define PIPE_BIND_CUSTOM               (1 << 17) /* state-tracker/winsys usages */
309287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell
31050d77c79fbcdf6a33691bfa120d54528d28091a4Brian Paul/* The first two flags above were previously part of the amorphous
311287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * TEXTURE_USAGE, most of which are now descriptions of the ways a
31250d77c79fbcdf6a33691bfa120d54528d28091a4Brian Paul * particular texture can be bound to the gallium pipeline.  The two flags
31350d77c79fbcdf6a33691bfa120d54528d28091a4Brian Paul * below do not fit within that and probably need to be migrated to some
314287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * other place.
315244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca *
316287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * It seems like scanout is used by the Xorg state tracker to ask for
317287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * a texture suitable for actual scanout (hence the name), which
318287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * implies extra layout constraints on some hardware.  It may also
319287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * have some special meaning regarding mouse cursor images.
320244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca *
321287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * The shared flag is quite underspecified, but certainly isn't a
322287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * binding flag - it seems more like a message to the winsys to create
32350d77c79fbcdf6a33691bfa120d54528d28091a4Brian Paul * a shareable allocation.
324244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca */
325287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_SCANOUT     (1 << 14) /*  */
326287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_BIND_SHARED      (1 << 15) /* get_texture_handle ??? */
327244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca
328244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca
329287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell/* Flags for the driver about resource behaviour:
330244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca */
331287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_RESOURCE_FLAG_GEN_MIPS    (1 << 0)  /* Driver performs autogen mips */
332287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_RESOURCE_FLAG_DRV_PRIV    (1 << 16) /* driver/winsys private */
333287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_RESOURCE_FLAG_ST_PRIV     (1 << 24) /* state-tracker/winsys private */
334244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca
335287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell/* Hint about the expected lifecycle of a resource.
336244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca */
337287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_DEFAULT        0 /* many uploads, draws intermixed */
338287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_DYNAMIC        1 /* many uploads, draws intermixed */
339287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_STATIC         2 /* same as immutable?? */
340287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_IMMUTABLE      3 /* no change after first upload */
341287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell#define PIPE_USAGE_STREAM         4 /* upload, draw, upload, draw */
342a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusin#define PIPE_USAGE_STAGING        5 /* supports data transfers from the GPU to the CPU */
343244591ae7b2582a1d1f5d2fdc2d3812643104eb9José Fonseca
344756d52ec12c41ee90ee9598dc9028cc134806bd2Michel Dänzer
34594a4910c9a1ef48470f45c01c379254cb033119fBrian/**
346c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian * Shaders
347c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian */
348c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian#define PIPE_SHADER_VERTEX   0
349c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian#define PIPE_SHADER_FRAGMENT 1
35089d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_SHADER_GEOMETRY 2
35189d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_SHADER_TYPES    3
352c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian
353c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian
354c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian/**
35594a4910c9a1ef48470f45c01c379254cb033119fBrian * Primitive types:
35694a4910c9a1ef48470f45c01c379254cb033119fBrian */
35789d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_POINTS               0
35889d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINES                1
35989d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINE_LOOP            2
36089d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINE_STRIP           3
36189d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLES            4
36289d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLE_STRIP       5
36389d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLE_FAN         6
36489d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_QUADS                7
36589d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_QUAD_STRIP           8
36689d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_POLYGON              9
36789d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINES_ADJACENCY          10
36889d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_LINE_STRIP_ADJACENCY    11
36989d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLES_ADJACENCY      12
37089d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY 13
37189d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin#define PIPE_PRIM_MAX                      14
37294a4910c9a1ef48470f45c01c379254cb033119fBrian
37340a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell
37409fbb3837b6aa5dfc6c94f41ab5443820177c569Brian/**
37509fbb3837b6aa5dfc6c94f41ab5443820177c569Brian * Query object types
37609fbb3837b6aa5dfc6c94f41ab5443820177c569Brian */
37709fbb3837b6aa5dfc6c94f41ab5443820177c569Brian#define PIPE_QUERY_OCCLUSION_COUNTER     0
37809fbb3837b6aa5dfc6c94f41ab5443820177c569Brian#define PIPE_QUERY_PRIMITIVES_GENERATED  1
37909fbb3837b6aa5dfc6c94f41ab5443820177c569Brian#define PIPE_QUERY_PRIMITIVES_EMITTED    2
380cdbd5f4203391ee7eb12911bc86fea34dc61c957Mathias Fröhlich#define PIPE_QUERY_TIME_ELAPSED          3
381be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin#define PIPE_QUERY_SO_STATISTICS         5
382b6c360b46c2b2b1548e2aeaa1a1cd201dfcf82aeZack Rusin#define PIPE_QUERY_GPU_FINISHED          6
383e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin#define PIPE_QUERY_TIMESTAMP_DISJOINT    7
3840657fc00dd9e69f71d679d480b5d5f4c33cfae35Zack Rusin#define PIPE_QUERY_OCCLUSION_PREDICATE   8
3850657fc00dd9e69f71d679d480b5d5f4c33cfae35Zack Rusin#define PIPE_QUERY_TYPES                 9
38609fbb3837b6aa5dfc6c94f41ab5443820177c569Brian
38737cf13ed9a429c755f121daa1776b1b30a985ab3Brian
3881b4852345954af9b582b03a91a3d8399b8fb0e92Brian/**
389c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul * Conditional rendering modes
390c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul */
391c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul#define PIPE_RENDER_COND_WAIT              0
392c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul#define PIPE_RENDER_COND_NO_WAIT           1
393c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul#define PIPE_RENDER_COND_BY_REGION_WAIT    2
394c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul#define PIPE_RENDER_COND_BY_REGION_NO_WAIT 3
395c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul
396c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul
397c0b4fb06b8b570b1999a0849797d3cb77f6ee5cdBrian Paul/**
3981b4852345954af9b582b03a91a3d8399b8fb0e92Brian * Point sprite coord modes
3991b4852345954af9b582b03a91a3d8399b8fb0e92Brian */
4004a4daa75a85db22cd37ebd533ebbccb427e07077Roland Scheidegger#define PIPE_SPRITE_COORD_UPPER_LEFT 0
4014a4daa75a85db22cd37ebd533ebbccb427e07077Roland Scheidegger#define PIPE_SPRITE_COORD_LOWER_LEFT 1
4021b4852345954af9b582b03a91a3d8399b8fb0e92Brian
403c6499a741c99394e81d1d86ffd066f3d9749875cBrian
404c6499a741c99394e81d1d86ffd066f3d9749875cBrian/**
405f6106566081978f663cf08e54bb8908cb58a5316Michal Krol * Texture swizzles
406f6106566081978f663cf08e54bb8908cb58a5316Michal Krol */
407f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_RED   0
408f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_GREEN 1
409f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_BLUE  2
410f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_ALPHA 3
411f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_ZERO  4
412f6106566081978f663cf08e54bb8908cb58a5316Michal Krol#define PIPE_SWIZZLE_ONE   5
413f6106566081978f663cf08e54bb8908cb58a5316Michal Krol
414f6106566081978f663cf08e54bb8908cb58a5316Michal Krol
415b39bccbd4ed71e9585da4cf5acf7b887b2e90899Marek Olšák#define PIPE_TIMEOUT_INFINITE 0xffffffffffffffffull
416b39bccbd4ed71e9585da4cf5acf7b887b2e90899Marek Olšák
417f6106566081978f663cf08e54bb8908cb58a5316Michal Krol/**
418aebc08b5ccc6ac2a7c6673e93c63b097c7734e6dBrian Paul * Implementation capabilities/limits which are queried through
419aebc08b5ccc6ac2a7c6673e93c63b097c7734e6dBrian Paul * pipe_screen::get_param() and pipe_screen::get_paramf().
420c6499a741c99394e81d1d86ffd066f3d9749875cBrian */
421e1238b5cad3845c029f60d92c08e810274517d33José Fonsecaenum pipe_cap {
422167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_NPOT_TEXTURES = 1,
423167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TWO_SIDED_STENCIL = 2,
424167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_GLSL = 3,  /* XXX need something better */
425167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_DUAL_SOURCE_BLEND = 4,
426167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_ANISOTROPIC_FILTER = 5,
427167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_POINT_SPRITE = 6,
428167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_RENDER_TARGETS = 7,
429167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_OCCLUSION_QUERY = 8,
430167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TIMER_QUERY = 9,
431167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TEXTURE_SHADOW_MAP = 10,
432167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TEXTURE_SWIZZLE = 11,
433167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_TEXTURE_2D_LEVELS = 12,
434167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_TEXTURE_3D_LEVELS = 13,
435167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS = 14,
436167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_LINE_WIDTH = 15,
437167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_LINE_WIDTH_AA = 16,
438167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_POINT_WIDTH = 17,
439167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_POINT_WIDTH_AA = 18,
440167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_TEXTURE_ANISOTROPY = 19,
441167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_TEXTURE_LOD_BIAS = 20,
442167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_GUARD_BAND_LEFT = 21,  /*< float */
443167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_GUARD_BAND_TOP = 22,  /*< float */
444167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_GUARD_BAND_RIGHT = 23,  /*< float */
445167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_GUARD_BAND_BOTTOM = 24,  /*< float */
446167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TEXTURE_MIRROR_CLAMP = 25,
447167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_BLEND_EQUATION_SEPARATE = 28,
448167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_SM3 = 29,  /*< Shader Model, supported */
449167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_STREAM_OUTPUT = 30,
450167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_PRIMITIVE_RESTART = 31,
451e1238b5cad3845c029f60d92c08e810274517d33José Fonseca   /** Maximum texture image units accessible from vertex and fragment shaders
452e1238b5cad3845c029f60d92c08e810274517d33José Fonseca    * combined */
453167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_MAX_COMBINED_SAMPLERS = 32,
454e1238b5cad3845c029f60d92c08e810274517d33José Fonseca   /** blend enables and write masks per rendertarget */
455167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_INDEP_BLEND_ENABLE = 33,
456e1238b5cad3845c029f60d92c08e810274517d33José Fonseca   /** different blend funcs per rendertarget */
457167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_INDEP_BLEND_FUNC = 34,
458167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE = 35,
459379429137238e79296b8222c0e13d7d961910633Marek Olšák   PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS = 36,
460167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT = 37,
461167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT = 38,
462167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER = 39,
463167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER = 40,
464167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_DEPTH_CLAMP = 41,
465167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_SHADER_STENCIL_EXPORT = 42,
466167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_TGSI_INSTANCEID = 43,
467167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR = 44,
468167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL = 45,
46925f26997670302b07d48207b28f385f85f6af9bbMarek Olšák   PIPE_CAP_MIXED_COLORBUFFER_FORMATS = 46,
470a5f0a11477ae90f47f3adb59a93c5576dc8c7325Marek Olšák   PIPE_CAP_SEAMLESS_CUBE_MAP = 47,
471a5f0a11477ae90f47f3adb59a93c5576dc8c7325Marek Olšák   PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE = 48,
4720b666106c5f75b581ef1ebeb354c29a00400404fDave Airlie   PIPE_CAP_SCALED_RESOLVE = 49,
4730b666106c5f75b581ef1ebeb354c29a00400404fDave Airlie   PIPE_CAP_MIN_TEXEL_OFFSET = 50,
4743d13b081c72626acba6b9a25baec740c60dfafe1Marek Olšák   PIPE_CAP_MAX_TEXEL_OFFSET = 51,
475ba89086e79b22bd9578ea642846108de624c91e9Marek Olšák   PIPE_CAP_CONDITIONAL_RENDER = 52,
476ba89086e79b22bd9578ea642846108de624c91e9Marek Olšák   PIPE_CAP_TEXTURE_BARRIER = 53
477e1238b5cad3845c029f60d92c08e810274517d33José Fonseca};
478be66a8f43172327e3cdde27281e40377cacbb121Brian Paul
479a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579dLuca Barbieri/* Shader caps not specific to any single stage */
480a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579dLuca Barbierienum pipe_shader_cap
481a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579dLuca Barbieri{
482167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_INSTRUCTIONS = 0, /* if 0, it means the stage is unsupported */
483167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS = 1,
484167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS = 2,
485167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS = 3,
486167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH = 4,
487167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_INPUTS = 5,
488167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_CONSTS = 6,
489167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_CONST_BUFFERS = 7,
490167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_TEMPS = 8,
491167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_ADDRS = 9,
492167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_MAX_PREDS = 10,
493cbfdf262ccf8b573f1fa4c0065a8eb1fb87d93daMarek Olšák   /* boolean caps */
494167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED = 11,
495167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR = 12,
496167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR = 13,
497167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR = 14,
498167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_INDIRECT_CONST_ADDR = 15,
499167d35c303461dd5d126b7b11f7e6da4377b8b59Michel Dänzer   PIPE_SHADER_CAP_SUBROUTINES = 16, /* BGNSUB, ENDSUB, CAL, RET */
500f5bfe54a34d9c8cd5de2b096d0e8486fe0d990a7Marek Olšák   PIPE_SHADER_CAP_INTEGERS = 17,
501f5bfe54a34d9c8cd5de2b096d0e8486fe0d990a7Marek Olšák   PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS = 18
502a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579dLuca Barbieri};
50307aaf3a7a730d65052ec34a82cce9b373673b556Brian Paul
504f547472bfa0a797adacc2a7688b4c1ba65381a80Younes Manton
505be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin/**
506be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin * Composite query types
507be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin */
508be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusinstruct pipe_query_data_so_statistics
509be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin{
510be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin   uint64_t num_primitives_written;
511be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin   uint64_t primitives_storage_needed;
512be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin};
513e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusinstruct pipe_query_data_timestamp_disjoint
514e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin{
515e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin   uint64_t frequency;
516e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin   boolean  disjoint;
517e433b73dd256577b022bf38c8499c7ea4eda9845Zack Rusin};
518f547472bfa0a797adacc2a7688b4c1ba65381a80Younes Manton
5196dd284f7c8fac22f64c13fdf9909094f5ec59086Dave Airlieunion pipe_color_union
5206dd284f7c8fac22f64c13fdf9909094f5ec59086Dave Airlie{
5216dd284f7c8fac22f64c13fdf9909094f5ec59086Dave Airlie   float f[4];
5226dd284f7c8fac22f64c13fdf9909094f5ec59086Dave Airlie   int i[4];
5236dd284f7c8fac22f64c13fdf9909094f5ec59086Dave Airlie   unsigned int ui[4];
5246dd284f7c8fac22f64c13fdf9909094f5ec59086Dave Airlie};
5251218430e1200a08cd64b6555d3fd1fd0274ad9e5Thomas Balling Sørensen
526e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#ifdef __cplusplus
527e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca}
528e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#endif
529e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca
5307234550cf759fdf3ab325465090c7f5eb3b5d320Brian#endif
531