1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-01 16:24:12 +01:00

[d3d9] Respect specific mip size for implicit viewport in SetRenderTarget

Closes #1295
This commit is contained in:
Joshua Ashton 2020-01-09 03:19:25 +00:00
parent 3cfc16ea34
commit ebcab68822

View File

@ -1134,19 +1134,22 @@ namespace dxvk {
return D3DERR_INVALIDCALL;
if (RenderTargetIndex == 0) {
uint32_t width = std::max(1u, desc->Width >> rt->GetMipLevel());
uint32_t height = std::max(1u, desc->Height >> rt->GetMipLevel());
D3DVIEWPORT9 viewport;
viewport.X = 0;
viewport.Y = 0;
viewport.Width = desc->Width;
viewport.Height = desc->Height;
viewport.Width = width;
viewport.Height = height;
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
RECT scissorRect;
scissorRect.left = 0;
scissorRect.top = 0;
scissorRect.right = desc->Width;
scissorRect.bottom = desc->Height;
scissorRect.right = width;
scissorRect.bottom = height;
if (m_state.viewport != viewport) {
m_flags.set(D3D9DeviceFlag::DirtyFFViewport);