From e247f1fc7b86383d0e8660d08a84e53f0536fad3 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 28 Feb 2024 20:34:09 +1100 Subject: [PATCH] [host] d12: enlarge downsampler damage rects --- host/platform/Windows/capture/D12/effect/downsample.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/host/platform/Windows/capture/D12/effect/downsample.c b/host/platform/Windows/capture/D12/effect/downsample.c index a7af8271..faec1513 100644 --- a/host/platform/Windows/capture/D12/effect/downsample.c +++ b/host/platform/Windows/capture/D12/effect/downsample.c @@ -398,6 +398,12 @@ static void d12_effect_downsampleAdjustDamage(D12Effect * effect, rect->right = min(this->width , rect->left + width); rect->top = max(0, floor((double)rect->top * this->scaleY)); rect->bottom = min(this->height, rect->top + height); + + // enlarge the rect to avoid missing damage due to sampler rounding + if (rect->left > 0 ) rect->left -= 1; + if (rect->top > 0 ) rect->top -= 1; + if (rect->right < this->width ) rect->right += 1; + if (rect->bottom < this->height) rect->bottom += 1; } }