aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/video_core/pica.h
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-05-06 23:04:30 -0400
committerGravatar bunnei <bunneidev@gmail.com>2015-05-09 22:12:38 -0400
commit547da374b83063a3ca8111ba49049353c3388de8 (patch)
tree483b1c5f67d1df1c4a22f43cdcdb289dd28c6669 /src/video_core/pica.h
parenta806b420a64d44e8b9a0d6f0a742d7eaad06168a (diff)
rasterizer: Fixed a depth testing bug.
Diffstat (limited to 'src/video_core/pica.h')
-rw-r--r--src/video_core/pica.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 30c8b781..26a70003 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -452,9 +452,7 @@ struct Regs {
D24S8 = 3
};
- /*
- * Returns the number of bytes in the specified depth format
- */
+ // Returns the number of bytes in the specified depth format
static u32 BytesPerDepthPixel(DepthFormat format) {
switch (format) {
case DepthFormat::D16:
@@ -469,6 +467,20 @@ struct Regs {
}
}
+ // Returns the number of bits per depth component of the specified depth format
+ static u32 DepthBitsPerPixel(DepthFormat format) {
+ switch (format) {
+ case DepthFormat::D16:
+ return 16;
+ case DepthFormat::D24:
+ case DepthFormat::D24S8:
+ return 24;
+ default:
+ LOG_CRITICAL(HW_GPU, "Unknown depth format %u", format);
+ UNIMPLEMENTED();
+ }
+ }
+
struct {
// Components are laid out in reverse byte order, most significant bits first.
enum ColorFormat : u32 {