Vulkan: Use depth clamping, where available.

This fixes, for example, Shadow of Destiny, even without the hack.
This commit is contained in:
Unknown W. Brackets 2017-12-26 16:35:14 -08:00
parent f263d207b3
commit b94ca6e75e
8 changed files with 16 additions and 8 deletions

View file

@ -104,8 +104,8 @@ static inline ScreenCoords ClipToScreenInternal(const ClipCoords& coords, bool *
float y = coords.y * yScale / coords.w + yCenter;
float z = coords.z * zScale / coords.w + zCenter;
// Is this really right?
if (gstate.clipEnable & 0x1) {
// This matches hardware tests - depth is clamped when this flag is on.
if (gstate.isClippingEnabled()) {
if (z < 0.f)
z = 0.f;
if (z > 65535.f)