From e8ca467bc92cd11abaaea647629fe3799ed448bc Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 26 Dec 2017 16:41:52 -0800 Subject: [PATCH] Vulkan: Allow full depth range with depth clamp. --- GPU/Common/GPUStateUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GPU/Common/GPUStateUtils.cpp b/GPU/Common/GPUStateUtils.cpp index ea4b9359b5..9386758515 100644 --- a/GPU/Common/GPUStateUtils.cpp +++ b/GPU/Common/GPUStateUtils.cpp @@ -508,6 +508,9 @@ float DepthSliceFactor() { if (gstate_c.Supports(GPU_SCALE_DEPTH_FROM_24BIT_TO_16BIT)) { return DEPTH_SLICE_FACTOR_16BIT; } + if (gstate_c.Supports(GPU_SUPPORTS_DEPTH_CLAMP)) { + return 1.0f; + } return DEPTH_SLICE_FACTOR_HIGH; } @@ -681,6 +684,7 @@ void ConvertViewportAndScissor(bool useBufferedRendering, float renderWidth, flo // So, we apply the depth range as minz/maxz, and transform for the viewport. float vpZScale = gstate.getViewportZScale(); float vpZCenter = gstate.getViewportZCenter(); + // TODO: This clip the entire draw if minz > maxz. float minz = gstate.getDepthRangeMin(); float maxz = gstate.getDepthRangeMax();