Home | History | Annotate | Download | only in pipe
      1 /**************************************************************************
      2  *
      3  * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
      4  * Copyright (c) 2008 VMware, Inc.
      5  * All Rights Reserved.
      6  *
      7  * Permission is hereby granted, free of charge, to any person obtaining a
      8  * copy of this software and associated documentation files (the
      9  * "Software"), to deal in the Software without restriction, including
     10  * without limitation the rights to use, copy, modify, merge, publish,
     11  * distribute, sub license, and/or sell copies of the Software, and to
     12  * permit persons to whom the Software is furnished to do so, subject to
     13  * the following conditions:
     14  *
     15  * The above copyright notice and this permission notice (including the
     16  * next paragraph) shall be included in all copies or substantial portions
     17  * of the Software.
     18  *
     19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
     20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
     22  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
     23  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
     24  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
     25  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     26  *
     27  **************************************************************************/
     28 
     29 #ifndef PIPE_FORMAT_H
     30 #define PIPE_FORMAT_H
     31 
     32 #ifdef __cplusplus
     33 extern "C" {
     34 #endif
     35 
     36 
     37 enum pipe_type {
     38    PIPE_TYPE_UNORM = 0,
     39    PIPE_TYPE_SNORM,
     40    PIPE_TYPE_SINT,
     41    PIPE_TYPE_UINT,
     42    PIPE_TYPE_FLOAT,
     43    PIPE_TYPE_COUNT
     44 };
     45 
     46 /**
     47  * Texture/surface image formats (preliminary)
     48  */
     49 
     50 /* KW: Added lots of surface formats to support vertex element layout
     51  * definitions, and eventually render-to-vertex-buffer.
     52  */
     53 
     54 enum pipe_format {
     55    PIPE_FORMAT_NONE                    = 0,
     56    PIPE_FORMAT_B8G8R8A8_UNORM          = 1,
     57    PIPE_FORMAT_B8G8R8X8_UNORM          = 2,
     58    PIPE_FORMAT_A8R8G8B8_UNORM          = 3,
     59    PIPE_FORMAT_X8R8G8B8_UNORM          = 4,
     60    PIPE_FORMAT_B5G5R5A1_UNORM          = 5,
     61    PIPE_FORMAT_B4G4R4A4_UNORM          = 6,
     62    PIPE_FORMAT_B5G6R5_UNORM            = 7,
     63    PIPE_FORMAT_R10G10B10A2_UNORM       = 8,
     64    PIPE_FORMAT_L8_UNORM                = 9,    /**< ubyte luminance */
     65    PIPE_FORMAT_A8_UNORM                = 10,   /**< ubyte alpha */
     66    PIPE_FORMAT_I8_UNORM                = 11,   /**< ubyte intensity */
     67    PIPE_FORMAT_L8A8_UNORM              = 12,   /**< ubyte alpha, luminance */
     68    PIPE_FORMAT_L16_UNORM               = 13,   /**< ushort luminance */
     69    PIPE_FORMAT_UYVY                    = 14,
     70    PIPE_FORMAT_YUYV                    = 15,
     71    PIPE_FORMAT_Z16_UNORM               = 16,
     72    PIPE_FORMAT_Z32_UNORM               = 17,
     73    PIPE_FORMAT_Z32_FLOAT               = 18,
     74    PIPE_FORMAT_Z24_UNORM_S8_UINT       = 19,
     75    PIPE_FORMAT_S8_UINT_Z24_UNORM       = 20,
     76    PIPE_FORMAT_Z24X8_UNORM             = 21,
     77    PIPE_FORMAT_X8Z24_UNORM             = 22,
     78    PIPE_FORMAT_S8_UINT                 = 23,   /**< ubyte stencil */
     79    PIPE_FORMAT_R64_FLOAT               = 24,
     80    PIPE_FORMAT_R64G64_FLOAT            = 25,
     81    PIPE_FORMAT_R64G64B64_FLOAT         = 26,
     82    PIPE_FORMAT_R64G64B64A64_FLOAT      = 27,
     83    PIPE_FORMAT_R32_FLOAT               = 28,
     84    PIPE_FORMAT_R32G32_FLOAT            = 29,
     85    PIPE_FORMAT_R32G32B32_FLOAT         = 30,
     86    PIPE_FORMAT_R32G32B32A32_FLOAT      = 31,
     87    PIPE_FORMAT_R32_UNORM               = 32,
     88    PIPE_FORMAT_R32G32_UNORM            = 33,
     89    PIPE_FORMAT_R32G32B32_UNORM         = 34,
     90    PIPE_FORMAT_R32G32B32A32_UNORM      = 35,
     91    PIPE_FORMAT_R32_USCALED             = 36,
     92    PIPE_FORMAT_R32G32_USCALED          = 37,
     93    PIPE_FORMAT_R32G32B32_USCALED       = 38,
     94    PIPE_FORMAT_R32G32B32A32_USCALED    = 39,
     95    PIPE_FORMAT_R32_SNORM               = 40,
     96    PIPE_FORMAT_R32G32_SNORM            = 41,
     97    PIPE_FORMAT_R32G32B32_SNORM         = 42,
     98    PIPE_FORMAT_R32G32B32A32_SNORM      = 43,
     99    PIPE_FORMAT_R32_SSCALED             = 44,
    100    PIPE_FORMAT_R32G32_SSCALED          = 45,
    101    PIPE_FORMAT_R32G32B32_SSCALED       = 46,
    102    PIPE_FORMAT_R32G32B32A32_SSCALED    = 47,
    103    PIPE_FORMAT_R16_UNORM               = 48,
    104    PIPE_FORMAT_R16G16_UNORM            = 49,
    105    PIPE_FORMAT_R16G16B16_UNORM         = 50,
    106    PIPE_FORMAT_R16G16B16A16_UNORM      = 51,
    107    PIPE_FORMAT_R16_USCALED             = 52,
    108    PIPE_FORMAT_R16G16_USCALED          = 53,
    109    PIPE_FORMAT_R16G16B16_USCALED       = 54,
    110    PIPE_FORMAT_R16G16B16A16_USCALED    = 55,
    111    PIPE_FORMAT_R16_SNORM               = 56,
    112    PIPE_FORMAT_R16G16_SNORM            = 57,
    113    PIPE_FORMAT_R16G16B16_SNORM         = 58,
    114    PIPE_FORMAT_R16G16B16A16_SNORM      = 59,
    115    PIPE_FORMAT_R16_SSCALED             = 60,
    116    PIPE_FORMAT_R16G16_SSCALED          = 61,
    117    PIPE_FORMAT_R16G16B16_SSCALED       = 62,
    118    PIPE_FORMAT_R16G16B16A16_SSCALED    = 63,
    119    PIPE_FORMAT_R8_UNORM                = 64,
    120    PIPE_FORMAT_R8G8_UNORM              = 65,
    121    PIPE_FORMAT_R8G8B8_UNORM            = 66,
    122    PIPE_FORMAT_R8G8B8A8_UNORM          = 67,
    123    PIPE_FORMAT_X8B8G8R8_UNORM          = 68,
    124    PIPE_FORMAT_R8_USCALED              = 69,
    125    PIPE_FORMAT_R8G8_USCALED            = 70,
    126    PIPE_FORMAT_R8G8B8_USCALED          = 71,
    127    PIPE_FORMAT_R8G8B8A8_USCALED        = 72,
    128    PIPE_FORMAT_R8_SNORM                = 74,
    129    PIPE_FORMAT_R8G8_SNORM              = 75,
    130    PIPE_FORMAT_R8G8B8_SNORM            = 76,
    131    PIPE_FORMAT_R8G8B8A8_SNORM          = 77,
    132    PIPE_FORMAT_R8_SSCALED              = 82,
    133    PIPE_FORMAT_R8G8_SSCALED            = 83,
    134    PIPE_FORMAT_R8G8B8_SSCALED          = 84,
    135    PIPE_FORMAT_R8G8B8A8_SSCALED        = 85,
    136    PIPE_FORMAT_R32_FIXED               = 87,
    137    PIPE_FORMAT_R32G32_FIXED            = 88,
    138    PIPE_FORMAT_R32G32B32_FIXED         = 89,
    139    PIPE_FORMAT_R32G32B32A32_FIXED      = 90,
    140    PIPE_FORMAT_R16_FLOAT               = 91,
    141    PIPE_FORMAT_R16G16_FLOAT            = 92,
    142    PIPE_FORMAT_R16G16B16_FLOAT         = 93,
    143    PIPE_FORMAT_R16G16B16A16_FLOAT      = 94,
    144 
    145    /* sRGB formats */
    146    PIPE_FORMAT_L8_SRGB                 = 95,
    147    PIPE_FORMAT_L8A8_SRGB               = 96,
    148    PIPE_FORMAT_R8G8B8_SRGB             = 97,
    149    PIPE_FORMAT_A8B8G8R8_SRGB           = 98,
    150    PIPE_FORMAT_X8B8G8R8_SRGB           = 99,
    151    PIPE_FORMAT_B8G8R8A8_SRGB           = 100,
    152    PIPE_FORMAT_B8G8R8X8_SRGB           = 101,
    153    PIPE_FORMAT_A8R8G8B8_SRGB           = 102,
    154    PIPE_FORMAT_X8R8G8B8_SRGB           = 103,
    155    PIPE_FORMAT_R8G8B8A8_SRGB           = 104,
    156 
    157    /* compressed formats */
    158    PIPE_FORMAT_DXT1_RGB                = 105,
    159    PIPE_FORMAT_DXT1_RGBA               = 106,
    160    PIPE_FORMAT_DXT3_RGBA               = 107,
    161    PIPE_FORMAT_DXT5_RGBA               = 108,
    162 
    163    /* sRGB, compressed */
    164    PIPE_FORMAT_DXT1_SRGB               = 109,
    165    PIPE_FORMAT_DXT1_SRGBA              = 110,
    166    PIPE_FORMAT_DXT3_SRGBA              = 111,
    167    PIPE_FORMAT_DXT5_SRGBA              = 112,
    168 
    169    /* rgtc compressed */
    170    PIPE_FORMAT_RGTC1_UNORM             = 113,
    171    PIPE_FORMAT_RGTC1_SNORM             = 114,
    172    PIPE_FORMAT_RGTC2_UNORM             = 115,
    173    PIPE_FORMAT_RGTC2_SNORM             = 116,
    174 
    175    PIPE_FORMAT_R8G8_B8G8_UNORM         = 117,
    176    PIPE_FORMAT_G8R8_G8B8_UNORM         = 118,
    177 
    178    /* mixed formats */
    179    PIPE_FORMAT_R8SG8SB8UX8U_NORM       = 119,
    180    PIPE_FORMAT_R5SG5SB6U_NORM          = 120,
    181 
    182    /* TODO: re-order these */
    183    PIPE_FORMAT_A8B8G8R8_UNORM          = 121,
    184    PIPE_FORMAT_B5G5R5X1_UNORM          = 122,
    185    PIPE_FORMAT_R10G10B10A2_USCALED     = 123,
    186    PIPE_FORMAT_R11G11B10_FLOAT         = 124,
    187    PIPE_FORMAT_R9G9B9E5_FLOAT          = 125,
    188    PIPE_FORMAT_Z32_FLOAT_S8X24_UINT    = 126,
    189    PIPE_FORMAT_R1_UNORM                = 127,
    190    PIPE_FORMAT_R10G10B10X2_USCALED     = 128,
    191    PIPE_FORMAT_R10G10B10X2_SNORM       = 129,
    192    PIPE_FORMAT_L4A4_UNORM              = 130,
    193    PIPE_FORMAT_B10G10R10A2_UNORM       = 131,
    194    PIPE_FORMAT_R10SG10SB10SA2U_NORM    = 132,
    195    PIPE_FORMAT_R8G8Bx_SNORM            = 133,
    196    PIPE_FORMAT_R8G8B8X8_UNORM          = 134,
    197    PIPE_FORMAT_B4G4R4X4_UNORM          = 135,
    198 
    199    /* some stencil samplers formats */
    200    PIPE_FORMAT_X24S8_UINT              = 136,
    201    PIPE_FORMAT_S8X24_UINT              = 137,
    202    PIPE_FORMAT_X32_S8X24_UINT          = 138,
    203 
    204    PIPE_FORMAT_B2G3R3_UNORM            = 139,
    205    PIPE_FORMAT_L16A16_UNORM            = 140,
    206    PIPE_FORMAT_A16_UNORM               = 141,
    207    PIPE_FORMAT_I16_UNORM               = 142,
    208 
    209    PIPE_FORMAT_LATC1_UNORM             = 143,
    210    PIPE_FORMAT_LATC1_SNORM             = 144,
    211    PIPE_FORMAT_LATC2_UNORM             = 145,
    212    PIPE_FORMAT_LATC2_SNORM             = 146,
    213 
    214    PIPE_FORMAT_A8_SNORM                = 147,
    215    PIPE_FORMAT_L8_SNORM                = 148,
    216    PIPE_FORMAT_L8A8_SNORM              = 149,
    217    PIPE_FORMAT_I8_SNORM                = 150,
    218    PIPE_FORMAT_A16_SNORM               = 151,
    219    PIPE_FORMAT_L16_SNORM               = 152,
    220    PIPE_FORMAT_L16A16_SNORM            = 153,
    221    PIPE_FORMAT_I16_SNORM               = 154,
    222 
    223    PIPE_FORMAT_A16_FLOAT               = 155,
    224    PIPE_FORMAT_L16_FLOAT               = 156,
    225    PIPE_FORMAT_L16A16_FLOAT            = 157,
    226    PIPE_FORMAT_I16_FLOAT               = 158,
    227    PIPE_FORMAT_A32_FLOAT               = 159,
    228    PIPE_FORMAT_L32_FLOAT               = 160,
    229    PIPE_FORMAT_L32A32_FLOAT            = 161,
    230    PIPE_FORMAT_I32_FLOAT               = 162,
    231 
    232    PIPE_FORMAT_YV12                    = 163,
    233    PIPE_FORMAT_YV16                    = 164,
    234    PIPE_FORMAT_IYUV                    = 165,  /**< aka I420 */
    235    PIPE_FORMAT_NV12                    = 166,
    236    PIPE_FORMAT_NV21                    = 167,
    237 
    238    PIPE_FORMAT_R4A4_UNORM              = 168,
    239    PIPE_FORMAT_A4R4_UNORM              = 169,
    240    PIPE_FORMAT_R8A8_UNORM              = 170,
    241    PIPE_FORMAT_A8R8_UNORM              = 171,
    242 
    243    PIPE_FORMAT_R10G10B10A2_SSCALED     = 172,
    244    PIPE_FORMAT_R10G10B10A2_SNORM       = 173,
    245 
    246    PIPE_FORMAT_B10G10R10A2_USCALED     = 174,
    247    PIPE_FORMAT_B10G10R10A2_SSCALED     = 175,
    248    PIPE_FORMAT_B10G10R10A2_SNORM       = 176,
    249 
    250    PIPE_FORMAT_R8_UINT                 = 177,
    251    PIPE_FORMAT_R8G8_UINT               = 178,
    252    PIPE_FORMAT_R8G8B8_UINT             = 179,
    253    PIPE_FORMAT_R8G8B8A8_UINT           = 180,
    254 
    255    PIPE_FORMAT_R8_SINT                 = 181,
    256    PIPE_FORMAT_R8G8_SINT               = 182,
    257    PIPE_FORMAT_R8G8B8_SINT             = 183,
    258    PIPE_FORMAT_R8G8B8A8_SINT           = 184,
    259 
    260    PIPE_FORMAT_R16_UINT                = 185,
    261    PIPE_FORMAT_R16G16_UINT             = 186,
    262    PIPE_FORMAT_R16G16B16_UINT          = 187,
    263    PIPE_FORMAT_R16G16B16A16_UINT       = 188,
    264 
    265    PIPE_FORMAT_R16_SINT                = 189,
    266    PIPE_FORMAT_R16G16_SINT             = 190,
    267    PIPE_FORMAT_R16G16B16_SINT          = 191,
    268    PIPE_FORMAT_R16G16B16A16_SINT       = 192,
    269 
    270    PIPE_FORMAT_R32_UINT                = 193,
    271    PIPE_FORMAT_R32G32_UINT             = 194,
    272    PIPE_FORMAT_R32G32B32_UINT          = 195,
    273    PIPE_FORMAT_R32G32B32A32_UINT       = 196,
    274 
    275    PIPE_FORMAT_R32_SINT                = 197,
    276    PIPE_FORMAT_R32G32_SINT             = 198,
    277    PIPE_FORMAT_R32G32B32_SINT          = 199,
    278    PIPE_FORMAT_R32G32B32A32_SINT       = 200,
    279 
    280    PIPE_FORMAT_A8_UINT                 = 201,
    281    PIPE_FORMAT_I8_UINT                 = 202,
    282    PIPE_FORMAT_L8_UINT                 = 203,
    283    PIPE_FORMAT_L8A8_UINT               = 204,
    284 
    285    PIPE_FORMAT_A8_SINT                 = 205,
    286    PIPE_FORMAT_I8_SINT                 = 206,
    287    PIPE_FORMAT_L8_SINT                 = 207,
    288    PIPE_FORMAT_L8A8_SINT               = 208,
    289 
    290    PIPE_FORMAT_A16_UINT                = 209,
    291    PIPE_FORMAT_I16_UINT                = 210,
    292    PIPE_FORMAT_L16_UINT                = 211,
    293    PIPE_FORMAT_L16A16_UINT             = 212,
    294 
    295    PIPE_FORMAT_A16_SINT                = 213,
    296    PIPE_FORMAT_I16_SINT                = 214,
    297    PIPE_FORMAT_L16_SINT                = 215,
    298    PIPE_FORMAT_L16A16_SINT             = 216,
    299 
    300    PIPE_FORMAT_A32_UINT                = 217,
    301    PIPE_FORMAT_I32_UINT                = 218,
    302    PIPE_FORMAT_L32_UINT                = 219,
    303    PIPE_FORMAT_L32A32_UINT             = 220,
    304 
    305    PIPE_FORMAT_A32_SINT                = 221,
    306    PIPE_FORMAT_I32_SINT                = 222,
    307    PIPE_FORMAT_L32_SINT                = 223,
    308    PIPE_FORMAT_L32A32_SINT             = 224,
    309 
    310    PIPE_FORMAT_B10G10R10A2_UINT        = 225,
    311 
    312    PIPE_FORMAT_ETC1_RGB8               = 226,
    313 
    314    PIPE_FORMAT_R8G8_R8B8_UNORM         = 227,
    315    PIPE_FORMAT_G8R8_B8R8_UNORM         = 228,
    316 
    317    PIPE_FORMAT_COUNT
    318 };
    319 
    320 enum pipe_video_chroma_format
    321 {
    322    PIPE_VIDEO_CHROMA_FORMAT_420,
    323    PIPE_VIDEO_CHROMA_FORMAT_422,
    324    PIPE_VIDEO_CHROMA_FORMAT_444
    325 };
    326 
    327 #ifdef __cplusplus
    328 }
    329 #endif
    330 
    331 #endif
    332