From eda37ff26b5c0a8b9f4e6237dbf8ace8ef82e042 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 1 Jul 2020 01:18:43 -0300 Subject: video_core: Fix DXT4 and RGB565 --- src/video_core/surface.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/video_core/surface.h') 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 { ABGR8I, ABGR8UI, B5G6R5U, + R5G6B5U, B5G5R5A1U, A2B10G10R10U, A2B10G10R10UI, @@ -38,7 +39,8 @@ enum class PixelFormat { DXT1, DXT23, DXT45, - DXN1, // This is also known as BC4 + DXN1UNORM, // This is also known as BC4 + DXN1SNORM, DXN2UNORM, DXN2SNORM, BC7U, @@ -144,6 +146,7 @@ constexpr std::array compression_factor_shift_table = {{ 0, // ABGR8I 0, // ABGR8UI 0, // B5G6R5U + 0, // R5G6B5U 0, // B5G5R5A1U 0, // A2B10G10R10U 0, // A2B10G10R10UI @@ -162,7 +165,8 @@ constexpr std::array compression_factor_shift_table = {{ 2, // DXT1 2, // DXT23 2, // DXT45 - 2, // DXN1 + 2, // DXN1UNORM + 2, // DXN1SNORM 2, // DXN2UNORM 2, // DXN2SNORM 2, // BC7U @@ -252,6 +256,7 @@ constexpr std::array block_width_table = {{ 1, // ABGR8I 1, // ABGR8UI 1, // B5G6R5U + 1, // R5G6B5U 1, // B5G5R5A1U 1, // A2B10G10R10U 1, // A2B10G10R10UI @@ -270,7 +275,8 @@ constexpr std::array block_width_table = {{ 4, // DXT1 4, // DXT23 4, // DXT45 - 4, // DXN1 + 4, // DXN1UNORM + 4, // DXN1SNORM 4, // DXN2UNORM 4, // DXN2SNORM 4, // BC7U @@ -352,6 +358,7 @@ constexpr std::array block_height_table = {{ 1, // ABGR8I 1, // ABGR8UI 1, // B5G6R5U + 1, // R5G6B5U 1, // B5G5R5A1U 1, // A2B10G10R10U 1, // A2B10G10R10UI @@ -370,7 +377,8 @@ constexpr std::array block_height_table = {{ 4, // DXT1 4, // DXT23 4, // DXT45 - 4, // DXN1 + 4, // DXN1UNORM + 4, // DXN1SNORM 4, // DXN2UNORM 4, // DXN2SNORM 4, // BC7U @@ -452,6 +460,7 @@ constexpr std::array bpp_table = {{ 32, // ABGR8I 32, // ABGR8UI 16, // B5G6R5U + 16, // R5G6B5U 16, // B5G5R5A1U 32, // A2B10G10R10U 32, // A2B10G10R10UI @@ -470,7 +479,8 @@ constexpr std::array bpp_table = {{ 64, // DXT1 128, // DXT23 128, // DXT45 - 64, // DXN1 + 64, // DXN1UNORM + 64, // DXN1SNORM 128, // DXN2UNORM 128, // DXN2SNORM 128, // BC7U @@ -574,7 +584,4 @@ bool IsPixelFormatSRGB(PixelFormat format); std::pair GetASTCBlockSize(PixelFormat format); -/// Returns true if the specified PixelFormat is a BCn format, e.g. DXT or DXN -bool IsFormatBCn(PixelFormat format); - } // namespace VideoCore::Surface -- cgit v1.2.3