mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-11 22:49:55 +00:00
vk/gl: Fix byte order for RGB565 formats in line with hardware tests
This commit is contained in:
@@ -1695,15 +1695,16 @@ namespace rsx
|
||||
|
||||
std::pair<u32, bool> get_compatible_gcm_format(rsx::surface_color_format format)
|
||||
{
|
||||
// NOTE: HW tests prove that all multibyte formats need to swap bytes
|
||||
switch (format)
|
||||
{
|
||||
case rsx::surface_color_format::r5g6b5:
|
||||
return{ CELL_GCM_TEXTURE_R5G6B5, false };
|
||||
return{ CELL_GCM_TEXTURE_R5G6B5, true };
|
||||
|
||||
case rsx::surface_color_format::x8r8g8b8_z8r8g8b8:
|
||||
case rsx::surface_color_format::x8r8g8b8_o8r8g8b8:
|
||||
case rsx::surface_color_format::a8r8g8b8:
|
||||
return{ CELL_GCM_TEXTURE_A8R8G8B8, true }; //verified
|
||||
return{ CELL_GCM_TEXTURE_A8R8G8B8, true };
|
||||
|
||||
case rsx::surface_color_format::x8b8g8r8_o8b8g8r8:
|
||||
case rsx::surface_color_format::x8b8g8r8_z8b8g8r8:
|
||||
@@ -1718,7 +1719,7 @@ namespace rsx
|
||||
|
||||
case rsx::surface_color_format::x1r5g5b5_o1r5g5b5:
|
||||
case rsx::surface_color_format::x1r5g5b5_z1r5g5b5:
|
||||
return{ CELL_GCM_TEXTURE_A1R5G5B5, false };
|
||||
return{ CELL_GCM_TEXTURE_A1R5G5B5, true };
|
||||
|
||||
case rsx::surface_color_format::b8:
|
||||
return{ CELL_GCM_TEXTURE_B8, false };
|
||||
@@ -1727,7 +1728,7 @@ namespace rsx
|
||||
return{ CELL_GCM_TEXTURE_G8B8, true };
|
||||
|
||||
case rsx::surface_color_format::x32:
|
||||
return{ CELL_GCM_TEXTURE_X32_FLOAT, true }; //verified
|
||||
return{ CELL_GCM_TEXTURE_X32_FLOAT, true };
|
||||
default:
|
||||
fmt::throw_exception("Unhandled surface format 0x%x", static_cast<u32>(format));
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ color_format rsx::internals::surface_color_format_to_gl(rsx::surface_color_forma
|
||||
case rsx::surface_color_format::a8r8g8b8:
|
||||
return{ ::gl::texture::type::uint_8_8_8_8_rev, ::gl::texture::format::bgra, ::gl::texture::internal_format::bgra8, true };
|
||||
|
||||
//These formats discard their alpha component, forced to 0 or 1
|
||||
//All XBGR formats will have remapping before they can be read back in shaders as DRGB8
|
||||
//Prefix o = 1, z = 0
|
||||
// These formats discard their alpha component, forced to 0 or 1
|
||||
// All XBGR formats will have remapping before they can be read back in shaders as DRGB8
|
||||
// Prefix o = 1, z = 0
|
||||
case rsx::surface_color_format::x1r5g5b5_o1r5g5b5:
|
||||
return{ ::gl::texture::type::ushort_5_5_5_1, ::gl::texture::format::rgb, ::gl::texture::internal_format::bgr5a1, true,
|
||||
{ ::gl::texture::channel::one, ::gl::texture::channel::r, ::gl::texture::channel::g, ::gl::texture::channel::b } };
|
||||
@@ -54,7 +54,7 @@ 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, ::gl::texture::internal_format::rg8, false,
|
||||
return{ ::gl::texture::type::ubyte, ::gl::texture::format::rg, ::gl::texture::internal_format::rg8, true,
|
||||
{ ::gl::texture::channel::g, ::gl::texture::channel::r, ::gl::texture::channel::g, ::gl::texture::channel::r } };
|
||||
|
||||
case rsx::surface_color_format::x32:
|
||||
|
||||
Reference in New Issue
Block a user