More correct implementation of RGB565 Framebuffer format

This commit is contained in:
greggameplayer
2019-02-09 23:56:15 +01:00
parent 60157170cb
commit dfb0b7beb3
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -16,6 +16,7 @@ namespace Tegra {
u32 FramebufferConfig::BytesPerPixel(PixelFormat format) {
switch (format) {
case PixelFormat::ABGR8:
case PixelFormat::RGB565:
return 4;
default:
return 4;
@@ -308,6 +308,12 @@ void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture,
texture.gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
gl_framebuffer_data.resize(texture.width * texture.height * 4);
break;
case Tegra::FramebufferConfig::PixelFormat::RGB565:
internal_format = GL_RGB;
texture.gl_format = GL_RGB;
texture.gl_type = GL_UNSIGNED_SHORT_5_6_5;
gl_framebuffer_data.resize(texture.width * texture.height * 4);
break;
default:
internal_format = GL_RGBA;
texture.gl_format = GL_RGBA;