mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
renderer_opengl: Implement RGB565 framebuffer format
This commit is contained in:
parent
9cdf5c6c31
commit
80702aa88f
3 changed files with 9 additions and 3 deletions
|
@ -91,6 +91,7 @@ class DebugContext;
|
||||||
struct FramebufferConfig {
|
struct FramebufferConfig {
|
||||||
enum class PixelFormat : u32 {
|
enum class PixelFormat : u32 {
|
||||||
ABGR8 = 1,
|
ABGR8 = 1,
|
||||||
|
RGB565 = 4,
|
||||||
BGRA8 = 5,
|
BGRA8 = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,11 @@ void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture,
|
||||||
internal_format = GL_RGBA8;
|
internal_format = GL_RGBA8;
|
||||||
texture.gl_format = GL_RGBA;
|
texture.gl_format = GL_RGBA;
|
||||||
texture.gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
texture.gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||||
|
break;
|
||||||
|
case Tegra::FramebufferConfig::PixelFormat::RGB565:
|
||||||
|
internal_format = GL_RGB565;
|
||||||
|
texture.gl_format = GL_RGB;
|
||||||
|
texture.gl_type = GL_UNSIGNED_SHORT_5_6_5;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
internal_format = GL_RGBA8;
|
internal_format = GL_RGBA8;
|
||||||
|
|
|
@ -445,11 +445,12 @@ PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case Tegra::FramebufferConfig::PixelFormat::ABGR8:
|
case Tegra::FramebufferConfig::PixelFormat::ABGR8:
|
||||||
return PixelFormat::ABGR8U;
|
return PixelFormat::ABGR8U;
|
||||||
|
case Tegra::FramebufferConfig::PixelFormat::RGB565:
|
||||||
|
return PixelFormat::B5G6R5U;
|
||||||
case Tegra::FramebufferConfig::PixelFormat::BGRA8:
|
case Tegra::FramebufferConfig::PixelFormat::BGRA8:
|
||||||
return PixelFormat::BGRA8;
|
return PixelFormat::BGRA8;
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
UNIMPLEMENTED_MSG("Unimplemented format={}", static_cast<u32>(format));
|
||||||
UNREACHABLE();
|
|
||||||
return PixelFormat::ABGR8U;
|
return PixelFormat::ABGR8U;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue