mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2026-04-21 17:51:56 +00:00
Gpu: exclude RGBA16Float texture format for fast DMA copy on Apple silicon.
This commit is contained in:
parent
e1c829f91d
commit
916350220b
1 changed files with 27 additions and 18 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Memory;
|
using Ryujinx.Common.Memory;
|
||||||
using Ryujinx.Graphics.Device;
|
using Ryujinx.Graphics.Device;
|
||||||
|
using Ryujinx.Graphics.GAL;
|
||||||
using Ryujinx.Graphics.Gpu.Engine.Threed;
|
using Ryujinx.Graphics.Gpu.Engine.Threed;
|
||||||
using Ryujinx.Graphics.Gpu.Memory;
|
using Ryujinx.Graphics.Gpu.Memory;
|
||||||
using Ryujinx.Graphics.Texture;
|
using Ryujinx.Graphics.Texture;
|
||||||
|
|
@ -307,27 +308,35 @@ namespace Ryujinx.Graphics.Gpu.Engine.Dma
|
||||||
|
|
||||||
if (source != null && source.Height == yCount)
|
if (source != null && source.Height == yCount)
|
||||||
{
|
{
|
||||||
source.SynchronizeMemory();
|
// HACK: Exclude RGBA16Float texture format for fast DMA copy on Apple silicon.
|
||||||
|
// Fixes Sonic Frontiers when VK_EXT_external_memory_host is not available.
|
||||||
|
bool skipDma = _context.Capabilities.VendorName == "Apple" &&
|
||||||
|
source.Info.FormatInfo.Format == Format.R16G16B16A16Float;
|
||||||
|
|
||||||
Image.Texture target = memoryManager.Physical.TextureCache.FindOrCreateTexture(
|
if (!skipDma)
|
||||||
memoryManager,
|
|
||||||
source.Info.FormatInfo,
|
|
||||||
dstGpuVa,
|
|
||||||
xCount,
|
|
||||||
yCount,
|
|
||||||
dstStride,
|
|
||||||
dstLinear,
|
|
||||||
dst.MemoryLayout.UnpackGobBlocksInY(),
|
|
||||||
dst.MemoryLayout.UnpackGobBlocksInZ());
|
|
||||||
|
|
||||||
if (source.ScaleFactor != target.ScaleFactor)
|
|
||||||
{
|
{
|
||||||
target.PropagateScale(source);
|
source.SynchronizeMemory();
|
||||||
}
|
|
||||||
|
|
||||||
source.HostTexture.CopyTo(target.HostTexture, 0, 0);
|
Image.Texture target = memoryManager.Physical.TextureCache.FindOrCreateTexture(
|
||||||
target.SignalModified();
|
memoryManager,
|
||||||
return;
|
source.Info.FormatInfo,
|
||||||
|
dstGpuVa,
|
||||||
|
xCount,
|
||||||
|
yCount,
|
||||||
|
dstStride,
|
||||||
|
dstLinear,
|
||||||
|
dst.MemoryLayout.UnpackGobBlocksInY(),
|
||||||
|
dst.MemoryLayout.UnpackGobBlocksInZ());
|
||||||
|
|
||||||
|
if (source.ScaleFactor != target.ScaleFactor)
|
||||||
|
{
|
||||||
|
target.PropagateScale(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
source.HostTexture.CopyTo(target.HostTexture, 0, 0);
|
||||||
|
target.SignalModified();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue