From 143662118c49faf0a8bbc5df3815d095d77c15e8 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 03:34:10 -0300 Subject: video_core/surface: Reorder render target to pixel format switch --- src/video_core/surface.cpp | 104 ++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 53 deletions(-) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index bbe93903c..2392a46f4 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -85,92 +85,90 @@ PixelFormat PixelFormatFromDepthFormat(Tegra::DepthFormat format) { case Tegra::DepthFormat::Z32_S8_X24_FLOAT: return PixelFormat::Z32FS8; default: - LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast(format)); - UNREACHABLE(); + UNIMPLEMENTED_MSG("Unimplemented format={}", static_cast(format)); return PixelFormat::S8Z24; } } PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) { switch (format) { - case Tegra::RenderTargetFormat::RGBA8_SRGB: - return PixelFormat::RGBA8_SRGB; - case Tegra::RenderTargetFormat::RGBA8_UNORM: - return PixelFormat::ABGR8U; - case Tegra::RenderTargetFormat::RGBA8_SNORM: - return PixelFormat::ABGR8S; - case Tegra::RenderTargetFormat::RGBA8_UINT: - return PixelFormat::ABGR8UI; - case Tegra::RenderTargetFormat::BGRA8_SRGB: - return PixelFormat::BGRA8_SRGB; - case Tegra::RenderTargetFormat::BGRA8_UNORM: - return PixelFormat::BGRA8; - case Tegra::RenderTargetFormat::RGB10_A2_UNORM: - return PixelFormat::A2B10G10R10U; - case Tegra::RenderTargetFormat::RGBA16_FLOAT: - return PixelFormat::RGBA16F; + case Tegra::RenderTargetFormat::RGBA32_FLOAT: + return PixelFormat::RGBA32F; + case Tegra::RenderTargetFormat::RGBA32_UINT: + return PixelFormat::RGBA32UI; case Tegra::RenderTargetFormat::RGBA16_UNORM: return PixelFormat::RGBA16U; case Tegra::RenderTargetFormat::RGBA16_SNORM: return PixelFormat::RGBA16S; case Tegra::RenderTargetFormat::RGBA16_UINT: return PixelFormat::RGBA16UI; - case Tegra::RenderTargetFormat::RGBA32_FLOAT: - return PixelFormat::RGBA32F; + case Tegra::RenderTargetFormat::RGBA16_FLOAT: + return PixelFormat::RGBA16F; case Tegra::RenderTargetFormat::RG32_FLOAT: return PixelFormat::RG32F; + case Tegra::RenderTargetFormat::RG32_UINT: + return PixelFormat::RG32UI; + case Tegra::RenderTargetFormat::RGBX16_FLOAT: + return PixelFormat::RGBX16F; + case Tegra::RenderTargetFormat::BGRA8_UNORM: + return PixelFormat::BGRA8; + case Tegra::RenderTargetFormat::BGRA8_SRGB: + return PixelFormat::BGRA8_SRGB; + case Tegra::RenderTargetFormat::RGB10_A2_UNORM: + return PixelFormat::A2B10G10R10U; + case Tegra::RenderTargetFormat::RGBA8_UNORM: + return PixelFormat::ABGR8U; + case Tegra::RenderTargetFormat::RGBA8_SRGB: + return PixelFormat::RGBA8_SRGB; + case Tegra::RenderTargetFormat::RGBA8_SNORM: + return PixelFormat::ABGR8S; + case Tegra::RenderTargetFormat::RGBA8_UINT: + return PixelFormat::ABGR8UI; + case Tegra::RenderTargetFormat::RG16_UNORM: + return PixelFormat::RG16; + case Tegra::RenderTargetFormat::RG16_SNORM: + return PixelFormat::RG16S; + case Tegra::RenderTargetFormat::RG16_SINT: + return PixelFormat::RG16I; + case Tegra::RenderTargetFormat::RG16_UINT: + return PixelFormat::RG16UI; + case Tegra::RenderTargetFormat::RG16_FLOAT: + return PixelFormat::RG16F; case Tegra::RenderTargetFormat::R11G11B10_FLOAT: return PixelFormat::R11FG11FB10F; + case Tegra::RenderTargetFormat::R32_SINT: + return PixelFormat::R32I; + case Tegra::RenderTargetFormat::R32_UINT: + return PixelFormat::R32UI; + case Tegra::RenderTargetFormat::R32_FLOAT: + return PixelFormat::R32F; case Tegra::RenderTargetFormat::B5G6R5_UNORM: return PixelFormat::B5G6R5U; case Tegra::RenderTargetFormat::BGR5A1_UNORM: return PixelFormat::A1B5G5R5U; - case Tegra::RenderTargetFormat::RGBA32_UINT: - return PixelFormat::RGBA32UI; - case Tegra::RenderTargetFormat::R8_UNORM: - return PixelFormat::R8U; - case Tegra::RenderTargetFormat::R8_UINT: - return PixelFormat::R8UI; - case Tegra::RenderTargetFormat::RG16_FLOAT: - return PixelFormat::RG16F; - case Tegra::RenderTargetFormat::RG16_UINT: - return PixelFormat::RG16UI; - case Tegra::RenderTargetFormat::RG16_SINT: - return PixelFormat::RG16I; - case Tegra::RenderTargetFormat::RG16_UNORM: - return PixelFormat::RG16; - case Tegra::RenderTargetFormat::RG16_SNORM: - return PixelFormat::RG16S; case Tegra::RenderTargetFormat::RG8_UNORM: return PixelFormat::RG8U; case Tegra::RenderTargetFormat::RG8_SNORM: return PixelFormat::RG8S; case Tegra::RenderTargetFormat::RG8_UINT: return PixelFormat::RG8UI; - case Tegra::RenderTargetFormat::R16_FLOAT: - return PixelFormat::R16F; case Tegra::RenderTargetFormat::R16_UNORM: return PixelFormat::R16U; case Tegra::RenderTargetFormat::R16_SNORM: return PixelFormat::R16S; - case Tegra::RenderTargetFormat::R16_UINT: - return PixelFormat::R16UI; case Tegra::RenderTargetFormat::R16_SINT: return PixelFormat::R16I; - case Tegra::RenderTargetFormat::R32_FLOAT: - return PixelFormat::R32F; - case Tegra::RenderTargetFormat::R32_SINT: - return PixelFormat::R32I; - case Tegra::RenderTargetFormat::R32_UINT: - return PixelFormat::R32UI; - case Tegra::RenderTargetFormat::RG32_UINT: - return PixelFormat::RG32UI; - case Tegra::RenderTargetFormat::RGBX16_FLOAT: - return PixelFormat::RGBX16F; + case Tegra::RenderTargetFormat::R16_UINT: + return PixelFormat::R16UI; + case Tegra::RenderTargetFormat::R16_FLOAT: + return PixelFormat::R16F; + case Tegra::RenderTargetFormat::R8_UNORM: + return PixelFormat::R8U; + case Tegra::RenderTargetFormat::R8_UINT: + return PixelFormat::R8UI; default: - LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast(format)); - UNREACHABLE(); - return PixelFormat::RGBA8_SRGB; + UNIMPLEMENTED_MSG("Unimplemented format={}", static_cast(format)); + return PixelFormat::ABGR8U; } } -- cgit v1.2.3 From fd33e996e0d6d441917446f7a9ec854b0a79a909 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 03:51:42 -0300 Subject: video_core: Implement R8_SNORM render target --- src/video_core/surface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 2392a46f4..6e9b496d3 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -164,6 +164,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) return PixelFormat::R16F; case Tegra::RenderTargetFormat::R8_UNORM: return PixelFormat::R8U; + case Tegra::RenderTargetFormat::R8_SNORM: + return PixelFormat::R8S; case Tegra::RenderTargetFormat::R8_UINT: return PixelFormat::R8UI; default: -- cgit v1.2.3 From f29fede49c647ce336de2fb4f48aba25f968a882 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 04:00:23 -0300 Subject: video_core: Implement R8_SINT render target --- src/video_core/surface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 6e9b496d3..f132f1b43 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -166,6 +166,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) return PixelFormat::R8U; case Tegra::RenderTargetFormat::R8_SNORM: return PixelFormat::R8S; + case Tegra::RenderTargetFormat::R8_SINT: + return PixelFormat::R8I; case Tegra::RenderTargetFormat::R8_UINT: return PixelFormat::R8UI; default: -- cgit v1.2.3 From e849d680480e07e430793fd9657a08b676655803 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 04:13:46 -0300 Subject: video_core: Implement RG8_SINT render target and fix RG8_UINT --- src/video_core/surface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index f132f1b43..1f12163fe 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -150,6 +150,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) return PixelFormat::RG8U; case Tegra::RenderTargetFormat::RG8_SNORM: return PixelFormat::RG8S; + case Tegra::RenderTargetFormat::RG8_SINT: + return PixelFormat::RG8I; case Tegra::RenderTargetFormat::RG8_UINT: return PixelFormat::RG8UI; case Tegra::RenderTargetFormat::R16_UNORM: -- cgit v1.2.3 From 50c6030a8dc19454f558ba38562aed44b8c294f2 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 04:23:03 -0300 Subject: video_core: Implement RG32_SINT render target --- src/video_core/surface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 1f12163fe..13e598972 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -106,6 +106,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) return PixelFormat::RGBA16F; case Tegra::RenderTargetFormat::RG32_FLOAT: return PixelFormat::RG32F; + case Tegra::RenderTargetFormat::RG32_SINT: + return PixelFormat::RG32I; case Tegra::RenderTargetFormat::RG32_UINT: return PixelFormat::RG32UI; case Tegra::RenderTargetFormat::RGBX16_FLOAT: -- cgit v1.2.3 From 977d6c46f334493852c5c31ff824a871e94188a1 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 04:31:48 -0300 Subject: video_core: Implement RGBA8_SINT render target --- src/video_core/surface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 13e598972..0db995367 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -124,6 +124,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) return PixelFormat::RGBA8_SRGB; case Tegra::RenderTargetFormat::RGBA8_SNORM: return PixelFormat::ABGR8S; + case Tegra::RenderTargetFormat::RGBA8_SINT: + return PixelFormat::ABGR8I; case Tegra::RenderTargetFormat::RGBA8_UINT: return PixelFormat::ABGR8UI; case Tegra::RenderTargetFormat::RG16_UNORM: -- cgit v1.2.3 From 95c0f5afe580943fc58d8787aeb27623daacead5 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 04:38:29 -0300 Subject: video_core: Implement RGBA16_SINT render target --- src/video_core/surface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 0db995367..9c19e2838 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -100,6 +100,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) return PixelFormat::RGBA16U; case Tegra::RenderTargetFormat::RGBA16_SNORM: return PixelFormat::RGBA16S; + case Tegra::RenderTargetFormat::RGBA16_SINT: + return PixelFormat::RGBA16I; case Tegra::RenderTargetFormat::RGBA16_UINT: return PixelFormat::RGBA16UI; case Tegra::RenderTargetFormat::RGBA16_FLOAT: -- cgit v1.2.3 From 9338599d7246a954a1ce25a7e97d80bc1062e1d9 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 04:46:07 -0300 Subject: video_core: Implement RGBA32_SINT render target --- src/video_core/surface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 9c19e2838..b287fe83f 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -94,6 +94,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) switch (format) { case Tegra::RenderTargetFormat::RGBA32_FLOAT: return PixelFormat::RGBA32F; + case Tegra::RenderTargetFormat::RGBA32_SINT: + return PixelFormat::RGBA32I; case Tegra::RenderTargetFormat::RGBA32_UINT: return PixelFormat::RGBA32UI; case Tegra::RenderTargetFormat::RGBA16_UNORM: -- cgit v1.2.3 From 1d20aac795857f8d28e7fc196473a90da4ced33d Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 04:53:48 -0300 Subject: video_core: Implement RGBA32_SINT render target --- src/video_core/surface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index b287fe83f..ea1e20de7 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -122,6 +122,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) return PixelFormat::BGRA8_SRGB; case Tegra::RenderTargetFormat::RGB10_A2_UNORM: return PixelFormat::A2B10G10R10U; + case Tegra::RenderTargetFormat::RGB10_A2_UINT: + return PixelFormat::A2B10G10R10UI; case Tegra::RenderTargetFormat::RGBA8_UNORM: return PixelFormat::ABGR8U; case Tegra::RenderTargetFormat::RGBA8_SRGB: -- cgit v1.2.3 From 480850ffe7106a23f23946ad9ea46b800fa60168 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jun 2020 17:32:36 -0300 Subject: video_core: Fix B5G6R5_UNORM render target format --- src/video_core/surface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index ea1e20de7..c1c2f2c52 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -155,7 +155,7 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) case Tegra::RenderTargetFormat::B5G6R5_UNORM: return PixelFormat::B5G6R5U; case Tegra::RenderTargetFormat::BGR5A1_UNORM: - return PixelFormat::A1B5G5R5U; + return PixelFormat::B5G5R5A1U; case Tegra::RenderTargetFormat::RG8_UNORM: return PixelFormat::RG8U; case Tegra::RenderTargetFormat::RG8_SNORM: -- cgit v1.2.3 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.cpp | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index c1c2f2c52..492ab6215 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -283,25 +283,4 @@ std::pair GetASTCBlockSize(PixelFormat format) { return {GetDefaultBlockWidth(format), GetDefaultBlockHeight(format)}; } -bool IsFormatBCn(PixelFormat format) { - switch (format) { - case PixelFormat::DXT1: - case PixelFormat::DXT23: - case PixelFormat::DXT45: - case PixelFormat::DXN1: - case PixelFormat::DXN2SNORM: - case PixelFormat::DXN2UNORM: - case PixelFormat::BC7U: - case PixelFormat::BC6H_UF16: - case PixelFormat::BC6H_SF16: - case PixelFormat::DXT1_SRGB: - case PixelFormat::DXT23_SRGB: - case PixelFormat::DXT45_SRGB: - case PixelFormat::BC7U_SRGB: - return true; - default: - return false; - } -} - } // namespace VideoCore::Surface -- cgit v1.2.3 From fbc232426d8ff739b0028fb5b41fb5124f7e1792 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 1 Jul 2020 02:28:53 -0300 Subject: video_core: Rearrange pixel format names Normalizes pixel format names to match Vulkan names. Previous to this commit pixel formats had no convention, leading to confusion and potential bugs. --- src/video_core/surface.cpp | 228 ++++++++++++++++++++++----------------------- 1 file changed, 114 insertions(+), 114 deletions(-) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 492ab6215..1688267bb 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -74,131 +74,131 @@ bool SurfaceTargetIsArray(SurfaceTarget target) { PixelFormat PixelFormatFromDepthFormat(Tegra::DepthFormat format) { switch (format) { - case Tegra::DepthFormat::S8_Z24_UNORM: - return PixelFormat::S8Z24; - case Tegra::DepthFormat::Z24_S8_UNORM: - return PixelFormat::Z24S8; - case Tegra::DepthFormat::Z32_FLOAT: - return PixelFormat::Z32F; - case Tegra::DepthFormat::Z16_UNORM: - return PixelFormat::Z16; - case Tegra::DepthFormat::Z32_S8_X24_FLOAT: - return PixelFormat::Z32FS8; + case Tegra::DepthFormat::S8_UINT_Z24_UNORM: + return PixelFormat::S8_UINT_D24_UNORM; + case Tegra::DepthFormat::D24S8_UNORM: + return PixelFormat::D24_UNORM_S8_UINT; + case Tegra::DepthFormat::D32_FLOAT: + return PixelFormat::D32_FLOAT; + case Tegra::DepthFormat::D16_UNORM: + return PixelFormat::D16_UNORM; + case Tegra::DepthFormat::D32_FLOAT_S8X24_UINT: + return PixelFormat::D32_FLOAT_S8_UINT; default: UNIMPLEMENTED_MSG("Unimplemented format={}", static_cast(format)); - return PixelFormat::S8Z24; + return PixelFormat::S8_UINT_D24_UNORM; } } PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) { switch (format) { - case Tegra::RenderTargetFormat::RGBA32_FLOAT: - return PixelFormat::RGBA32F; - case Tegra::RenderTargetFormat::RGBA32_SINT: - return PixelFormat::RGBA32I; - case Tegra::RenderTargetFormat::RGBA32_UINT: - return PixelFormat::RGBA32UI; - case Tegra::RenderTargetFormat::RGBA16_UNORM: - return PixelFormat::RGBA16U; - case Tegra::RenderTargetFormat::RGBA16_SNORM: - return PixelFormat::RGBA16S; - case Tegra::RenderTargetFormat::RGBA16_SINT: - return PixelFormat::RGBA16I; - case Tegra::RenderTargetFormat::RGBA16_UINT: - return PixelFormat::RGBA16UI; - case Tegra::RenderTargetFormat::RGBA16_FLOAT: - return PixelFormat::RGBA16F; - case Tegra::RenderTargetFormat::RG32_FLOAT: - return PixelFormat::RG32F; - case Tegra::RenderTargetFormat::RG32_SINT: - return PixelFormat::RG32I; - case Tegra::RenderTargetFormat::RG32_UINT: - return PixelFormat::RG32UI; - case Tegra::RenderTargetFormat::RGBX16_FLOAT: - return PixelFormat::RGBX16F; - case Tegra::RenderTargetFormat::BGRA8_UNORM: - return PixelFormat::BGRA8; - case Tegra::RenderTargetFormat::BGRA8_SRGB: - return PixelFormat::BGRA8_SRGB; - case Tegra::RenderTargetFormat::RGB10_A2_UNORM: - return PixelFormat::A2B10G10R10U; - case Tegra::RenderTargetFormat::RGB10_A2_UINT: - return PixelFormat::A2B10G10R10UI; - case Tegra::RenderTargetFormat::RGBA8_UNORM: - return PixelFormat::ABGR8U; - case Tegra::RenderTargetFormat::RGBA8_SRGB: - return PixelFormat::RGBA8_SRGB; - case Tegra::RenderTargetFormat::RGBA8_SNORM: - return PixelFormat::ABGR8S; - case Tegra::RenderTargetFormat::RGBA8_SINT: - return PixelFormat::ABGR8I; - case Tegra::RenderTargetFormat::RGBA8_UINT: - return PixelFormat::ABGR8UI; - case Tegra::RenderTargetFormat::RG16_UNORM: - return PixelFormat::RG16; - case Tegra::RenderTargetFormat::RG16_SNORM: - return PixelFormat::RG16S; - case Tegra::RenderTargetFormat::RG16_SINT: - return PixelFormat::RG16I; - case Tegra::RenderTargetFormat::RG16_UINT: - return PixelFormat::RG16UI; - case Tegra::RenderTargetFormat::RG16_FLOAT: - return PixelFormat::RG16F; - case Tegra::RenderTargetFormat::R11G11B10_FLOAT: - return PixelFormat::R11FG11FB10F; + case Tegra::RenderTargetFormat::R32B32G32A32_FLOAT: + return PixelFormat::R32G32B32A32_FLOAT; + case Tegra::RenderTargetFormat::R32G32B32A32_SINT: + return PixelFormat::R32G32B32A32_SINT; + case Tegra::RenderTargetFormat::R32G32B32A32_UINT: + return PixelFormat::R32G32B32A32_UINT; + case Tegra::RenderTargetFormat::R16G16B16A16_UNORM: + return PixelFormat::R16G16B16A16_UNORM; + case Tegra::RenderTargetFormat::R16G16B16A16_SNORM: + return PixelFormat::R16G16B16A16_SNORM; + case Tegra::RenderTargetFormat::R16G16B16A16_SINT: + return PixelFormat::R16G16B16A16_SINT; + case Tegra::RenderTargetFormat::R16G16B16A16_UINT: + return PixelFormat::R16G16B16A16_UINT; + case Tegra::RenderTargetFormat::R16G16B16A16_FLOAT: + return PixelFormat::R16G16B16A16_FLOAT; + case Tegra::RenderTargetFormat::R32G32_FLOAT: + return PixelFormat::R32G32_FLOAT; + case Tegra::RenderTargetFormat::R32G32_SINT: + return PixelFormat::R32G32_SINT; + case Tegra::RenderTargetFormat::R32G32_UINT: + return PixelFormat::R32G32_UINT; + case Tegra::RenderTargetFormat::R16G16B16X16_FLOAT: + return PixelFormat::R16G16B16X16_FLOAT; + case Tegra::RenderTargetFormat::B8G8R8A8_UNORM: + return PixelFormat::B8G8R8A8_UNORM; + case Tegra::RenderTargetFormat::B8G8R8A8_SRGB: + return PixelFormat::B8G8R8A8_SRGB; + case Tegra::RenderTargetFormat::A2B10G10R10_UNORM: + return PixelFormat::A2B10G10R10_UNORM; + case Tegra::RenderTargetFormat::A2B10G10R10_UINT: + return PixelFormat::A2B10G10R10_UINT; + case Tegra::RenderTargetFormat::A8B8G8R8_UNORM: + return PixelFormat::A8B8G8R8_UNORM; + case Tegra::RenderTargetFormat::A8B8G8R8_SRGB: + return PixelFormat::A8B8G8R8_SRGB; + case Tegra::RenderTargetFormat::A8B8G8R8_SNORM: + return PixelFormat::A8B8G8R8_SNORM; + case Tegra::RenderTargetFormat::A8B8G8R8_SINT: + return PixelFormat::A8B8G8R8_SINT; + case Tegra::RenderTargetFormat::A8B8G8R8_UINT: + return PixelFormat::A8B8G8R8_UINT; + case Tegra::RenderTargetFormat::R16G16_UNORM: + return PixelFormat::R16G16_UNORM; + case Tegra::RenderTargetFormat::R16G16_SNORM: + return PixelFormat::R16G16_SNORM; + case Tegra::RenderTargetFormat::R16G16_SINT: + return PixelFormat::R16G16_SINT; + case Tegra::RenderTargetFormat::R16G16_UINT: + return PixelFormat::R16G16_UINT; + case Tegra::RenderTargetFormat::R16G16_FLOAT: + return PixelFormat::R16G16_FLOAT; + case Tegra::RenderTargetFormat::B10G11R11_FLOAT: + return PixelFormat::B10G11R11_FLOAT; case Tegra::RenderTargetFormat::R32_SINT: - return PixelFormat::R32I; + return PixelFormat::R32_SINT; case Tegra::RenderTargetFormat::R32_UINT: - return PixelFormat::R32UI; + return PixelFormat::R32_UINT; case Tegra::RenderTargetFormat::R32_FLOAT: - return PixelFormat::R32F; - case Tegra::RenderTargetFormat::B5G6R5_UNORM: - return PixelFormat::B5G6R5U; - case Tegra::RenderTargetFormat::BGR5A1_UNORM: - return PixelFormat::B5G5R5A1U; - case Tegra::RenderTargetFormat::RG8_UNORM: - return PixelFormat::RG8U; - case Tegra::RenderTargetFormat::RG8_SNORM: - return PixelFormat::RG8S; - case Tegra::RenderTargetFormat::RG8_SINT: - return PixelFormat::RG8I; - case Tegra::RenderTargetFormat::RG8_UINT: - return PixelFormat::RG8UI; + return PixelFormat::R32_FLOAT; + case Tegra::RenderTargetFormat::R5G6B5_UNORM: + return PixelFormat::R5G6B5_UNORM; + case Tegra::RenderTargetFormat::A1R5G5B5_UNORM: + return PixelFormat::A1R5G5B5_UNORM; + case Tegra::RenderTargetFormat::R8G8_UNORM: + return PixelFormat::R8G8_UNORM; + case Tegra::RenderTargetFormat::R8G8_SNORM: + return PixelFormat::R8G8_SNORM; + case Tegra::RenderTargetFormat::R8G8_SINT: + return PixelFormat::R8G8_SINT; + case Tegra::RenderTargetFormat::R8G8_UINT: + return PixelFormat::R8G8_UINT; case Tegra::RenderTargetFormat::R16_UNORM: - return PixelFormat::R16U; + return PixelFormat::R16_UNORM; case Tegra::RenderTargetFormat::R16_SNORM: - return PixelFormat::R16S; + return PixelFormat::R16_SNORM; case Tegra::RenderTargetFormat::R16_SINT: - return PixelFormat::R16I; + return PixelFormat::R16_SINT; case Tegra::RenderTargetFormat::R16_UINT: - return PixelFormat::R16UI; + return PixelFormat::R16_UINT; case Tegra::RenderTargetFormat::R16_FLOAT: - return PixelFormat::R16F; + return PixelFormat::R16_FLOAT; case Tegra::RenderTargetFormat::R8_UNORM: - return PixelFormat::R8U; + return PixelFormat::R8_UNORM; case Tegra::RenderTargetFormat::R8_SNORM: - return PixelFormat::R8S; + return PixelFormat::R8_SNORM; case Tegra::RenderTargetFormat::R8_SINT: - return PixelFormat::R8I; + return PixelFormat::R8_SINT; case Tegra::RenderTargetFormat::R8_UINT: - return PixelFormat::R8UI; + return PixelFormat::R8_UINT; default: UNIMPLEMENTED_MSG("Unimplemented format={}", static_cast(format)); - return PixelFormat::ABGR8U; + return PixelFormat::A8B8G8R8_UNORM; } } PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format) { switch (format) { - case Tegra::FramebufferConfig::PixelFormat::ABGR8: - return PixelFormat::ABGR8U; - case Tegra::FramebufferConfig::PixelFormat::RGB565: - return PixelFormat::B5G6R5U; - case Tegra::FramebufferConfig::PixelFormat::BGRA8: - return PixelFormat::BGRA8; + case Tegra::FramebufferConfig::PixelFormat::A8B8G8R8_UNORM: + return PixelFormat::A8B8G8R8_UNORM; + case Tegra::FramebufferConfig::PixelFormat::RGB565_UNORM: + return PixelFormat::R5G6B5_UNORM; + case Tegra::FramebufferConfig::PixelFormat::B8G8R8A8_UNORM: + return PixelFormat::B8G8R8A8_UNORM; default: UNIMPLEMENTED_MSG("Unimplemented format={}", static_cast(format)); - return PixelFormat::ABGR8U; + return PixelFormat::A8B8G8R8_UNORM; } } @@ -226,27 +226,27 @@ SurfaceType GetFormatType(PixelFormat pixel_format) { bool IsPixelFormatASTC(PixelFormat format) { switch (format) { - case PixelFormat::ASTC_2D_4X4: - case PixelFormat::ASTC_2D_5X4: - case PixelFormat::ASTC_2D_5X5: - case PixelFormat::ASTC_2D_8X8: - case PixelFormat::ASTC_2D_8X5: + case PixelFormat::ASTC_2D_4X4_UNORM: + case PixelFormat::ASTC_2D_5X4_UNORM: + case PixelFormat::ASTC_2D_5X5_UNORM: + case PixelFormat::ASTC_2D_8X8_UNORM: + case PixelFormat::ASTC_2D_8X5_UNORM: case PixelFormat::ASTC_2D_4X4_SRGB: case PixelFormat::ASTC_2D_5X4_SRGB: case PixelFormat::ASTC_2D_5X5_SRGB: case PixelFormat::ASTC_2D_8X8_SRGB: case PixelFormat::ASTC_2D_8X5_SRGB: - case PixelFormat::ASTC_2D_10X8: + case PixelFormat::ASTC_2D_10X8_UNORM: case PixelFormat::ASTC_2D_10X8_SRGB: - case PixelFormat::ASTC_2D_6X6: + case PixelFormat::ASTC_2D_6X6_UNORM: case PixelFormat::ASTC_2D_6X6_SRGB: - case PixelFormat::ASTC_2D_10X10: + case PixelFormat::ASTC_2D_10X10_UNORM: case PixelFormat::ASTC_2D_10X10_SRGB: - case PixelFormat::ASTC_2D_12X12: + case PixelFormat::ASTC_2D_12X12_UNORM: case PixelFormat::ASTC_2D_12X12_SRGB: - case PixelFormat::ASTC_2D_8X6: + case PixelFormat::ASTC_2D_8X6_UNORM: case PixelFormat::ASTC_2D_8X6_SRGB: - case PixelFormat::ASTC_2D_6X5: + case PixelFormat::ASTC_2D_6X5_UNORM: case PixelFormat::ASTC_2D_6X5_SRGB: return true; default: @@ -256,12 +256,12 @@ bool IsPixelFormatASTC(PixelFormat format) { bool IsPixelFormatSRGB(PixelFormat format) { switch (format) { - case PixelFormat::RGBA8_SRGB: - case PixelFormat::BGRA8_SRGB: - case PixelFormat::DXT1_SRGB: - case PixelFormat::DXT23_SRGB: - case PixelFormat::DXT45_SRGB: - case PixelFormat::BC7U_SRGB: + case PixelFormat::A8B8G8R8_SRGB: + case PixelFormat::B8G8R8A8_SRGB: + case PixelFormat::BC1_RGBA_SRGB: + case PixelFormat::BC2_SRGB: + case PixelFormat::BC3_SRGB: + case PixelFormat::BC7_SRGB: case PixelFormat::ASTC_2D_4X4_SRGB: case PixelFormat::ASTC_2D_8X8_SRGB: case PixelFormat::ASTC_2D_8X5_SRGB: -- cgit v1.2.3