diff options
| author | 2016-03-05 14:18:20 -0800 | |
|---|---|---|
| committer | 2016-03-05 20:16:20 -0800 | |
| commit | c58bc25d5b97e3d0e8393abd529dcb213a3ab277 (patch) | |
| tree | d451d9e54f1c39418066a444908f248c8209bab5 /src/video_core/rasterizer.cpp | |
| parent | Merge pull request #1459 from MerryMage/dsp-firmware-hash (diff) | |
| download | yuzu-c58bc25d5b97e3d0e8393abd529dcb213a3ab277.tar.gz yuzu-c58bc25d5b97e3d0e8393abd529dcb213a3ab277.tar.xz yuzu-c58bc25d5b97e3d0e8393abd529dcb213a3ab277.zip | |
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.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index dd1604a38..fd02aa652 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp | |||
| @@ -858,12 +858,12 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, | |||
| 858 | } | 858 | } |
| 859 | } | 859 | } |
| 860 | 860 | ||
| 861 | // TODO: Does depth indeed only get written even if depth testing is enabled? | 861 | unsigned num_bits = Regs::DepthBitsPerPixel(regs.framebuffer.depth_format); |
| 862 | u32 z = (u32)((v0.screenpos[2].ToFloat32() * w0 + | ||
| 863 | v1.screenpos[2].ToFloat32() * w1 + | ||
| 864 | v2.screenpos[2].ToFloat32() * w2) * ((1 << num_bits) - 1) / wsum); | ||
| 865 | |||
| 862 | if (output_merger.depth_test_enable) { | 866 | if (output_merger.depth_test_enable) { |
| 863 | unsigned num_bits = Regs::DepthBitsPerPixel(regs.framebuffer.depth_format); | ||
| 864 | u32 z = (u32)((v0.screenpos[2].ToFloat32() * w0 + | ||
| 865 | v1.screenpos[2].ToFloat32() * w1 + | ||
| 866 | v2.screenpos[2].ToFloat32() * w2) * ((1 << num_bits) - 1) / wsum); | ||
| 867 | u32 ref_z = GetDepth(x >> 4, y >> 4); | 867 | u32 ref_z = GetDepth(x >> 4, y >> 4); |
| 868 | 868 | ||
| 869 | bool pass = false; | 869 | bool pass = false; |
| @@ -907,11 +907,11 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, | |||
| 907 | UpdateStencil(stencil_test.action_depth_fail); | 907 | UpdateStencil(stencil_test.action_depth_fail); |
| 908 | continue; | 908 | continue; |
| 909 | } | 909 | } |
| 910 | |||
| 911 | if (output_merger.depth_write_enable) | ||
| 912 | SetDepth(x >> 4, y >> 4, z); | ||
| 913 | } | 910 | } |
| 914 | 911 | ||
| 912 | if (output_merger.depth_write_enable) | ||
| 913 | SetDepth(x >> 4, y >> 4, z); | ||
| 914 | |||
| 915 | // The stencil depth_pass action is executed even if depth testing is disabled | 915 | // The stencil depth_pass action is executed even if depth testing is disabled |
| 916 | if (stencil_action_enable) | 916 | if (stencil_action_enable) |
| 917 | UpdateStencil(stencil_test.action_depth_pass); | 917 | UpdateStencil(stencil_test.action_depth_pass); |