Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5b3662b793 | ||
|
1329c47ea4 | ||
|
6bce46621c | ||
|
e6e5838916 |
@@ -43,7 +43,7 @@
|
|||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
<string>public.app-category.games</string>
|
<string>public.app-category.games</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>11.0</string>
|
<string>12.0</string>
|
||||||
<key>UTExportedTypeDeclarations</key>
|
<key>UTExportedTypeDeclarations</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
<dict>
|
||||||
@@ -155,4 +155,4 @@
|
|||||||
<string>200000</string>
|
<string>200000</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@@ -279,7 +279,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Dma
|
|||||||
bool completeSource = IsTextureCopyComplete(src, srcLinear, srcBpp, srcStride, xCount, yCount);
|
bool completeSource = IsTextureCopyComplete(src, srcLinear, srcBpp, srcStride, xCount, yCount);
|
||||||
bool completeDest = IsTextureCopyComplete(dst, dstLinear, dstBpp, dstStride, xCount, yCount);
|
bool completeDest = IsTextureCopyComplete(dst, dstLinear, dstBpp, dstStride, xCount, yCount);
|
||||||
|
|
||||||
if (completeSource && completeDest)
|
// Try to set the texture data directly,
|
||||||
|
// but only if we are doing a complete copy,
|
||||||
|
// and not for block linear to linear copies, since those are typically accessed from the CPU.
|
||||||
|
|
||||||
|
if (completeSource && completeDest && !(dstLinear && !srcLinear))
|
||||||
{
|
{
|
||||||
var target = memoryManager.Physical.TextureCache.FindTexture(
|
var target = memoryManager.Physical.TextureCache.FindTexture(
|
||||||
memoryManager,
|
memoryManager,
|
||||||
|
@@ -102,9 +102,9 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
public bool AlwaysFlushOnOverlap { get; private set; }
|
public bool AlwaysFlushOnOverlap { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates that the texture was fully unmapped since the modified flag was set, and flushes should be ignored until it is modified again.
|
/// Indicates that the texture was modified since the last time it was flushed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool FlushStale { get; private set; }
|
public bool ModifiedSinceLastFlush { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Increments when the host texture is swapped, or when the texture is removed from all pools.
|
/// Increments when the host texture is swapped, or when the texture is removed from all pools.
|
||||||
@@ -1417,7 +1417,6 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void SignalModified()
|
public void SignalModified()
|
||||||
{
|
{
|
||||||
FlushStale = false;
|
|
||||||
_scaledSetScore = Math.Max(0, _scaledSetScore - 1);
|
_scaledSetScore = Math.Max(0, _scaledSetScore - 1);
|
||||||
|
|
||||||
if (_modifiedStale || Group.HasCopyDependencies)
|
if (_modifiedStale || Group.HasCopyDependencies)
|
||||||
@@ -1438,14 +1437,13 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
{
|
{
|
||||||
if (bound)
|
if (bound)
|
||||||
{
|
{
|
||||||
FlushStale = false;
|
|
||||||
_scaledSetScore = Math.Max(0, _scaledSetScore - 1);
|
_scaledSetScore = Math.Max(0, _scaledSetScore - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_modifiedStale || Group.HasCopyDependencies || Group.HasFlushBuffer)
|
if (_modifiedStale || Group.HasCopyDependencies || Group.HasFlushBuffer)
|
||||||
{
|
{
|
||||||
_modifiedStale = false;
|
_modifiedStale = false;
|
||||||
Group.SignalModifying(this, bound);
|
Group.SignalModifying(this, bound, bound || ModifiedSinceLastFlush || Group.HasCopyDependencies || Group.HasFlushBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
_physicalMemory.TextureCache.Lift(this);
|
_physicalMemory.TextureCache.Lift(this);
|
||||||
@@ -1703,12 +1701,6 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// <param name="unmapRange">The range of memory being unmapped</param>
|
/// <param name="unmapRange">The range of memory being unmapped</param>
|
||||||
public void Unmapped(MultiRange unmapRange)
|
public void Unmapped(MultiRange unmapRange)
|
||||||
{
|
{
|
||||||
if (unmapRange.Contains(Range))
|
|
||||||
{
|
|
||||||
// If this is a full unmap, prevent flushes until the texture is mapped again.
|
|
||||||
FlushStale = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ChangedMapping = true;
|
ChangedMapping = true;
|
||||||
|
|
||||||
if (Group.Storage == this)
|
if (Group.Storage == this)
|
||||||
|
@@ -709,7 +709,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="texture">The texture that has been modified</param>
|
/// <param name="texture">The texture that has been modified</param>
|
||||||
/// <param name="bound">True if this texture is being bound, false if unbound</param>
|
/// <param name="bound">True if this texture is being bound, false if unbound</param>
|
||||||
public void SignalModifying(Texture texture, bool bound)
|
/// <param name="setModified">Indicates if the modified flag should be set</param>
|
||||||
|
public void SignalModifying(Texture texture, bool bound, bool setModified)
|
||||||
{
|
{
|
||||||
ModifiedSequence = _context.GetModifiedSequence();
|
ModifiedSequence = _context.GetModifiedSequence();
|
||||||
|
|
||||||
@@ -721,7 +722,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
{
|
{
|
||||||
TextureGroupHandle group = _handles[baseHandle + i];
|
TextureGroupHandle group = _handles[baseHandle + i];
|
||||||
|
|
||||||
group.SignalModifying(bound, _context);
|
group.SignalModifying(bound, _context, setModified);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1660,13 +1661,13 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If size is zero, we have nothing to flush.
|
// If size is zero, we have nothing to flush.
|
||||||
// If the flush is stale, we should ignore it because the texture was unmapped since the modified
|
if (size == 0)
|
||||||
// flag was set, and flushing it is not safe anymore as the GPU might no longer own the memory.
|
|
||||||
if (size == 0 || Storage.FlushStale)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Storage.ModifiedSinceLastFlush = false;
|
||||||
|
|
||||||
// There is a small gap here where the action is removed but _actionRegistered is still 1.
|
// There is a small gap here where the action is removed but _actionRegistered is still 1.
|
||||||
// In this case it will skip registering the action, but here we are already handling it,
|
// In this case it will skip registering the action, but here we are already handling it,
|
||||||
// so there shouldn't be any issue as it's the same handler for all actions.
|
// so there shouldn't be any issue as it's the same handler for all actions.
|
||||||
|
@@ -304,9 +304,17 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="bound">True if this handle is being bound, false if unbound</param>
|
/// <param name="bound">True if this handle is being bound, false if unbound</param>
|
||||||
/// <param name="context">The GPU context to register a sync action on</param>
|
/// <param name="context">The GPU context to register a sync action on</param>
|
||||||
public void SignalModifying(bool bound, GpuContext context)
|
/// <param name="setModified">Indicates if the modified flag should be set</param>
|
||||||
|
public void SignalModifying(bool bound, GpuContext context, bool setModified)
|
||||||
{
|
{
|
||||||
SignalModified(context);
|
if (setModified)
|
||||||
|
{
|
||||||
|
SignalModified(context);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegisterSync(context);
|
||||||
|
}
|
||||||
|
|
||||||
if (!bound && _syncActionRegistered && NextSyncCopies())
|
if (!bound && _syncActionRegistered && NextSyncCopies())
|
||||||
{
|
{
|
||||||
|
@@ -413,21 +413,35 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
{
|
{
|
||||||
bool anyChanged = false;
|
bool anyChanged = false;
|
||||||
|
|
||||||
if (_rtHostDs != _rtDepthStencil?.HostTexture)
|
Texture dsTexture = _rtDepthStencil;
|
||||||
{
|
ITexture hostDsTexture = null;
|
||||||
_rtHostDs = _rtDepthStencil?.HostTexture;
|
|
||||||
|
|
||||||
|
if (dsTexture != null)
|
||||||
|
{
|
||||||
|
hostDsTexture = dsTexture.HostTexture;
|
||||||
|
dsTexture.ModifiedSinceLastFlush = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_rtHostDs != hostDsTexture)
|
||||||
|
{
|
||||||
|
_rtHostDs = hostDsTexture;
|
||||||
anyChanged = true;
|
anyChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int index = 0; index < _rtColors.Length; index++)
|
for (int index = 0; index < _rtColors.Length; index++)
|
||||||
{
|
{
|
||||||
ITexture hostTexture = _rtColors[index]?.HostTexture;
|
Texture texture = _rtColors[index];
|
||||||
|
ITexture hostTexture = null;
|
||||||
|
|
||||||
|
if (texture != null)
|
||||||
|
{
|
||||||
|
hostTexture = texture.HostTexture;
|
||||||
|
texture.ModifiedSinceLastFlush = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (_rtHostColors[index] != hostTexture)
|
if (_rtHostColors[index] != hostTexture)
|
||||||
{
|
{
|
||||||
_rtHostColors[index] = hostTexture;
|
_rtHostColors[index] = hostTexture;
|
||||||
|
|
||||||
anyChanged = true;
|
anyChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user