D3D: Viewport min and max depth is now clamped to [0..1] range

This commit is contained in:
Yuriy O'Donnell 2014-11-05 02:41:08 +01:00
parent a886d8a8ee
commit 36b886cb80
1 changed files with 2 additions and 2 deletions

View File

@ -486,8 +486,8 @@ void Renderer::SetViewport()
Ht = (Y + Ht <= GetTargetHeight()) ? Ht : (GetTargetHeight() - Y); Ht = (Y + Ht <= GetTargetHeight()) ? Ht : (GetTargetHeight() - Y);
D3D11_VIEWPORT vp = CD3D11_VIEWPORT(X, Y, Wd, Ht, D3D11_VIEWPORT vp = CD3D11_VIEWPORT(X, Y, Wd, Ht,
(xfmem.viewport.farZ - xfmem.viewport.zRange) / 16777216.0f, std::max(0.0f, std::min(1.0f, (xfmem.viewport.farZ - xfmem.viewport.zRange) / 16777216.0f)),
xfmem.viewport.farZ / 16777216.0f); std::max(0.0f, std::min(1.0f, xfmem.viewport.farZ / 16777216.0f)));
D3D::context->RSSetViewports(1, &vp); D3D::context->RSSetViewports(1, &vp);
} }