Make D3D depth range consistent with OpenGL and Vulkan

This commit is contained in:
Jack Andersen 2017-11-14 21:24:45 -10:00
parent 2b6d0cbb1c
commit 4b064a58f2
2 changed files with 2 additions and 2 deletions

View File

@ -1037,7 +1037,7 @@ struct D3D11CommandQueue : IGraphicsCommandQueue
D3D11TextureR* ctarget = m_boundTarget.cast<D3D11TextureR>();
int boundHeight = ctarget->m_height;
D3D11_VIEWPORT vp = {FLOAT(rect.location[0]), FLOAT(boundHeight - rect.location[1] - rect.size[1]),
FLOAT(rect.size[0]), FLOAT(rect.size[1]), znear, zfar};
FLOAT(rect.size[0]), FLOAT(rect.size[1]), 1.f - zfar, 1.f - znear};
m_deferredCtx->RSSetViewports(1, &vp);
}
}

View File

@ -1324,7 +1324,7 @@ struct D3D12CommandQueue : IGraphicsCommandQueue
{
D3D12TextureR* ctarget = m_boundTarget.cast<D3D12TextureR>();
D3D12_VIEWPORT vp = {FLOAT(rect.location[0]), FLOAT(ctarget->m_height - rect.location[1] - rect.size[1]),
FLOAT(rect.size[0]), FLOAT(rect.size[1]), znear, zfar};
FLOAT(rect.size[0]), FLOAT(rect.size[1]), 1.f - zfar, 1.f - znear};
m_cmdList->RSSetViewports(1, &vp);
}
}