diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-06-30 08:51:42 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-07-13 06:01:08 +0200 |
commit | fd33e996e0d6d441917446f7a9ec854b0a79a909 (patch) | |
tree | fcc3d6086372cb7b04f2ed494ea60ce30298dfc2 | |
parent | video_core/surface: Remove explicit values on PixelFormat's definition (diff) | |
download | yuzu-fd33e996e0d6d441917446f7a9ec854b0a79a909.tar yuzu-fd33e996e0d6d441917446f7a9ec854b0a79a909.tar.gz yuzu-fd33e996e0d6d441917446f7a9ec854b0a79a909.tar.bz2 yuzu-fd33e996e0d6d441917446f7a9ec854b0a79a909.tar.lz yuzu-fd33e996e0d6d441917446f7a9ec854b0a79a909.tar.xz yuzu-fd33e996e0d6d441917446f7a9ec854b0a79a909.tar.zst yuzu-fd33e996e0d6d441917446f7a9ec854b0a79a909.zip |
-rw-r--r-- | src/video_core/gpu.h | 1 | ||||
-rw-r--r-- | src/video_core/morton.cpp | 2 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 1 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/maxwell_to_vk.cpp | 1 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_device.cpp | 1 | ||||
-rw-r--r-- | src/video_core/surface.cpp | 2 | ||||
-rw-r--r-- | src/video_core/surface.h | 5 |
7 files changed, 13 insertions, 0 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 2c42483bd..2b92ab0ea 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h @@ -75,6 +75,7 @@ enum class RenderTargetFormat : u32 { R16_UINT = 0xF1, R16_FLOAT = 0xF2, R8_UNORM = 0xF3, + R8_SNORM = 0xF4, R8_UINT = 0xF6, }; diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp index 836b25c1d..9b569afc8 100644 --- a/src/video_core/morton.cpp +++ b/src/video_core/morton.cpp @@ -48,6 +48,7 @@ static constexpr ConversionArray morton_to_linear_fns = { MortonCopy<true, PixelFormat::A2B10G10R10U>, MortonCopy<true, PixelFormat::A1B5G5R5U>, MortonCopy<true, PixelFormat::R8U>, + MortonCopy<true, PixelFormat::R8S>, MortonCopy<true, PixelFormat::R8UI>, MortonCopy<true, PixelFormat::RGBA16F>, MortonCopy<true, PixelFormat::RGBA16U>, @@ -131,6 +132,7 @@ static constexpr ConversionArray linear_to_morton_fns = { MortonCopy<false, PixelFormat::A2B10G10R10U>, MortonCopy<false, PixelFormat::A1B5G5R5U>, MortonCopy<false, PixelFormat::R8U>, + MortonCopy<false, PixelFormat::R8S>, MortonCopy<false, PixelFormat::R8UI>, MortonCopy<false, PixelFormat::RGBA16F>, MortonCopy<false, PixelFormat::RGBA16S>, diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 61505879b..6319b0006 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -48,6 +48,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format {GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV}, // A2B10G10R10U {GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, // A1B5G5R5U {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, // R8U + {GL_R8_SNORM, GL_RED, GL_BYTE}, // R8S {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE}, // R8UI {GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT}, // RGBA16F {GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT}, // RGBA16U diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index d7f1ae89f..1f3f79380 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp @@ -124,6 +124,7 @@ struct FormatTuple { {VK_FORMAT_A2B10G10R10_UNORM_PACK32, Attachable | Storage}, // A2B10G10R10U {VK_FORMAT_A1R5G5B5_UNORM_PACK16, Attachable}, // A1B5G5R5U (flipped with swizzle) {VK_FORMAT_R8_UNORM, Attachable | Storage}, // R8U + {VK_FORMAT_R8_SNORM, Attachable | Storage}, // R8S {VK_FORMAT_R8_UINT, Attachable | Storage}, // R8UI {VK_FORMAT_R16G16B16A16_SFLOAT, Attachable | Storage}, // RGBA16F {VK_FORMAT_R16G16B16A16_UNORM, Attachable | Storage}, // RGBA16U diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp index fdaea4210..c4889ac88 100644 --- a/src/video_core/renderer_vulkan/vk_device.cpp +++ b/src/video_core/renderer_vulkan/vk_device.cpp @@ -98,6 +98,7 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties( VK_FORMAT_R8G8_SNORM, VK_FORMAT_R8G8_UINT, VK_FORMAT_R8_UNORM, + VK_FORMAT_R8_SNORM, VK_FORMAT_R8_UINT, VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_R32_SFLOAT, 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: diff --git a/src/video_core/surface.h b/src/video_core/surface.h index 422c9fcb2..def206740 100644 --- a/src/video_core/surface.h +++ b/src/video_core/surface.h @@ -22,6 +22,7 @@ enum class PixelFormat { A2B10G10R10U, A1B5G5R5U, R8U, + R8S, R8UI, RGBA16F, RGBA16U, @@ -137,6 +138,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{ 0, // A2B10G10R10U 0, // A1B5G5R5U 0, // R8U + 0, // R8S 0, // R8UI 0, // RGBA16F 0, // RGBA16U @@ -236,6 +238,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{ 1, // A2B10G10R10U 1, // A1B5G5R5U 1, // R8U + 1, // R8S 1, // R8UI 1, // RGBA16F 1, // RGBA16U @@ -327,6 +330,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{ 1, // A2B10G10R10U 1, // A1B5G5R5U 1, // R8U + 1, // R8S 1, // R8UI 1, // RGBA16F 1, // RGBA16U @@ -418,6 +422,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{ 32, // A2B10G10R10U 16, // A1B5G5R5U 8, // R8U + 8, // R8S 8, // R8UI 64, // RGBA16F 64, // RGBA16U |