summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/Render.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoBackends/D3D/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/Render.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp
index d7babc9ff7..a6301e53a2 100644
--- a/Source/Core/VideoBackends/D3D/Render.cpp
+++ b/Source/Core/VideoBackends/D3D/Render.cpp
@@ -578,14 +578,10 @@ void Renderer::SetViewport()
Wd = (X + Wd <= GetTargetWidth()) ? Wd : (GetTargetWidth() - X);
Ht = (Y + Ht <= GetTargetHeight()) ? Ht : (GetTargetHeight() - Y);
- D3D11_VIEWPORT vp = CD3D11_VIEWPORT(
- X, Y, Wd, Ht,
- 1.0f - MathUtil::Clamp<float>(xfmem.viewport.farZ, 0.0f, 16777215.0f) / 16777216.0f,
- 1.0f -
- MathUtil::Clamp<float>(xfmem.viewport.farZ - MathUtil::Clamp<float>(xfmem.viewport.zRange,
- 0.0f, 16777216.0f),
- 0.0f, 16777215.0f) /
- 16777216.0f);
+ // We do depth clipping and depth range in the vertex shader instead of relying
+ // on the graphics API. However we still need to ensure depth values don't exceed
+ // the maximum value supported by the console GPU.
+ D3D11_VIEWPORT vp = CD3D11_VIEWPORT(X, Y, Wd, Ht, D3D11_MIN_DEPTH, GX_MAX_DEPTH);
D3D::context->RSSetViewports(1, &vp);
}