mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-28 03:23:05 +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
|
@ -97,6 +97,21 @@ namespace Ryujinx.Graphics.Metal
|
||||||
var blitCommandEncoder = _pipeline.GetOrCreateBlitEncoder();
|
var blitCommandEncoder = _pipeline.GetOrCreateBlitEncoder();
|
||||||
|
|
||||||
if (destination is Texture destinationTexture)
|
if (destination is Texture destinationTexture)
|
||||||
|
{
|
||||||
|
if (destinationTexture.Info.Target == Target.Texture3D)
|
||||||
|
{
|
||||||
|
blitCommandEncoder.CopyFromTexture(
|
||||||
|
_mtlTexture,
|
||||||
|
0,
|
||||||
|
(ulong)firstLevel,
|
||||||
|
new MTLOrigin { x = 0, y = 0, z = (ulong)firstLayer },
|
||||||
|
new MTLSize { width = (ulong)Math.Min(Info.Width, destinationTexture.Info.Width), height = (ulong)Math.Min(Info.Height, destinationTexture.Info.Height), depth = 1},
|
||||||
|
destinationTexture._mtlTexture,
|
||||||
|
0,
|
||||||
|
(ulong)firstLevel,
|
||||||
|
new MTLOrigin { x = 0, y = 0, z = (ulong)firstLayer });
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
blitCommandEncoder.CopyFromTexture(
|
blitCommandEncoder.CopyFromTexture(
|
||||||
_mtlTexture,
|
_mtlTexture,
|
||||||
|
@ -109,12 +124,28 @@ namespace Ryujinx.Graphics.Metal
|
||||||
_mtlTexture.MipmapLevelCount);
|
_mtlTexture.MipmapLevelCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void CopyTo(ITexture destination, int srcLayer, int dstLayer, int srcLevel, int dstLevel)
|
public void CopyTo(ITexture destination, int srcLayer, int dstLayer, int srcLevel, int dstLevel)
|
||||||
{
|
{
|
||||||
var blitCommandEncoder = _pipeline.GetOrCreateBlitEncoder();
|
var blitCommandEncoder = _pipeline.GetOrCreateBlitEncoder();
|
||||||
|
|
||||||
if (destination is Texture destinationTexture)
|
if (destination is Texture destinationTexture)
|
||||||
|
{
|
||||||
|
if (destinationTexture.Info.Target == Target.Texture3D)
|
||||||
|
{
|
||||||
|
blitCommandEncoder.CopyFromTexture(
|
||||||
|
_mtlTexture,
|
||||||
|
0,
|
||||||
|
(ulong)srcLevel,
|
||||||
|
new MTLOrigin { x = 0, y = 0, z = (ulong)srcLayer },
|
||||||
|
new MTLSize { width = (ulong)Math.Min(Info.Width, destinationTexture.Info.Width), height = (ulong)Math.Min(Info.Height, destinationTexture.Info.Height), depth = 1},
|
||||||
|
destinationTexture._mtlTexture,
|
||||||
|
0,
|
||||||
|
(ulong)dstLevel,
|
||||||
|
new MTLOrigin { x = 0, y = 0, z = (ulong)dstLayer });
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
blitCommandEncoder.CopyFromTexture(
|
blitCommandEncoder.CopyFromTexture(
|
||||||
_mtlTexture,
|
_mtlTexture,
|
||||||
|
@ -127,6 +158,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
_mtlTexture.MipmapLevelCount);
|
_mtlTexture.MipmapLevelCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void CopyTo(ITexture destination, Extents2D srcRegion, Extents2D dstRegion, bool linearFilter)
|
public void CopyTo(ITexture destination, Extents2D srcRegion, Extents2D dstRegion, bool linearFilter)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue