render: fix depth mapping for -1 to 1 viewports

This commit is contained in:
nmzik
2026-09-05 08:40:05 +04:00
parent 3213934d42
commit 3624d96c78
2 changed files with 3 additions and 11 deletions
@@ -350,7 +350,8 @@ static void SetGraphicsDynamicParams(const CommandBuffer& buffer, vk::CommandBuf
viewport.width = vp.viewports[0].xscale * 2.0f;
viewport.height = vp.viewports[0].yscale * 2.0f;
}
viewport.minDepth = vp.viewports[0].zoffset;
viewport.minDepth = vp.viewports[0].zoffset -
(ctx.GetClipControl().dx_clip_space ? 0.0f : vp.viewports[0].zscale);
viewport.maxDepth = vp.viewports[0].zscale + vp.viewports[0].zoffset;
vk_buffer.setViewport(0, 1, &viewport);