gl: Fix texture layout for RGB5A1 and BGR5A1 surfaces for readback/upload

This commit is contained in:
kd-11
2026-10-02 13:33:48 +03:00
committed by kd-11
parent 54ab16913e
commit a3409242ce
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -20,11 +20,11 @@ color_format rsx::internals::surface_color_format_to_gl(rsx::surface_color_forma
// 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,
return{ ::gl::texture::type::ushort_1_5_5_5_rev, ::gl::texture::format::bgra, ::gl::texture::internal_format::bgr5a1, true,
{ ::gl::texture::channel::one, ::gl::texture::channel::r, ::gl::texture::channel::g, ::gl::texture::channel::b } };
case rsx::surface_color_format::x1r5g5b5_z1r5g5b5:
return{ ::gl::texture::type::ushort_5_5_5_1, ::gl::texture::format::rgb, ::gl::texture::internal_format::bgr5a1, true,
return{ ::gl::texture::type::ushort_1_5_5_5_rev, ::gl::texture::format::bgra, ::gl::texture::internal_format::bgr5a1, true,
{ ::gl::texture::channel::zero, ::gl::texture::channel::r, ::gl::texture::channel::g, ::gl::texture::channel::b } };
case rsx::surface_color_format::x8r8g8b8_z8r8g8b8:
+2 -2
View File
@@ -175,9 +175,9 @@ namespace gl
case texture::internal_format::rgb565:
return { .format = GL_RGB, .type = GL_UNSIGNED_SHORT_5_6_5, .block_size = 2, .swap_bytes = true };
case texture::internal_format::rgb5a1:
return { .format = GL_RGB, .type = GL_UNSIGNED_SHORT_5_5_5_1, .block_size = 2, .swap_bytes = true };
return { .format = GL_RGBA, .type = GL_UNSIGNED_SHORT_5_5_5_1, .block_size = 2, .swap_bytes = true };
case texture::internal_format::bgr5a1:
return { .format = GL_RGB, .type = GL_UNSIGNED_SHORT_1_5_5_5_REV, .block_size = 2, .swap_bytes = true };
return { .format = GL_BGRA, .type = GL_UNSIGNED_SHORT_1_5_5_5_REV, .block_size = 2, .swap_bytes = true };
case texture::internal_format::rgba4:
return { .format = GL_BGRA, .type = GL_UNSIGNED_SHORT_4_4_4_4, .block_size = 2, .swap_bytes = false };
case texture::internal_format::rgba8: