[host] d12: fix damage tracking with RGB24 enabled

This commit is contained in:
Geoffrey McRae
2024-02-24 09:04:59 +11:00
parent 2f3ca443cf
commit 4408359597
5 changed files with 32 additions and 16 deletions

View File

@@ -278,7 +278,7 @@ exit:
static ID3D12Resource * d12_effect_rgb24Run(D12Effect * effect,
ID3D12Device3 * device, ID3D12GraphicsCommandList * commandList,
ID3D12Resource * src)
ID3D12Resource * src, RECT dirtyRects[], unsigned * nbDirtyRects)
{
TestInstance * this = UPCAST(TestInstance, effect);
@@ -365,6 +365,14 @@ static ID3D12Resource * d12_effect_rgb24Run(D12Effect * effect,
ID3D12GraphicsCommandList_ResourceBarrier(commandList, 1, &barrier);
}
// adjust the dirty rects
for(RECT * rect = dirtyRects; rect < dirtyRects + *nbDirtyRects; ++rect)
{
unsigned width = rect->right - rect->left;
rect->left = (rect->left * 3) / 4;
rect->right = rect->left + (width * 3 + 3) / 4;
}
// return the output buffer
return *this->dst;
}