| 0.8.2 API documentation

- Main Page
- Namespaces
- Classes
- Files

- File List

dx.hpp
Go to the documentation of this file.
1
4 #pragma once
5
6 #include "format.hpp"
7 #include "target.hpp"
8 #include <array>
9
10 namespace gli
11 {
13 class dx
14 {
15 public:
16 #define GLI_MAKEFOURCC(ch0, ch1, ch2, ch3) \
17 (std::uint32_t)( \
18 (((std::uint32_t)(std::uint8_t)(ch3) << 24) & 0xFF000000) | \
19 (((std::uint32_t)(std::uint8_t)(ch2) << 16) & 0x00FF0000) | \
20 (((std::uint32_t)(std::uint8_t)(ch1) << 8) & 0x0000FF00) | \
21 ((std::uint32_t)(std::uint8_t)(ch0) & 0x000000FF) )
22
23 enum d3dfmt
24 {
25 D3DFMT_UNKNOWN = 0,
26
27 D3DFMT_R8G8B8 = 20,
28 D3DFMT_A8R8G8B8 = 21,
29 D3DFMT_X8R8G8B8 = 22,
30 D3DFMT_R5G6B5 = 23,
31 D3DFMT_X1R5G5B5 = 24,
32 D3DFMT_A1R5G5B5 = 25,
33 D3DFMT_A4R4G4B4 = 26,
34 D3DFMT_R3G3B2 = 27,
35 D3DFMT_A8 = 28,
36 D3DFMT_A8R3G3B2 = 29,
37 D3DFMT_X4R4G4B4 = 30,
38 D3DFMT_A2B10G10R10 = 31,
39 D3DFMT_A8B8G8R8 = 32,
40 D3DFMT_X8B8G8R8 = 33,
41 D3DFMT_G16R16 = 34,
42 D3DFMT_A2R10G10B10 = 35,
43 D3DFMT_A16B16G16R16 = 36,
44
45 D3DFMT_A8P8 = 40,
46 D3DFMT_P8 = 41,
47
48 D3DFMT_L8 = 50,
49 D3DFMT_A8L8 = 51,
50 D3DFMT_A4L4 = 52,
51
52 D3DFMT_V8U8 = 60,
53 D3DFMT_L6V5U5 = 61,
54 D3DFMT_X8L8V8U8 = 62,
55 D3DFMT_Q8W8V8U8 = 63,
56 D3DFMT_V16U16 = 64,
57 D3DFMT_A2W10V10U10 = 67,
58
59 D3DFMT_UYVY = GLI_MAKEFOURCC('U', 'Y', 'V', 'Y'),
60 D3DFMT_R8G8_B8G8 = GLI_MAKEFOURCC('R', 'G', 'B', 'G'),
61 D3DFMT_YUY2 = GLI_MAKEFOURCC('Y', 'U', 'Y', '2'),
62 D3DFMT_G8R8_G8B8 = GLI_MAKEFOURCC('G', 'R', 'G', 'B'),
63 D3DFMT_DXT1 = GLI_MAKEFOURCC('D', 'X', 'T', '1'),
64 D3DFMT_DXT2 = GLI_MAKEFOURCC('D', 'X', 'T', '2'),
65 D3DFMT_DXT3 = GLI_MAKEFOURCC('D', 'X', 'T', '3'),
66 D3DFMT_DXT4 = GLI_MAKEFOURCC('D', 'X', 'T', '4'),
67 D3DFMT_DXT5 = GLI_MAKEFOURCC('D', 'X', 'T', '5'),
68
69 D3DFMT_ATI1 = GLI_MAKEFOURCC('A', 'T', 'I', '1'),
70 D3DFMT_AT1N = GLI_MAKEFOURCC('A', 'T', '1', 'N'),
71 D3DFMT_ATI2 = GLI_MAKEFOURCC('A', 'T', 'I', '2'),
72 D3DFMT_AT2N = GLI_MAKEFOURCC('A', 'T', '2', 'N'),
73
74 D3DFMT_BC4U = GLI_MAKEFOURCC('B', 'C', '4', 'U'),
75 D3DFMT_BC4S = GLI_MAKEFOURCC('B', 'C', '4', 'S'),
76 D3DFMT_BC5U = GLI_MAKEFOURCC('B', 'C', '5', 'U'),
77 D3DFMT_BC5S = GLI_MAKEFOURCC('B', 'C', '5', 'S'),
78
79 D3DFMT_ETC = GLI_MAKEFOURCC('E', 'T', 'C', ' '),
80 D3DFMT_ETC1 = GLI_MAKEFOURCC('E', 'T', 'C', '1'),
81 D3DFMT_ATC = GLI_MAKEFOURCC('A', 'T', 'C', ' '),
82 D3DFMT_ATCA = GLI_MAKEFOURCC('A', 'T', 'C', 'A'),
83 D3DFMT_ATCI = GLI_MAKEFOURCC('A', 'T', 'C', 'I'),
84
85 D3DFMT_POWERVR_2BPP = GLI_MAKEFOURCC('P', 'T', 'C', '2'),
86 D3DFMT_POWERVR_4BPP = GLI_MAKEFOURCC('P', 'T', 'C', '4'),
87
88 D3DFMT_D16_LOCKABLE = 70,
89 D3DFMT_D32 = 71,
90 D3DFMT_D15S1 = 73,
91 D3DFMT_D24S8 = 75,
92 D3DFMT_D24X8 = 77,
93 D3DFMT_D24X4S4 = 79,
94 D3DFMT_D16 = 80,
95
96 D3DFMT_D32F_LOCKABLE = 82,
97 D3DFMT_D24FS8 = 83,
98
99 D3DFMT_L16 = 81,
100
101 D3DFMT_VERTEXDATA = 100,
102 D3DFMT_INDEX16 = 101,
103 D3DFMT_INDEX32 = 102,
104
105 D3DFMT_Q16W16V16U16 = 110,
106
107 D3DFMT_MULTI2_ARGB8 = GLI_MAKEFOURCC('M','E','T','1'),
108
109 D3DFMT_R16F = 111,
110 D3DFMT_G16R16F = 112,
111 D3DFMT_A16B16G16R16F = 113,
112
113 D3DFMT_R32F = 114,
114 D3DFMT_G32R32F = 115,
115 D3DFMT_A32B32G32R32F = 116,
116
117 D3DFMT_CxV8U8 = 117,
118
119 D3DFMT_DX10 = GLI_MAKEFOURCC('D', 'X', '1', '0'),
120
121 D3DFMT_GLI1 = GLI_MAKEFOURCC('G', 'L', 'I', '1'),
122
123 D3DFMT_FORCE_DWORD = 0x7fffffff
124 };
125
126 enum dxgi_format_dds
127 {
128 DXGI_FORMAT_UNKNOWN = 0,
129 DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
130 DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
131 DXGI_FORMAT_R32G32B32A32_UINT = 3,
132 DXGI_FORMAT_R32G32B32A32_SINT = 4,
133 DXGI_FORMAT_R32G32B32_TYPELESS = 5,
134 DXGI_FORMAT_R32G32B32_FLOAT = 6,
135 DXGI_FORMAT_R32G32B32_UINT = 7,
136 DXGI_FORMAT_R32G32B32_SINT = 8,
137 DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
138 DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
139 DXGI_FORMAT_R16G16B16A16_UNORM = 11,
140 DXGI_FORMAT_R16G16B16A16_UINT = 12,
141 DXGI_FORMAT_R16G16B16A16_SNORM = 13,
142 DXGI_FORMAT_R16G16B16A16_SINT = 14,
143 DXGI_FORMAT_R32G32_TYPELESS = 15,
144 DXGI_FORMAT_R32G32_FLOAT = 16,
145 DXGI_FORMAT_R32G32_UINT = 17,
146 DXGI_FORMAT_R32G32_SINT = 18,
147 DXGI_FORMAT_R32G8X24_TYPELESS = 19,
148 DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
149 DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
150 DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
151 DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
152 DXGI_FORMAT_R10G10B10A2_UNORM = 24,
153 DXGI_FORMAT_R10G10B10A2_UINT = 25,
154 DXGI_FORMAT_R11G11B10_FLOAT = 26,
155 DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
156 DXGI_FORMAT_R8G8B8A8_UNORM = 28,
157 DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
158 DXGI_FORMAT_R8G8B8A8_UINT = 30,
159 DXGI_FORMAT_R8G8B8A8_SNORM = 31,
160 DXGI_FORMAT_R8G8B8A8_SINT = 32,
161 DXGI_FORMAT_R16G16_TYPELESS = 33,
162 DXGI_FORMAT_R16G16_FLOAT = 34,
163 DXGI_FORMAT_R16G16_UNORM = 35,
164 DXGI_FORMAT_R16G16_UINT = 36,
165 DXGI_FORMAT_R16G16_SNORM = 37,
166 DXGI_FORMAT_R16G16_SINT = 38,
167 DXGI_FORMAT_R32_TYPELESS = 39,
168 DXGI_FORMAT_D32_FLOAT = 40,
169 DXGI_FORMAT_R32_FLOAT = 41,
170 DXGI_FORMAT_R32_UINT = 42,
171 DXGI_FORMAT_R32_SINT = 43,
172 DXGI_FORMAT_R24G8_TYPELESS = 44,
173 DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
174 DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
175 DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
176 DXGI_FORMAT_R8G8_TYPELESS = 48,
177 DXGI_FORMAT_R8G8_UNORM = 49,
178 DXGI_FORMAT_R8G8_UINT = 50,
179 DXGI_FORMAT_R8G8_SNORM = 51,
180 DXGI_FORMAT_R8G8_SINT = 52,
181 DXGI_FORMAT_R16_TYPELESS = 53,
182 DXGI_FORMAT_R16_FLOAT = 54,
183 DXGI_FORMAT_D16_UNORM = 55,
184 DXGI_FORMAT_R16_UNORM = 56,
185 DXGI_FORMAT_R16_UINT = 57,
186 DXGI_FORMAT_R16_SNORM = 58,
187 DXGI_FORMAT_R16_SINT = 59,
188 DXGI_FORMAT_R8_TYPELESS = 60,
189 DXGI_FORMAT_R8_UNORM = 61,
190 DXGI_FORMAT_R8_UINT = 62,
191 DXGI_FORMAT_R8_SNORM = 63,
192 DXGI_FORMAT_R8_SINT = 64,
193 DXGI_FORMAT_A8_UNORM = 65,
194 DXGI_FORMAT_R1_UNORM = 66,
195 DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
196 DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
197 DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
198 DXGI_FORMAT_BC1_TYPELESS = 70,
199 DXGI_FORMAT_BC1_UNORM = 71,
200 DXGI_FORMAT_BC1_UNORM_SRGB = 72,
201 DXGI_FORMAT_BC2_TYPELESS = 73,
202 DXGI_FORMAT_BC2_UNORM = 74,
203 DXGI_FORMAT_BC2_UNORM_SRGB = 75,
204 DXGI_FORMAT_BC3_TYPELESS = 76,
205 DXGI_FORMAT_BC3_UNORM = 77,
206 DXGI_FORMAT_BC3_UNORM_SRGB = 78,
207 DXGI_FORMAT_BC4_TYPELESS = 79,
208 DXGI_FORMAT_BC4_UNORM = 80,
209 DXGI_FORMAT_BC4_SNORM = 81,
210 DXGI_FORMAT_BC5_TYPELESS = 82,
211 DXGI_FORMAT_BC5_UNORM = 83,
212 DXGI_FORMAT_BC5_SNORM = 84,
213 DXGI_FORMAT_B5G6R5_UNORM = 85,
214 DXGI_FORMAT_B5G5R5A1_UNORM = 86,
215 DXGI_FORMAT_B8G8R8A8_UNORM = 87,
216 DXGI_FORMAT_B8G8R8X8_UNORM = 88,
217 DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
218 DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
219 DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
220 DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
221 DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
222 DXGI_FORMAT_BC6H_TYPELESS = 94,
223 DXGI_FORMAT_BC6H_UF16 = 95,
224 DXGI_FORMAT_BC6H_SF16 = 96,
225 DXGI_FORMAT_BC7_TYPELESS = 97,
226 DXGI_FORMAT_BC7_UNORM = 98,
227 DXGI_FORMAT_BC7_UNORM_SRGB = 99,
228 DXGI_FORMAT_AYUV = 100,
229 DXGI_FORMAT_Y410 = 101,
230 DXGI_FORMAT_Y416 = 102,
231 DXGI_FORMAT_NV12 = 103,
232 DXGI_FORMAT_P010 = 104,
233 DXGI_FORMAT_P016 = 105,
234 DXGI_FORMAT_420_OPAQUE = 106,
235 DXGI_FORMAT_YUY2 = 107,
236 DXGI_FORMAT_Y210 = 108,
237 DXGI_FORMAT_Y216 = 109,
238 DXGI_FORMAT_NV11 = 110,
239 DXGI_FORMAT_AI44 = 111,
240 DXGI_FORMAT_IA44 = 112,
241 DXGI_FORMAT_P8 = 113,
242 DXGI_FORMAT_A8P8 = 114,
243 DXGI_FORMAT_B4G4R4A4_UNORM = 115,
244
245 DXGI_FORMAT_P208 = 130,
246 DXGI_FORMAT_V208 = 131,
247 DXGI_FORMAT_V408 = 132,
248 DXGI_FORMAT_ASTC_4X4_TYPELESS = 133,
249 DXGI_FORMAT_ASTC_4X4_UNORM = 134,
250 DXGI_FORMAT_ASTC_4X4_UNORM_SRGB = 135,
251 DXGI_FORMAT_ASTC_5X4_TYPELESS = 137,
252 DXGI_FORMAT_ASTC_5X4_UNORM = 138,
253 DXGI_FORMAT_ASTC_5X4_UNORM_SRGB = 139,
254 DXGI_FORMAT_ASTC_5X5_TYPELESS = 141,
255 DXGI_FORMAT_ASTC_5X5_UNORM = 142,
256 DXGI_FORMAT_ASTC_5X5_UNORM_SRGB = 143,
257 DXGI_FORMAT_ASTC_6X5_TYPELESS = 145,
258 DXGI_FORMAT_ASTC_6X5_UNORM = 146,
259 DXGI_FORMAT_ASTC_6X5_UNORM_SRGB = 147,
260 DXGI_FORMAT_ASTC_6X6_TYPELESS = 149,
261 DXGI_FORMAT_ASTC_6X6_UNORM = 150,
262 DXGI_FORMAT_ASTC_6X6_UNORM_SRGB = 151,
263 DXGI_FORMAT_ASTC_8X5_TYPELESS = 153,
264 DXGI_FORMAT_ASTC_8X5_UNORM = 154,
265 DXGI_FORMAT_ASTC_8X5_UNORM_SRGB = 155,
266 DXGI_FORMAT_ASTC_8X6_TYPELESS = 157,
267 DXGI_FORMAT_ASTC_8X6_UNORM = 158,
268 DXGI_FORMAT_ASTC_8X6_UNORM_SRGB = 159,
269 DXGI_FORMAT_ASTC_8X8_TYPELESS = 161,
270 DXGI_FORMAT_ASTC_8X8_UNORM = 162,
271 DXGI_FORMAT_ASTC_8X8_UNORM_SRGB = 163,
272 DXGI_FORMAT_ASTC_10X5_TYPELESS = 165,
273 DXGI_FORMAT_ASTC_10X5_UNORM = 166,
274 DXGI_FORMAT_ASTC_10X5_UNORM_SRGB = 167,
275 DXGI_FORMAT_ASTC_10X6_TYPELESS = 169,
276 DXGI_FORMAT_ASTC_10X6_UNORM = 170,
277 DXGI_FORMAT_ASTC_10X6_UNORM_SRGB = 171,
278 DXGI_FORMAT_ASTC_10X8_TYPELESS = 173,
279 DXGI_FORMAT_ASTC_10X8_UNORM = 174,
280 DXGI_FORMAT_ASTC_10X8_UNORM_SRGB = 175,
281 DXGI_FORMAT_ASTC_10X10_TYPELESS = 177,
282 DXGI_FORMAT_ASTC_10X10_UNORM = 178,
283 DXGI_FORMAT_ASTC_10X10_UNORM_SRGB = 179,
284 DXGI_FORMAT_ASTC_12X10_TYPELESS = 181,
285 DXGI_FORMAT_ASTC_12X10_UNORM = 182,
286 DXGI_FORMAT_ASTC_12X10_UNORM_SRGB = 183,
287 DXGI_FORMAT_ASTC_12X12_TYPELESS = 185,
288 DXGI_FORMAT_ASTC_12X12_UNORM = 186,
289 DXGI_FORMAT_ASTC_12X12_UNORM_SRGB = 187,
290
291 DXGI_FORMAT_FORCE_UINT = 0xffffffffUL
292 };
293
294 enum dxgi_format_gli
295 {
296 DXGI_FORMAT_R64_UINT_GLI = 1,
297 DXGI_FORMAT_R64_SINT_GLI,
298 DXGI_FORMAT_R64_FLOAT_GLI,
299 DXGI_FORMAT_R64G64_UINT_GLI,
300 DXGI_FORMAT_R64G64_SINT_GLI,
301 DXGI_FORMAT_R64G64_FLOAT_GLI,
302 DXGI_FORMAT_R64G64B64_UINT_GLI,
303 DXGI_FORMAT_R64G64B64_SINT_GLI,
304 DXGI_FORMAT_R64G64B64_FLOAT_GLI,
305 DXGI_FORMAT_R64G64B64A64_UINT_GLI,
306 DXGI_FORMAT_R64G64B64A64_SINT_GLI,
307 DXGI_FORMAT_R64G64B64A64_FLOAT_GLI,
308
309 DXGI_FORMAT_RG4_UNORM_GLI,
310 DXGI_FORMAT_RGBA4_UNORM_GLI,
311 DXGI_FORMAT_R5G6B5_UNORM_GLI,
312 DXGI_FORMAT_R5G5B5A1_UNORM_GLI,
313 DXGI_FORMAT_A1B5G5R5_UNORM_GLI,
314
315 DXGI_FORMAT_R8_SRGB_GLI,
316 DXGI_FORMAT_R8_USCALED_GLI,
317 DXGI_FORMAT_R8_SSCALED_GLI,
318
319 DXGI_FORMAT_R8G8_SRGB_GLI,
320 DXGI_FORMAT_R8G8_USCALED_GLI,
321 DXGI_FORMAT_R8G8_SSCALED_GLI,
322
323 DXGI_FORMAT_R8G8B8_UNORM_GLI,
324 DXGI_FORMAT_R8G8B8_SNORM_GLI,
325 DXGI_FORMAT_R8G8B8_USCALED_GLI,
326 DXGI_FORMAT_R8G8B8_SSCALED_GLI,
327 DXGI_FORMAT_R8G8B8_UINT_GLI,
328 DXGI_FORMAT_R8G8B8_SINT_GLI,
329 DXGI_FORMAT_R8G8B8_SRGB_GLI,
330
331 DXGI_FORMAT_B8G8R8_UNORM_GLI,
332 DXGI_FORMAT_B8G8R8_SNORM_GLI,
333 DXGI_FORMAT_B8G8R8_USCALED_GLI,
334 DXGI_FORMAT_B8G8R8_SSCALED_GLI,
335 DXGI_FORMAT_B8G8R8_UINT_GLI,
336 DXGI_FORMAT_B8G8R8_SINT_GLI,
337 DXGI_FORMAT_B8G8R8_SRGB_GLI,
338
339 DXGI_FORMAT_R8G8B8A8_USCALED_GLI,
340 DXGI_FORMAT_R8G8B8A8_SSCALED_GLI,
341
342 DXGI_FORMAT_B8G8R8A8_SNORM_GLI,
343 DXGI_FORMAT_B8G8R8A8_USCALED_GLI,
344 DXGI_FORMAT_B8G8R8A8_SSCALED_GLI,
345 DXGI_FORMAT_B8G8R8A8_UINT_GLI,
346 DXGI_FORMAT_B8G8R8A8_SINT_GLI,
347
348 DXGI_FORMAT_R8G8B8A8_PACK_UNORM_GLI,
349 DXGI_FORMAT_R8G8B8A8_PACK_SNORM_GLI,
350 DXGI_FORMAT_R8G8B8A8_PACK_USCALED_GLI,
351 DXGI_FORMAT_R8G8B8A8_PACK_SSCALED_GLI,
352 DXGI_FORMAT_R8G8B8A8_PACK_UINT_GLI,
353 DXGI_FORMAT_R8G8B8A8_PACK_SINT_GLI,
354 DXGI_FORMAT_R8G8B8A8_PACK_SRGB_GLI,
355
356 DXGI_FORMAT_R10G10B10A2_SNORM_GLI,
357 DXGI_FORMAT_R10G10B10A2_USCALED_GLI,
358 DXGI_FORMAT_R10G10B10A2_SSCALED_GLI,
359 DXGI_FORMAT_R10G10B10A2_SINT_GLI,
360
361 DXGI_FORMAT_B10G10R10A2_UNORM_GLI,
362 DXGI_FORMAT_B10G10R10A2_SNORM_GLI,
363 DXGI_FORMAT_B10G10R10A2_USCALED_GLI,
364 DXGI_FORMAT_B10G10R10A2_SSCALED_GLI,
365 DXGI_FORMAT_B10G10R10A2_UINT_GLI,
366 DXGI_FORMAT_B10G10R10A2_SINT_GLI,
367
368 DXGI_FORMAT_R16_USCALED_GLI,
369 DXGI_FORMAT_R16_SSCALED_GLI,
370 DXGI_FORMAT_R16G16_USCALED_GLI,
371 DXGI_FORMAT_R16G16_SSCALED_GLI,
372
373 DXGI_FORMAT_R16G16B16_UNORM_GLI,
374 DXGI_FORMAT_R16G16B16_SNORM_GLI,
375 DXGI_FORMAT_R16G16B16_USCALED_GLI,
376 DXGI_FORMAT_R16G16B16_SSCALED_GLI,
377 DXGI_FORMAT_R16G16B16_UINT_GLI,
378 DXGI_FORMAT_R16G16B16_SINT_GLI,
379 DXGI_FORMAT_R16G16B16_FLOAT_GLI,
380
381 DXGI_FORMAT_R16G16B16A16_USCALED_GLI,
382 DXGI_FORMAT_R16G16B16A16_SSCALED_GLI,
383
384 DXGI_FORMAT_S8_UINT_GLI,
385 DXGI_FORMAT_D16_UNORM_S8_UINT_GLI,
386 DXGI_FORMAT_D24_UNORM_GLI,
387
388 DXGI_FORMAT_L8_UNORM_GLI,
389 DXGI_FORMAT_A8_UNORM_GLI,
390 DXGI_FORMAT_LA8_UNORM_GLI,
391 DXGI_FORMAT_L16_UNORM_GLI,
392 DXGI_FORMAT_A16_UNORM_GLI,
393 DXGI_FORMAT_LA16_UNORM_GLI,
394
395 DXGI_FORMAT_R3G3B2_UNORM_GLI,
396
397 DXGI_FORMAT_BC1_RGB_UNORM_GLI,
398 DXGI_FORMAT_BC1_RGB_SRGB_GLI,
399 DXGI_FORMAT_RGB_ETC2_UNORM_GLI,
400 DXGI_FORMAT_RGB_ETC2_SRGB_GLI,
401 DXGI_FORMAT_RGBA_ETC2_A1_UNORM_GLI,
402 DXGI_FORMAT_RGBA_ETC2_A1_SRGB_GLI,
403 DXGI_FORMAT_RGBA_ETC2_UNORM_GLI,
404 DXGI_FORMAT_RGBA_ETC2_SRGB_GLI,
405 DXGI_FORMAT_R11_EAC_UNORM_GLI,
406 DXGI_FORMAT_R11_EAC_SNORM_GLI,
407 DXGI_FORMAT_RG11_EAC_UNORM_GLI,
408 DXGI_FORMAT_RG11_EAC_SNORM_GLI,
409
410 DXGI_FORMAT_RGB_PVRTC1_8X8_UNORM_GLI,
411 DXGI_FORMAT_RGB_PVRTC1_8X8_SRGB_GLI,
412 DXGI_FORMAT_RGB_PVRTC1_16X8_UNORM_GLI,
413 DXGI_FORMAT_RGB_PVRTC1_16X8_SRGB_GLI,
414 DXGI_FORMAT_RGBA_PVRTC1_8X8_UNORM_GLI,
415 DXGI_FORMAT_RGBA_PVRTC1_8X8_SRGB_GLI,
416 DXGI_FORMAT_RGBA_PVRTC1_16X8_UNORM_GLI,
417 DXGI_FORMAT_RGBA_PVRTC1_16X8_SRGB_GLI,
418 DXGI_FORMAT_RGBA_PVRTC2_8X8_UNORM_GLI,
419 DXGI_FORMAT_RGBA_PVRTC2_8X8_SRGB_GLI,
420 DXGI_FORMAT_RGBA_PVRTC2_16X8_UNORM_GLI,
421 DXGI_FORMAT_RGBA_PVRTC2_16X8_SRGB_GLI,
422
423 DXGI_FORMAT_RGB_ETC_UNORM_GLI,
424 DXGI_FORMAT_RGB_ATC_UNORM_GLI,
425 DXGI_FORMAT_RGBA_ATCA_UNORM_GLI,
426 DXGI_FORMAT_RGBA_ATCI_UNORM_GLI,
427 };
428
429 union dxgiFormat
430 {
431 dxgiFormat()
432 : DDS(DXGI_FORMAT_UNKNOWN)
433 {}
434
435 dxgiFormat(dxgi_format_dds DDS)
436 : DDS(DDS)
437 {}
438
439 dxgiFormat(dxgi_format_gli GLI)
440 : GLI(GLI)
441 {}
442
443 dxgi_format_dds DDS;
444 dxgi_format_gli GLI;
445 };
446
447 enum ddpf
448 {
449 DDPF_ALPHAPIXELS = 0x1,
450 DDPF_ALPHA = 0x2,
451 DDPF_FOURCC = 0x4,
452 DDPF_RGB = 0x40,
453 DDPF_YUV = 0x200,
454 DDPF_LUMINANCE = 0x20000,
455 DDPF_LUMINANCE_ALPHA = DDPF_LUMINANCE | DDPF_ALPHA,
456 DDPF_RGBAPIXELS = DDPF_RGB | DDPF_ALPHAPIXELS,
457 DDPF_RGBA = DDPF_RGB | DDPF_ALPHA,
458 DDPF_LUMINANCE_ALPHAPIXELS = DDPF_LUMINANCE | DDPF_ALPHAPIXELS,
459
460 };
461
462 struct format
463 {
464 ddpf DDPixelFormat;
465 d3dfmt D3DFormat;
466 dxgiFormat DXGIFormat;
467 glm::u32vec4 Mask;
468 };
469
470 public:
471 dx();
472
474 format const& translate(gli::format Format) const;
475
477 gli::format find(d3dfmt FourCC) const;
478
480 gli::format find(d3dfmt FourCC, dxgiFormat Format) const;
481
482 private:
483 std::array<format, FORMAT_COUNT> Translation;
484 };
485
487 bool is_dds_ext(target Target, format Format);
488 }//namespace gli
489
490 #include "./core/dx.inl"
gli::format
format
Texture data format.
Definition: format.hpp:12
gli::dx
Translation class to convert GLI enums into DirectX enums.
Definition: dx.hpp:13
gli::dx::find
gli::format find(d3dfmt FourCC) const
Convert a Direct3D 9 format into a GLI format.
target.hpp
Include to use the target enum and query properties of targets.
gli::dx::translate
format const & translate(gli::format Format) const
Convert GLI formats into Direct3D formats.
gli::target
target
Texture target: type/shape of the texture storage_linear.
Definition: target.hpp:9
gli
Namespace where all the classes and functions provided by GLI are exposed.
Definition: clear.hpp:6
format.hpp
Include to use the format enum and query properties of formats.
gli::is_dds_ext
bool is_dds_ext(target Target, format Format)
Evaluate whether a target and format combinaison is only supported by the DDS container through GLI D...