VideoBackends: Use vertex shader depth range if ztexture is used.

This commit is contained in:
Jules Blok
2017-02-24 15:16:28 +01:00
parent bde8126913
commit a15555fe03
8 changed files with 69 additions and 60 deletions

View File

@ -4,7 +4,6 @@
#include "VideoBackends/Vulkan/Renderer.h"
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <limits>
@ -1657,8 +1656,7 @@ void Renderer::SetViewport()
// If an oversized or inverted depth range is used, we need to calculate the depth range in the
// vertex shader.
// TODO: Inverted depth ranges are bugged in all drivers, which should be added to DriverDetails.
if (xfmem.viewport.zRange < 0.0f || fabs(xfmem.viewport.zRange) > 16777215.0f ||
fabs(xfmem.viewport.farZ) > 16777215.0f)
if (UseVertexDepthRange())
{
// We need to ensure depth values are clamped the maximum value supported by the console GPU.
min_depth = 0.0f;