mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-15 06:37:58 -05:00
video_core: Implement the remaining framebuffer formats in the OpenGL renderer.
This commit is contained in:
@ -53,6 +53,7 @@ struct Regs {
|
||||
"Structure size and register block length don't match")
|
||||
#endif
|
||||
|
||||
// All of those formats are described in reverse byte order, since the 3DS is little-endian.
|
||||
enum class PixelFormat : u32 {
|
||||
RGBA8 = 0,
|
||||
RGB8 = 1,
|
||||
@ -61,6 +62,24 @@ struct Regs {
|
||||
RGBA4 = 4,
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the number of bytes per pixel.
|
||||
*/
|
||||
static int BytesPerPixel(PixelFormat format) {
|
||||
switch (format) {
|
||||
case PixelFormat::RGBA8:
|
||||
return 4;
|
||||
case PixelFormat::RGB8:
|
||||
return 3;
|
||||
case PixelFormat::RGB565:
|
||||
case PixelFormat::RGB5A1:
|
||||
case PixelFormat::RGBA4:
|
||||
return 2;
|
||||
default:
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
}
|
||||
|
||||
INSERT_PADDING_WORDS(0x4);
|
||||
|
||||
struct {
|
||||
|
Reference in New Issue
Block a user