From cd8e97a7c6551e58167095b9a1af4d5a536de74c Mon Sep 17 00:00:00 2001 From: ZeroZero2018 <35616470+ZeroZero2018@users.noreply.github.com> Date: Mon, 29 Jan 2018 10:58:25 -0800 Subject: [PATCH] Fix to B8 format render target swizzling (#4123) --- rpcs3/Emu/RSX/GL/GLRenderTargets.cpp | 3 ++- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp index 700d2c8ee1..78925df545 100644 --- a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp +++ b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp @@ -31,7 +31,8 @@ color_format rsx::internals::surface_color_format_to_gl(rsx::surface_color_forma return{ ::gl::texture::type::f32, ::gl::texture::format::rgba, true, 4, 4 }; case rsx::surface_color_format::b8: - return{ ::gl::texture::type::ubyte, ::gl::texture::format::r, false, 1, 1 }; + return{ ::gl::texture::type::ubyte, ::gl::texture::format::r, false, 1, 1, + { ::gl::texture::channel::one, ::gl::texture::channel::r, ::gl::texture::channel::r, ::gl::texture::channel::r } }; case rsx::surface_color_format::g8b8: return{ ::gl::texture::type::ubyte, ::gl::texture::format::rg, false, 2, 1 }; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index ec144a6823..5233949309 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -84,7 +84,10 @@ namespace vk } case rsx::surface_color_format::b8: - return std::make_pair(VK_FORMAT_R8_UNORM, vk::default_component_map()); + { + VkComponentMapping no_alpha = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_ONE }; + return std::make_pair(VK_FORMAT_R8_UNORM, no_alpha); + } case rsx::surface_color_format::g8b8: return std::make_pair(VK_FORMAT_R8G8_UNORM, vk::default_component_map()); @@ -3194,4 +3197,4 @@ void VKGSRender::shell_do_cleanup() { //TODO: Guard this m_overlay_cleanup_requests.push_back(0); -} \ No newline at end of file +}