summaryrefslogtreecommitdiffstats
path: root/src/video_core/pica.h
diff options
context:
space:
mode:
authortfarley <tfarleygithub@gmail.com>2015-05-19 06:21:33 +0200
committertfarley <tfarleygithub@gmail.com>2015-05-23 00:51:18 +0200
commit05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2 (patch)
treed080c1efd3b928bda551cb9eee304547e66a4351 /src/video_core/pica.h
parentINI hw/sw renderer toggle (diff)
downloadyuzu-05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2.tar
yuzu-05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2.tar.gz
yuzu-05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2.tar.bz2
yuzu-05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2.tar.lz
yuzu-05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2.tar.xz
yuzu-05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2.tar.zst
yuzu-05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2.zip
Diffstat (limited to 'src/video_core/pica.h')
-rw-r--r--src/video_core/pica.h37
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 {
}
}
- struct {
- // Components are laid out in reverse byte order, most significant bits first.
- enum ColorFormat : u32 {
- RGBA8 = 0,
- RGB8 = 1,
- RGB5A1 = 2,
- RGB565 = 3,
- RGBA4 = 4,
- };
+ // Components are laid out in reverse byte order, most significant bits first.
+ enum ColorFormat : u32 {
+ RGBA8 = 0,
+ RGB8 = 1,
+ RGB5A1 = 2,
+ RGB565 = 3,
+ RGBA4 = 4,
+ };
+ // Returns the number of bytes in the specified color format
+ static unsigned BytesPerColorPixel(ColorFormat format) {
+ switch (format) {
+ case ColorFormat::RGBA8:
+ return 4;
+ case ColorFormat::RGB8:
+ return 3;
+ case ColorFormat::RGB5A1:
+ case ColorFormat::RGB565:
+ case ColorFormat::RGBA4:
+ return 2;
+ default:
+ LOG_CRITICAL(HW_GPU, "Unknown color format %u", format);
+ UNIMPLEMENTED();
+ }
+ }
+
+ struct {
INSERT_PADDING_WORDS(0x6);
DepthFormat depth_format;
- BitField<16, 3, u32> color_format;
+ BitField<16, 3, ColorFormat> color_format;
INSERT_PADDING_WORDS(0x4);