Fix to B8 format render target swizzling (#4123)

This commit is contained in:
ZeroZero2018 2018-01-29 10:58:25 -08:00 committed by kd-11
parent a27e2db455
commit cd8e97a7c6
2 changed files with 7 additions and 3 deletions

View File

@ -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 };

View File

@ -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);
}
}