GPU: Oops, simplify an expression.

This commit is contained in:
Unknown W. Brackets 2022-11-30 19:20:52 -08:00
parent cbe96d3774
commit 73489349cc
2 changed files with 4 additions and 4 deletions

View file

@ -3065,9 +3065,9 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) {
// Use height less one to account for width, which can be greater or less than stride.
const uint32_t src = srcBasePtr + (srcY * srcStride + srcX) * bpp;
const uint32_t srcSize = (height - 1) * srcStride * bpp + width * bpp;
const uint32_t srcSize = (height - 1) * (srcStride + width) * bpp;
const uint32_t dst = dstBasePtr + (dstY * dstStride + dstX) * bpp;
const uint32_t dstSize = (height - 1) * dstStride * bpp + width * bpp;
const uint32_t dstSize = (height - 1) * (dstStride + width) * bpp;
bool srcDstOverlap = src + srcSize > dst && dst + dstSize > src;
bool srcValid = Memory::IsValidRange(src, srcSize);

View file

@ -795,9 +795,9 @@ void SoftGPU::Execute_BlockTransferStart(u32 op, u32 diff) {
// Use height less one to account for width, which can be greater or less than stride.
const uint32_t src = srcBasePtr + (srcY * srcStride + srcX) * bpp;
const uint32_t srcSize = (height - 1) * srcStride * bpp + width * bpp;
const uint32_t srcSize = (height - 1) * (srcStride + width) * bpp;
const uint32_t dst = dstBasePtr + (dstY * dstStride + dstX) * bpp;
const uint32_t dstSize = (height - 1) * dstStride * bpp + width * bpp;
const uint32_t dstSize = (height - 1) * (dstStride + width) * bpp;
// Need to flush both source and target, so we overwrite properly.
if (Memory::IsValidRange(src, srcSize) && Memory::IsValidRange(dst, dstSize)) {