mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-28 23:29:05 +00:00
Gpu: exclude RGBA16Float texture format for fast DMA copy on Apple silicon.
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user