mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
Calculate width from stride on texture copies
This commit is contained in:
parent
1876b346fe
commit
1bb08742c1
|
@ -245,9 +245,20 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
|
|
||||||
FormatInfo formatInfo = copyTexture.Format.Convert();
|
FormatInfo formatInfo = copyTexture.Format.Convert();
|
||||||
|
|
||||||
|
int width;
|
||||||
|
|
||||||
|
if (copyTexture.LinearLayout)
|
||||||
|
{
|
||||||
|
width = copyTexture.Stride / formatInfo.BytesPerPixel;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
width = copyTexture.Width;
|
||||||
|
}
|
||||||
|
|
||||||
TextureInfo info = new TextureInfo(
|
TextureInfo info = new TextureInfo(
|
||||||
address,
|
address,
|
||||||
copyTexture.Width,
|
width,
|
||||||
copyTexture.Height,
|
copyTexture.Height,
|
||||||
copyTexture.Depth,
|
copyTexture.Depth,
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -108,11 +108,8 @@ namespace Ryujinx.Graphics.Texture
|
||||||
{
|
{
|
||||||
int outOffs = 0;
|
int outOffs = 0;
|
||||||
|
|
||||||
int w = width;
|
int w = BitUtils.DivRoundUp(width, blockWidth);
|
||||||
int h = height;
|
int h = BitUtils.DivRoundUp(height, blockHeight);
|
||||||
|
|
||||||
w = BitUtils.DivRoundUp(w, blockWidth);
|
|
||||||
h = BitUtils.DivRoundUp(h, blockHeight);
|
|
||||||
|
|
||||||
int outStride = BitUtils.AlignUp(w * bytesPerPixel, AlignmentSize);
|
int outStride = BitUtils.AlignUp(w * bytesPerPixel, AlignmentSize);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue