1 /****************************************************************************
2 * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 * @brief auto-generated file
29 ******************************************************************************/
33 #include "common/os.h"
35 //////////////////////////////////////////////////////////////////////////
36 /// SWR_TYPE - Format component type
37 //////////////////////////////////////////////////////////////////////////
52 //////////////////////////////////////////////////////////////////////////
54 //////////////////////////////////////////////////////////////////////////
57 R32G32B32A32_FLOAT
= 0x0,
58 R32G32B32A32_SINT
= 0x1,
59 R32G32B32A32_UINT
= 0x2,
60 R32G32B32X32_FLOAT
= 0x6,
61 R32G32B32A32_SSCALED
= 0x7,
62 R32G32B32A32_USCALED
= 0x8,
63 R32G32B32A32_SFIXED
= 0x20,
64 R32G32B32_FLOAT
= 0x40,
65 R32G32B32_SINT
= 0x41,
66 R32G32B32_UINT
= 0x42,
67 R32G32B32_SSCALED
= 0x45,
68 R32G32B32_USCALED
= 0x46,
69 R32G32B32_SFIXED
= 0x50,
70 R16G16B16A16_UNORM
= 0x80,
71 R16G16B16A16_SNORM
= 0x81,
72 R16G16B16A16_SINT
= 0x82,
73 R16G16B16A16_UINT
= 0x83,
74 R16G16B16A16_FLOAT
= 0x84,
78 R32_FLOAT_X8X24_TYPELESS
= 0x88,
79 X32_TYPELESS_G8X24_UINT
= 0x89,
81 R16G16B16X16_UNORM
= 0x8E,
82 R16G16B16X16_FLOAT
= 0x8F,
85 R16G16B16A16_SSCALED
= 0x93,
86 R16G16B16A16_USCALED
= 0x94,
87 R32G32_SSCALED
= 0x95,
88 R32G32_USCALED
= 0x96,
90 B8G8R8A8_UNORM
= 0xC0,
91 B8G8R8A8_UNORM_SRGB
= 0xC1,
92 R10G10B10A2_UNORM
= 0xC2,
93 R10G10B10A2_UNORM_SRGB
= 0xC3,
94 R10G10B10A2_UINT
= 0xC4,
95 R8G8B8A8_UNORM
= 0xC7,
96 R8G8B8A8_UNORM_SRGB
= 0xC8,
97 R8G8B8A8_SNORM
= 0xC9,
105 B10G10R10A2_UNORM
= 0xD1,
106 B10G10R10A2_UNORM_SRGB
= 0xD2,
107 R11G11B10_FLOAT
= 0xD3,
108 R10G10B10_FLOAT_A2_UNORM
= 0xD5,
112 R24_UNORM_X8_TYPELESS
= 0xD9,
113 X24_TYPELESS_G8_UINT
= 0xDA,
121 B8G8R8X8_UNORM
= 0xE9,
122 B8G8R8X8_UNORM_SRGB
= 0xEA,
123 R8G8B8X8_UNORM
= 0xEB,
124 R8G8B8X8_UNORM_SRGB
= 0xEC,
125 R9G9B9E5_SHAREDEXP
= 0xED,
126 B10G10R10X2_UNORM
= 0xEE,
128 R10G10B10X2_USCALED
= 0xF3,
129 R8G8B8A8_SSCALED
= 0xF4,
130 R8G8B8A8_USCALED
= 0xF5,
131 R16G16_SSCALED
= 0xF6,
132 R16G16_USCALED
= 0xF7,
135 B5G6R5_UNORM
= 0x100,
136 B5G6R5_UNORM_SRGB
= 0x101,
137 B5G5R5A1_UNORM
= 0x102,
138 B5G5R5A1_UNORM_SRGB
= 0x103,
139 B4G4R4A4_UNORM
= 0x104,
140 B4G4R4A4_UNORM_SRGB
= 0x105,
157 L8A8_UNORM_SRGB
= 0x118,
158 B5G5R5X1_UNORM
= 0x11A,
159 B5G5R5X1_UNORM_SRGB
= 0x11B,
160 R8G8_SSCALED
= 0x11C,
161 R8G8_USCALED
= 0x11D,
164 A1B5G5R5_UNORM
= 0x124,
165 A4B4G4R4_UNORM
= 0x125,
177 L8_UNORM_SRGB
= 0x14C,
182 YCRCB_SWAPUVY
= 0x183,
188 BC1_UNORM_SRGB
= 0x18B,
189 BC2_UNORM_SRGB
= 0x18C,
190 BC3_UNORM_SRGB
= 0x18D,
191 YCRCB_SWAPUV
= 0x18F,
192 R8G8B8_UNORM
= 0x193,
193 R8G8B8_SNORM
= 0x194,
194 R8G8B8_SSCALED
= 0x195,
195 R8G8B8_USCALED
= 0x196,
198 R16G16B16_FLOAT
= 0x19B,
199 R16G16B16_UNORM
= 0x19C,
200 R16G16B16_SNORM
= 0x19D,
201 R16G16B16_SSCALED
= 0x19E,
202 R16G16B16_USCALED
= 0x19F,
205 BC7_UNORM_SRGB
= 0x1A3,
207 R8G8B8_UNORM_SRGB
= 0x1A8,
208 R16G16B16_UINT
= 0x1B0,
209 R16G16B16_SINT
= 0x1B1,
211 R10G10B10A2_SNORM
= 0x1B3,
212 R10G10B10A2_USCALED
= 0x1B4,
213 R10G10B10A2_SSCALED
= 0x1B5,
214 R10G10B10A2_SINT
= 0x1B6,
215 B10G10R10A2_SNORM
= 0x1B7,
216 B10G10R10A2_USCALED
= 0x1B8,
217 B10G10R10A2_SSCALED
= 0x1B9,
218 B10G10R10A2_UINT
= 0x1BA,
219 B10G10R10A2_SINT
= 0x1BB,
223 NUM_SWR_FORMATS
= 0x200,
226 //////////////////////////////////////////////////////////////////////////
227 /// SWR_FORMAT_INFO - Format information
228 //////////////////////////////////////////////////////////////////////////
229 struct SWR_FORMAT_INFO
233 uint32_t defaults
[4];
234 uint32_t swizzle
[4]; ///< swizzle per component
235 uint32_t bpc
[4]; ///< bits per component
236 uint32_t bpp
; ///< bits per pixel
237 uint32_t Bpp
; ///< bytes per pixel
238 uint32_t numComps
; ///< number of components
243 bool isNormalized
[4];
249 extern const SWR_FORMAT_INFO gFormatInfo
[NUM_SWR_FORMATS
];
251 //////////////////////////////////////////////////////////////////////////
252 /// @brief Retrieves format info struct for given format.
253 /// @param format - SWR format
254 INLINE
const SWR_FORMAT_INFO
& GetFormatInfo(SWR_FORMAT format
)
256 SWR_ASSERT(format
< NUM_SWR_FORMATS
, "Invalid Surface Format: %d", format
);
257 SWR_ASSERT(gFormatInfo
[format
].name
!= nullptr, "Invalid Surface Format: %d", format
);
258 return gFormatInfo
[format
];
261 // lookup table for unorm8 srgb -> float conversion
262 extern const uint32_t srgb8Table
[256];