mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 21:55:08 +01:00
Swap min and max depth when negative scale is used
Fixes Super Mario 3D All Stars rendering.
This commit is contained in:
parent
198e9e8e48
commit
d659b4f55e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user