summaryrefslogtreecommitdiff
path: root/src/video_core/surface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/surface.h')
-rw-r--r--src/video_core/surface.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index 9510db2c8..826c5a3ad 100644
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -20,6 +20,7 @@ enum class PixelFormat {
20 ABGR8I, 20 ABGR8I,
21 ABGR8UI, 21 ABGR8UI,
22 B5G6R5U, 22 B5G6R5U,
23 R5G6B5U,
23 B5G5R5A1U, 24 B5G5R5A1U,
24 A2B10G10R10U, 25 A2B10G10R10U,
25 A2B10G10R10UI, 26 A2B10G10R10UI,
@@ -38,7 +39,8 @@ enum class PixelFormat {
38 DXT1, 39 DXT1,
39 DXT23, 40 DXT23,
40 DXT45, 41 DXT45,
41 DXN1, // This is also known as BC4 42 DXN1UNORM, // This is also known as BC4
43 DXN1SNORM,
42 DXN2UNORM, 44 DXN2UNORM,
43 DXN2SNORM, 45 DXN2SNORM,
44 BC7U, 46 BC7U,
@@ -144,6 +146,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
144 0, // ABGR8I 146 0, // ABGR8I
145 0, // ABGR8UI 147 0, // ABGR8UI
146 0, // B5G6R5U 148 0, // B5G6R5U
149 0, // R5G6B5U
147 0, // B5G5R5A1U 150 0, // B5G5R5A1U
148 0, // A2B10G10R10U 151 0, // A2B10G10R10U
149 0, // A2B10G10R10UI 152 0, // A2B10G10R10UI
@@ -162,7 +165,8 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
162 2, // DXT1 165 2, // DXT1
163 2, // DXT23 166 2, // DXT23
164 2, // DXT45 167 2, // DXT45
165 2, // DXN1 168 2, // DXN1UNORM
169 2, // DXN1SNORM
166 2, // DXN2UNORM 170 2, // DXN2UNORM
167 2, // DXN2SNORM 171 2, // DXN2SNORM
168 2, // BC7U 172 2, // BC7U
@@ -252,6 +256,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
252 1, // ABGR8I 256 1, // ABGR8I
253 1, // ABGR8UI 257 1, // ABGR8UI
254 1, // B5G6R5U 258 1, // B5G6R5U
259 1, // R5G6B5U
255 1, // B5G5R5A1U 260 1, // B5G5R5A1U
256 1, // A2B10G10R10U 261 1, // A2B10G10R10U
257 1, // A2B10G10R10UI 262 1, // A2B10G10R10UI
@@ -270,7 +275,8 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
270 4, // DXT1 275 4, // DXT1
271 4, // DXT23 276 4, // DXT23
272 4, // DXT45 277 4, // DXT45
273 4, // DXN1 278 4, // DXN1UNORM
279 4, // DXN1SNORM
274 4, // DXN2UNORM 280 4, // DXN2UNORM
275 4, // DXN2SNORM 281 4, // DXN2SNORM
276 4, // BC7U 282 4, // BC7U
@@ -352,6 +358,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
352 1, // ABGR8I 358 1, // ABGR8I
353 1, // ABGR8UI 359 1, // ABGR8UI
354 1, // B5G6R5U 360 1, // B5G6R5U
361 1, // R5G6B5U
355 1, // B5G5R5A1U 362 1, // B5G5R5A1U
356 1, // A2B10G10R10U 363 1, // A2B10G10R10U
357 1, // A2B10G10R10UI 364 1, // A2B10G10R10UI
@@ -370,7 +377,8 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
370 4, // DXT1 377 4, // DXT1
371 4, // DXT23 378 4, // DXT23
372 4, // DXT45 379 4, // DXT45
373 4, // DXN1 380 4, // DXN1UNORM
381 4, // DXN1SNORM
374 4, // DXN2UNORM 382 4, // DXN2UNORM
375 4, // DXN2SNORM 383 4, // DXN2SNORM
376 4, // BC7U 384 4, // BC7U
@@ -452,6 +460,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
452 32, // ABGR8I 460 32, // ABGR8I
453 32, // ABGR8UI 461 32, // ABGR8UI
454 16, // B5G6R5U 462 16, // B5G6R5U
463 16, // R5G6B5U
455 16, // B5G5R5A1U 464 16, // B5G5R5A1U
456 32, // A2B10G10R10U 465 32, // A2B10G10R10U
457 32, // A2B10G10R10UI 466 32, // A2B10G10R10UI
@@ -470,7 +479,8 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
470 64, // DXT1 479 64, // DXT1
471 128, // DXT23 480 128, // DXT23
472 128, // DXT45 481 128, // DXT45
473 64, // DXN1 482 64, // DXN1UNORM
483 64, // DXN1SNORM
474 128, // DXN2UNORM 484 128, // DXN2UNORM
475 128, // DXN2SNORM 485 128, // DXN2SNORM
476 128, // BC7U 486 128, // BC7U
@@ -574,7 +584,4 @@ bool IsPixelFormatSRGB(PixelFormat format);
574 584
575std::pair<u32, u32> GetASTCBlockSize(PixelFormat format); 585std::pair<u32, u32> GetASTCBlockSize(PixelFormat format);
576 586
577/// Returns true if the specified PixelFormat is a BCn format, e.g. DXT or DXN
578bool IsFormatBCn(PixelFormat format);
579
580} // namespace VideoCore::Surface 587} // namespace VideoCore::Surface