diff options
author | Tony Wasserka <neobrainx@gmail.com> | 2015-01-26 11:52:15 +0100 |
---|---|---|
committer | Tony Wasserka <neobrainx@gmail.com> | 2015-01-26 11:52:15 +0100 |
commit | 0cf3c40aa9f57a425c3cceba9a9a02986226bb21 (patch) | |
tree | 464bf8822bd09f9cc2e6a9d23e95cacf882459d7 /src/video_core | |
parent | Merge pull request #484 from chinhodado/build (diff) | |
parent | GPU: Implement the remaining depth testing functions. (diff) | |
download | yuzu-0cf3c40aa9f57a425c3cceba9a9a02986226bb21.tar yuzu-0cf3c40aa9f57a425c3cceba9a9a02986226bb21.tar.gz yuzu-0cf3c40aa9f57a425c3cceba9a9a02986226bb21.tar.bz2 yuzu-0cf3c40aa9f57a425c3cceba9a9a02986226bb21.tar.lz yuzu-0cf3c40aa9f57a425c3cceba9a9a02986226bb21.tar.xz yuzu-0cf3c40aa9f57a425c3cceba9a9a02986226bb21.tar.zst yuzu-0cf3c40aa9f57a425c3cceba9a9a02986226bb21.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/pica.h | 11 | ||||
-rw-r--r-- | src/video_core/rasterizer.cpp | 20 |
2 files changed, 28 insertions, 3 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index de1ce05b6..15850ba17 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -311,9 +311,14 @@ struct Regs { struct { enum DepthFunc : u32 { - Always = 1, - LessThan = 4, - GreaterThan = 6, + Never = 0, + Always = 1, + Equal = 2, + NotEqual = 3, + LessThan = 4, + LessThanOrEqual = 5, + GreaterThan = 6, + GreaterThanOrEqual = 7, }; union { diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 025d4e484..219a1bbb7 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp @@ -441,18 +441,38 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0, bool pass = false; switch (registers.output_merger.depth_test_func) { + case registers.output_merger.Never: + pass = false; + break; + case registers.output_merger.Always: pass = true; break; + case registers.output_merger.Equal: + pass = z == ref_z; + break; + + case registers.output_merger.NotEqual: + pass = z != ref_z; + break; + case registers.output_merger.LessThan: pass = z < ref_z; break; + case registers.output_merger.LessThanOrEqual: + pass = z <= ref_z; + break; + case registers.output_merger.GreaterThan: pass = z > ref_z; break; + case registers.output_merger.GreaterThanOrEqual: + pass = z >= ref_z; + break; + default: LOG_ERROR(HW_GPU, "Unknown depth test function %x", registers.output_merger.depth_test_func.Value()); break; |