Skip to content

Commit

Permalink
[host] d12: enlarge downsampler damage rects
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Feb 28, 2024
1 parent 4463ca1 commit e247f1f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions host/platform/Windows/capture/D12/effect/downsample.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit e247f1f

Please sign in to comment.