diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/active_state.cpp b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/active_state.cpp index ee41cc97..e1cbc2ce 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/active_state.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/active_state.cpp @@ -249,9 +249,14 @@ namespace skyline::gpu::interconnect::maxwell3d { vkViewport.height = -vkViewport.height; } + // Clamp since we don't yet use VK_EXT_unrestricted_depth_range vkViewport.minDepth = std::clamp(viewportClip.minZ, 0.0f, 1.0f); vkViewport.maxDepth = std::clamp(viewportClip.maxZ, 0.0f, 1.0f); + + if (viewport.scaleZ < 0.0f) + std::swap(vkViewport.minDepth, vkViewport.maxDepth); + return vkViewport; }