mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-13 19:29:14 +01:00
[d3d9] Properly scale dirty box
This commit is contained in:
parent
3f57a3a8cc
commit
cb5f8aa392
@ -3980,7 +3980,18 @@ namespace dxvk {
|
||||
Flags &= ~D3DLOCK_DISCARD;
|
||||
|
||||
if (!(Flags & D3DLOCK_NO_DIRTY_UPDATE) && !(Flags & D3DLOCK_READONLY)) {
|
||||
if (pBox && MipLevel != 0) {
|
||||
D3DBOX scaledBox = *pBox;
|
||||
scaledBox.Left <<= MipLevel;
|
||||
scaledBox.Right = std::min(scaledBox.Right << MipLevel, pResource->Desc()->Width);
|
||||
scaledBox.Top <<= MipLevel;
|
||||
scaledBox.Bottom = std::min(scaledBox.Bottom << MipLevel, pResource->Desc()->Height);
|
||||
scaledBox.Back <<= MipLevel;
|
||||
scaledBox.Front = std::min(scaledBox.Front << MipLevel, pResource->Desc()->Depth);
|
||||
pResource->AddDirtyBox(&scaledBox, Face);
|
||||
} else {
|
||||
pResource->AddDirtyBox(pBox, Face);
|
||||
}
|
||||
}
|
||||
|
||||
auto& desc = *(pResource->Desc());
|
||||
|
Loading…
x
Reference in New Issue
Block a user