aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/rasterizer.cpp
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-03-05 14:18:20 -0800
committerYuri Kunde Schlesner <yuriks@yuriks.net>2016-03-05 20:16:20 -0800
commitd2ce686d9710e6b5cc5df0b14bc8eafb03977015 (patch)
treed451d9e54f1c39418066a444908f248c8209bab5 /src/video_core/rasterizer.cpp
parent0000cf6102fad3202f39c2094b8a954af1ec9cfa (diff)
Pica: Write depth value even when depth test is disabled
This has been confirmed on hardware. Fixes Etrian Odyssey IV.
Diffstat (limited to 'src/video_core/rasterizer.cpp')
-rw-r--r--src/video_core/rasterizer.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index dd1604a38e..fd02aa6528 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -858,12 +858,12 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0,
}
}
- // TODO: Does depth indeed only get written even if depth testing is enabled?
+ unsigned num_bits = Regs::DepthBitsPerPixel(regs.framebuffer.depth_format);
+ u32 z = (u32)((v0.screenpos[2].ToFloat32() * w0 +
+ v1.screenpos[2].ToFloat32() * w1 +
+ v2.screenpos[2].ToFloat32() * w2) * ((1 << num_bits) - 1) / wsum);
+
if (output_merger.depth_test_enable) {
- unsigned num_bits = Regs::DepthBitsPerPixel(regs.framebuffer.depth_format);
- u32 z = (u32)((v0.screenpos[2].ToFloat32() * w0 +
- v1.screenpos[2].ToFloat32() * w1 +
- v2.screenpos[2].ToFloat32() * w2) * ((1 << num_bits) - 1) / wsum);
u32 ref_z = GetDepth(x >> 4, y >> 4);
bool pass = false;
@@ -907,11 +907,11 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0,
UpdateStencil(stencil_test.action_depth_fail);
continue;
}
-
- if (output_merger.depth_write_enable)
- SetDepth(x >> 4, y >> 4, z);
}
+ if (output_merger.depth_write_enable)
+ SetDepth(x >> 4, y >> 4, z);
+
// The stencil depth_pass action is executed even if depth testing is disabled
if (stencil_action_enable)
UpdateStencil(stencil_test.action_depth_pass);