From ff83d23ed5a2b204a6768e853329204cb1dd1bd3 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 25 Jan 2015 23:34:14 -0500 Subject: GPU: Implement the remaining depth testing functions. --- src/video_core/rasterizer.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/video_core/rasterizer.cpp') 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; -- cgit v1.2.3