mirror of https://github.com/AxioDL/boo.git
Make D3D depth range consistent with OpenGL and Vulkan
This commit is contained in:
parent
2b6d0cbb1c
commit
4b064a58f2
|
@ -1037,7 +1037,7 @@ struct D3D11CommandQueue : IGraphicsCommandQueue
|
||||||
D3D11TextureR* ctarget = m_boundTarget.cast<D3D11TextureR>();
|
D3D11TextureR* ctarget = m_boundTarget.cast<D3D11TextureR>();
|
||||||
int boundHeight = ctarget->m_height;
|
int boundHeight = ctarget->m_height;
|
||||||
D3D11_VIEWPORT vp = {FLOAT(rect.location[0]), FLOAT(boundHeight - rect.location[1] - rect.size[1]),
|
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);
|
m_deferredCtx->RSSetViewports(1, &vp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1324,7 +1324,7 @@ struct D3D12CommandQueue : IGraphicsCommandQueue
|
||||||
{
|
{
|
||||||
D3D12TextureR* ctarget = m_boundTarget.cast<D3D12TextureR>();
|
D3D12TextureR* ctarget = m_boundTarget.cast<D3D12TextureR>();
|
||||||
D3D12_VIEWPORT vp = {FLOAT(rect.location[0]), FLOAT(ctarget->m_height - rect.location[1] - rect.size[1]),
|
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);
|
m_cmdList->RSSetViewports(1, &vp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue