diff options
| author | Jules Blok <jules.blok@gmail.com> | 2016-08-19 02:11:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-19 02:11:37 +0200 |
| commit | 40f4308dc2120ce4e105008f3cb46b6a1c553e64 (patch) | |
| tree | a3a83299c9d3f3873f94b2c75991877bb7b928a6 /Source/Core/VideoBackends/D3D12/Render.cpp | |
| parent | 0015d2e86b76772a57fb4554c84c4b47adce341e (diff) | |
| parent | e86d7cbc999223ca113af7b4c0aac6850c1854fe (diff) | |
Merge pull request #4085 from Armada651/vertex-depth
VideoCommon: Implement depth range equation in vertex shader.
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D12/Render.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Source/Core/VideoBackends/D3D12/Render.cpp b/Source/Core/VideoBackends/D3D12/Render.cpp index 6124534204..912cd4908d 100644 --- a/Source/Core/VideoBackends/D3D12/Render.cpp +++ b/Source/Core/VideoBackends/D3D12/Render.cpp @@ -482,15 +482,10 @@ void Renderer::SetViewport() width = (x + width <= GetTargetWidth()) ? width : (GetTargetWidth() - x); height = (y + height <= GetTargetHeight()) ? height : (GetTargetHeight() - y); - D3D12_VIEWPORT vp = { - x, y, width, height, - 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. + D3D12_VIEWPORT vp = {x, y, width, height, D3D12_MIN_DEPTH, GX_MAX_DEPTH}; D3D::current_command_list->RSSetViewports(1, &vp); } |
