summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2020-06-30 17:32:36 -0300
committerGravatar ReinUsesLisp2020-07-13 01:01:09 -0300
commit480850ffe7106a23f23946ad9ea46b800fa60168 (patch)
treef2fdbe25c51b0b7458b67df7c1f9338374438a9c
parentvideo_core: Fix B5G6R5U (diff)
downloadyuzu-480850ffe7106a23f23946ad9ea46b800fa60168.tar.gz
yuzu-480850ffe7106a23f23946ad9ea46b800fa60168.tar.xz
yuzu-480850ffe7106a23f23946ad9ea46b800fa60168.zip
video_core: Fix B5G6R5_UNORM render target format
-rw-r--r--src/video_core/morton.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp1
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.cpp1
-rw-r--r--src/video_core/surface.cpp2
-rw-r--r--src/video_core/surface.h5
5 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp
index 889f7caac..7f239566a 100644
--- a/src/video_core/morton.cpp
+++ b/src/video_core/morton.cpp
@@ -46,6 +46,7 @@ static constexpr ConversionArray morton_to_linear_fns = {
46 MortonCopy<true, PixelFormat::ABGR8I>, 46 MortonCopy<true, PixelFormat::ABGR8I>,
47 MortonCopy<true, PixelFormat::ABGR8UI>, 47 MortonCopy<true, PixelFormat::ABGR8UI>,
48 MortonCopy<true, PixelFormat::B5G6R5U>, 48 MortonCopy<true, PixelFormat::B5G6R5U>,
49 MortonCopy<true, PixelFormat::B5G5R5A1U>,
49 MortonCopy<true, PixelFormat::A2B10G10R10U>, 50 MortonCopy<true, PixelFormat::A2B10G10R10U>,
50 MortonCopy<true, PixelFormat::A2B10G10R10UI>, 51 MortonCopy<true, PixelFormat::A2B10G10R10UI>,
51 MortonCopy<true, PixelFormat::A1B5G5R5U>, 52 MortonCopy<true, PixelFormat::A1B5G5R5U>,
@@ -137,6 +138,7 @@ static constexpr ConversionArray linear_to_morton_fns = {
137 MortonCopy<false, PixelFormat::ABGR8I>, 138 MortonCopy<false, PixelFormat::ABGR8I>,
138 MortonCopy<false, PixelFormat::ABGR8UI>, 139 MortonCopy<false, PixelFormat::ABGR8UI>,
139 MortonCopy<false, PixelFormat::B5G6R5U>, 140 MortonCopy<false, PixelFormat::B5G6R5U>,
141 MortonCopy<false, PixelFormat::B5G5R5A1U>,
140 MortonCopy<false, PixelFormat::A2B10G10R10U>, 142 MortonCopy<false, PixelFormat::A2B10G10R10U>,
141 MortonCopy<false, PixelFormat::A2B10G10R10UI>, 143 MortonCopy<false, PixelFormat::A2B10G10R10UI>,
142 MortonCopy<false, PixelFormat::A1B5G5R5U>, 144 MortonCopy<false, PixelFormat::A1B5G5R5U>,
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index ccfa7c9fe..7f85ceca9 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -46,6 +46,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format
46 {GL_RGBA8I, GL_RGBA_INTEGER, GL_BYTE}, // ABGR8I 46 {GL_RGBA8I, GL_RGBA_INTEGER, GL_BYTE}, // ABGR8I
47 {GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE}, // ABGR8UI 47 {GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE}, // ABGR8UI
48 {GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5}, // B5G6R5U 48 {GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5}, // B5G6R5U
49 {GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, // B5G5R5A1U
49 {GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV}, // A2B10G10R10U 50 {GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV}, // A2B10G10R10U
50 {GL_RGB10_A2UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV}, // A2B10G10R10UI 51 {GL_RGB10_A2UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV}, // A2B10G10R10UI
51 {GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, // A1B5G5R5U 52 {GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, // A1B5G5R5U
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index fc53321e5..3cb3b00d9 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -122,6 +122,7 @@ struct FormatTuple {
122 {VK_FORMAT_A8B8G8R8_SINT_PACK32, Attachable | Storage}, // ABGR8I 122 {VK_FORMAT_A8B8G8R8_SINT_PACK32, Attachable | Storage}, // ABGR8I
123 {VK_FORMAT_A8B8G8R8_UINT_PACK32, Attachable | Storage}, // ABGR8UI 123 {VK_FORMAT_A8B8G8R8_UINT_PACK32, Attachable | Storage}, // ABGR8UI
124 {VK_FORMAT_R5G6B5_UNORM_PACK16, Attachable}, // B5G6R5U 124 {VK_FORMAT_R5G6B5_UNORM_PACK16, Attachable}, // B5G6R5U
125 {VK_FORMAT_A1R5G5B5_UNORM_PACK16, Attachable}, // B5G5R5A1U
125 {VK_FORMAT_A2B10G10R10_UNORM_PACK32, Attachable | Storage}, // A2B10G10R10U 126 {VK_FORMAT_A2B10G10R10_UNORM_PACK32, Attachable | Storage}, // A2B10G10R10U
126 {VK_FORMAT_A2B10G10R10_UINT_PACK32, Attachable | Storage}, // A2B10G10R10UI 127 {VK_FORMAT_A2B10G10R10_UINT_PACK32, Attachable | Storage}, // A2B10G10R10UI
127 {VK_FORMAT_A1R5G5B5_UNORM_PACK16, Attachable}, // A1B5G5R5U (flipped with swizzle) 128 {VK_FORMAT_A1R5G5B5_UNORM_PACK16, Attachable}, // A1B5G5R5U (flipped with swizzle)
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)
155 case Tegra::RenderTargetFormat::B5G6R5_UNORM: 155 case Tegra::RenderTargetFormat::B5G6R5_UNORM:
156 return PixelFormat::B5G6R5U; 156 return PixelFormat::B5G6R5U;
157 case Tegra::RenderTargetFormat::BGR5A1_UNORM: 157 case Tegra::RenderTargetFormat::BGR5A1_UNORM:
158 return PixelFormat::A1B5G5R5U; 158 return PixelFormat::B5G5R5A1U;
159 case Tegra::RenderTargetFormat::RG8_UNORM: 159 case Tegra::RenderTargetFormat::RG8_UNORM:
160 return PixelFormat::RG8U; 160 return PixelFormat::RG8U;
161 case Tegra::RenderTargetFormat::RG8_SNORM: 161 case Tegra::RenderTargetFormat::RG8_SNORM:
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index aec6b1734..9510db2c8 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 B5G5R5A1U,
23 A2B10G10R10U, 24 A2B10G10R10U,
24 A2B10G10R10UI, 25 A2B10G10R10UI,
25 A1B5G5R5U, 26 A1B5G5R5U,
@@ -143,6 +144,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
143 0, // ABGR8I 144 0, // ABGR8I
144 0, // ABGR8UI 145 0, // ABGR8UI
145 0, // B5G6R5U 146 0, // B5G6R5U
147 0, // B5G5R5A1U
146 0, // A2B10G10R10U 148 0, // A2B10G10R10U
147 0, // A2B10G10R10UI 149 0, // A2B10G10R10UI
148 0, // A1B5G5R5U 150 0, // A1B5G5R5U
@@ -250,6 +252,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
250 1, // ABGR8I 252 1, // ABGR8I
251 1, // ABGR8UI 253 1, // ABGR8UI
252 1, // B5G6R5U 254 1, // B5G6R5U
255 1, // B5G5R5A1U
253 1, // A2B10G10R10U 256 1, // A2B10G10R10U
254 1, // A2B10G10R10UI 257 1, // A2B10G10R10UI
255 1, // A1B5G5R5U 258 1, // A1B5G5R5U
@@ -349,6 +352,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
349 1, // ABGR8I 352 1, // ABGR8I
350 1, // ABGR8UI 353 1, // ABGR8UI
351 1, // B5G6R5U 354 1, // B5G6R5U
355 1, // B5G5R5A1U
352 1, // A2B10G10R10U 356 1, // A2B10G10R10U
353 1, // A2B10G10R10UI 357 1, // A2B10G10R10UI
354 1, // A1B5G5R5U 358 1, // A1B5G5R5U
@@ -448,6 +452,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
448 32, // ABGR8I 452 32, // ABGR8I
449 32, // ABGR8UI 453 32, // ABGR8UI
450 16, // B5G6R5U 454 16, // B5G6R5U
455 16, // B5G5R5A1U
451 32, // A2B10G10R10U 456 32, // A2B10G10R10U
452 32, // A2B10G10R10UI 457 32, // A2B10G10R10UI
453 16, // A1B5G5R5U 458 16, // A1B5G5R5U