diff --git a/lib/graphicsdev/D3D11.cpp b/lib/graphicsdev/D3D11.cpp index bb75609..36b0afd 100644 --- a/lib/graphicsdev/D3D11.cpp +++ b/lib/graphicsdev/D3D11.cpp @@ -1037,7 +1037,7 @@ struct D3D11CommandQueue : IGraphicsCommandQueue D3D11TextureR* ctarget = m_boundTarget.cast(); 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); } } diff --git a/lib/graphicsdev/D3D12.cpp b/lib/graphicsdev/D3D12.cpp index cae5814..6192b83 100644 --- a/lib/graphicsdev/D3D12.cpp +++ b/lib/graphicsdev/D3D12.cpp @@ -1324,7 +1324,7 @@ struct D3D12CommandQueue : IGraphicsCommandQueue { D3D12TextureR* ctarget = m_boundTarget.cast(); 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); } }