From 8b51bc5b0bf573c2fb8076873fec3562c0f5c9df Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 7 Feb 2016 22:42:47 -0800 Subject: [PATCH] Fix debugging and depth packing with old depth. Which means, OpenGL in general right now. --- GPU/Common/GPUStateUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GPU/Common/GPUStateUtils.cpp b/GPU/Common/GPUStateUtils.cpp index 98a4e2bd0..662ccf912 100644 --- a/GPU/Common/GPUStateUtils.cpp +++ b/GPU/Common/GPUStateUtils.cpp @@ -531,6 +531,10 @@ float ToScaledDepth(u16 z) { } float FromScaledDepth(float z) { + if (!gstate_c.Supports(GPU_SUPPORTS_ACCURATE_DEPTH)) { + return z * 65535.0f; + } + const float depthSliceFactor = DepthSliceFactor(); const float offset = 0.5f * (depthSliceFactor - 1.0f) * (1.0f / depthSliceFactor); return (z - offset) * depthSliceFactor * 65535.0f;