mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-27 11:03:04 +00:00
Fix 3D -> 3D Texture Copies
This commit is contained in:
parent
3c188718c4
commit
bb4cb531f2
1 changed files with 50 additions and 18 deletions
|
@ -98,15 +98,31 @@ namespace Ryujinx.Graphics.Metal
|
||||||
|
|
||||||
if (destination is Texture destinationTexture)
|
if (destination is Texture destinationTexture)
|
||||||
{
|
{
|
||||||
blitCommandEncoder.CopyFromTexture(
|
if (destinationTexture.Info.Target == Target.Texture3D)
|
||||||
_mtlTexture,
|
{
|
||||||
(ulong)firstLayer,
|
blitCommandEncoder.CopyFromTexture(
|
||||||
(ulong)firstLevel,
|
_mtlTexture,
|
||||||
destinationTexture._mtlTexture,
|
0,
|
||||||
(ulong)firstLayer,
|
(ulong)firstLevel,
|
||||||
(ulong)firstLevel,
|
new MTLOrigin { x = 0, y = 0, z = (ulong)firstLayer },
|
||||||
_mtlTexture.ArrayLength,
|
new MTLSize { width = (ulong)Math.Min(Info.Width, destinationTexture.Info.Width), height = (ulong)Math.Min(Info.Height, destinationTexture.Info.Height), depth = 1},
|
||||||
_mtlTexture.MipmapLevelCount);
|
destinationTexture._mtlTexture,
|
||||||
|
0,
|
||||||
|
(ulong)firstLevel,
|
||||||
|
new MTLOrigin { x = 0, y = 0, z = (ulong)firstLayer });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
blitCommandEncoder.CopyFromTexture(
|
||||||
|
_mtlTexture,
|
||||||
|
(ulong)firstLayer,
|
||||||
|
(ulong)firstLevel,
|
||||||
|
destinationTexture._mtlTexture,
|
||||||
|
(ulong)firstLayer,
|
||||||
|
(ulong)firstLevel,
|
||||||
|
_mtlTexture.ArrayLength,
|
||||||
|
_mtlTexture.MipmapLevelCount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,15 +132,31 @@ namespace Ryujinx.Graphics.Metal
|
||||||
|
|
||||||
if (destination is Texture destinationTexture)
|
if (destination is Texture destinationTexture)
|
||||||
{
|
{
|
||||||
blitCommandEncoder.CopyFromTexture(
|
if (destinationTexture.Info.Target == Target.Texture3D)
|
||||||
_mtlTexture,
|
{
|
||||||
(ulong)srcLayer,
|
blitCommandEncoder.CopyFromTexture(
|
||||||
(ulong)srcLevel,
|
_mtlTexture,
|
||||||
destinationTexture._mtlTexture,
|
0,
|
||||||
(ulong)dstLayer,
|
(ulong)srcLevel,
|
||||||
(ulong)dstLevel,
|
new MTLOrigin { x = 0, y = 0, z = (ulong)srcLayer },
|
||||||
_mtlTexture.ArrayLength,
|
new MTLSize { width = (ulong)Math.Min(Info.Width, destinationTexture.Info.Width), height = (ulong)Math.Min(Info.Height, destinationTexture.Info.Height), depth = 1},
|
||||||
_mtlTexture.MipmapLevelCount);
|
destinationTexture._mtlTexture,
|
||||||
|
0,
|
||||||
|
(ulong)dstLevel,
|
||||||
|
new MTLOrigin { x = 0, y = 0, z = (ulong)dstLayer });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
blitCommandEncoder.CopyFromTexture(
|
||||||
|
_mtlTexture,
|
||||||
|
(ulong)srcLayer,
|
||||||
|
(ulong)srcLevel,
|
||||||
|
destinationTexture._mtlTexture,
|
||||||
|
(ulong)dstLayer,
|
||||||
|
(ulong)dstLevel,
|
||||||
|
_mtlTexture.ArrayLength,
|
||||||
|
_mtlTexture.MipmapLevelCount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue