diff options
Diffstat (limited to 'src/video_core/pica.h')
| -rw-r--r-- | src/video_core/pica.h | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index e9bc7fb3b..503c09eca 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h | |||
| @@ -490,20 +490,37 @@ struct Regs { | |||
| 490 | } | 490 | } |
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | struct { | 493 | // Components are laid out in reverse byte order, most significant bits first. |
| 494 | // Components are laid out in reverse byte order, most significant bits first. | 494 | enum ColorFormat : u32 { |
| 495 | enum ColorFormat : u32 { | 495 | RGBA8 = 0, |
| 496 | RGBA8 = 0, | 496 | RGB8 = 1, |
| 497 | RGB8 = 1, | 497 | RGB5A1 = 2, |
| 498 | RGB5A1 = 2, | 498 | RGB565 = 3, |
| 499 | RGB565 = 3, | 499 | RGBA4 = 4, |
| 500 | RGBA4 = 4, | 500 | }; |
| 501 | }; | ||
| 502 | 501 | ||
| 502 | // Returns the number of bytes in the specified color format | ||
| 503 | static unsigned BytesPerColorPixel(ColorFormat format) { | ||
| 504 | switch (format) { | ||
| 505 | case ColorFormat::RGBA8: | ||
| 506 | return 4; | ||
| 507 | case ColorFormat::RGB8: | ||
| 508 | return 3; | ||
| 509 | case ColorFormat::RGB5A1: | ||
| 510 | case ColorFormat::RGB565: | ||
| 511 | case ColorFormat::RGBA4: | ||
| 512 | return 2; | ||
| 513 | default: | ||
| 514 | LOG_CRITICAL(HW_GPU, "Unknown color format %u", format); | ||
| 515 | UNIMPLEMENTED(); | ||
| 516 | } | ||
| 517 | } | ||
| 518 | |||
| 519 | struct { | ||
| 503 | INSERT_PADDING_WORDS(0x6); | 520 | INSERT_PADDING_WORDS(0x6); |
| 504 | 521 | ||
| 505 | DepthFormat depth_format; | 522 | DepthFormat depth_format; |
| 506 | BitField<16, 3, u32> color_format; | 523 | BitField<16, 3, ColorFormat> color_format; |
| 507 | 524 | ||
| 508 | INSERT_PADDING_WORDS(0x4); | 525 | INSERT_PADDING_WORDS(0x4); |
| 509 | 526 | ||