mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #1392 from kayru/d3d_viewport_depth
D3D: Replaced shader-based depth range remap with viewport
This commit is contained in:
@ -485,10 +485,9 @@ void Renderer::SetViewport()
|
||||
Wd = (X + Wd <= GetTargetWidth()) ? Wd : (GetTargetWidth() - X);
|
||||
Ht = (Y + Ht <= GetTargetHeight()) ? Ht : (GetTargetHeight() - Y);
|
||||
|
||||
// Some games set invalid values for z-min and z-max so fix them to the max and min allowed and let the shaders do this work
|
||||
D3D11_VIEWPORT vp = CD3D11_VIEWPORT(X, Y, Wd, Ht,
|
||||
0.f, // (xfmem.viewport.farZ - xfmem.viewport.zRange) / 16777216.0f;
|
||||
1.f); // xfmem.viewport.farZ / 16777216.0f;
|
||||
std::max(0.0f, std::min(1.0f, (xfmem.viewport.farZ - xfmem.viewport.zRange) / 16777216.0f)),
|
||||
std::max(0.0f, std::min(1.0f, xfmem.viewport.farZ / 16777216.0f)));
|
||||
D3D::context->RSSetViewports(1, &vp);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user