Account for negative strides on DMA copy (#2623)
* Account for negative strides on DMA copy * Should account for non-zero Y
This commit is contained in:
parent
016fc64b3d
commit
ac4ec1a015
4 changed files with 27 additions and 11 deletions
|
@ -1,4 +1,5 @@
|
|||
using Ryujinx.Common;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using static Ryujinx.Graphics.Texture.BlockLinearConstants;
|
||||
|
||||
|
@ -111,9 +112,9 @@ namespace Ryujinx.Graphics.Texture
|
|||
{
|
||||
if (_isLinear)
|
||||
{
|
||||
int start = y * _stride + x * _bytesPerPixel;
|
||||
int end = (y + height - 1) * _stride + (x + width) * _bytesPerPixel;
|
||||
return (start, end - start);
|
||||
int start = y * Math.Abs(_stride) + x * _bytesPerPixel;
|
||||
int end = (y + height - 1) * Math.Abs(_stride) + (x + width) * _bytesPerPixel;
|
||||
return (y * _stride + x * _bytesPerPixel, end - start);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue