rsx: Workaround for G8B8 render targets

- Mainly affected are colormasks and read swizzles

NOTES:
- Writes to G write to the second and fourth component (YW)
- Writes to B write to first and third component (XZ)
- This means the actual format layout is BGBG (RGBA) making RG mapping actually GR
- Clear does not seem to have any intended effect on this format (TLOU)
This commit is contained in:
kd-11 2018-04-01 16:41:57 +03:00 committed by kd-11
parent bd1d4de422
commit c5cd758700
4 changed files with 76 additions and 21 deletions

View file

@ -52,7 +52,8 @@ color_format rsx::internals::surface_color_format_to_gl(rsx::surface_color_forma
{ ::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 };
return{ ::gl::texture::type::ubyte, ::gl::texture::format::rg, false, 2, 1,
{ ::gl::texture::channel::g, ::gl::texture::channel::r, ::gl::texture::channel::g, ::gl::texture::channel::r } };
case rsx::surface_color_format::x32:
return{ ::gl::texture::type::f32, ::gl::texture::format::r, true, 1, 4 };