mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-13 06:09:11 +00:00
Update bindless textures on data modification
This commit is contained in:
parent
dd0faf70a7
commit
360630ad6b
2 changed files with 18 additions and 4 deletions
|
@ -621,6 +621,10 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
public void SignalGroupDirty()
|
public void SignalGroupDirty()
|
||||||
{
|
{
|
||||||
_dirty = true;
|
_dirty = true;
|
||||||
|
|
||||||
|
// If this used as a bindless texture, we must force it to be updated on next use,
|
||||||
|
// since the CPU modified the data.
|
||||||
|
ForceTexturePoolUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1471,9 +1475,12 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void ForceTexturePoolUpdate()
|
private void ForceTexturePoolUpdate()
|
||||||
{
|
{
|
||||||
foreach (TexturePoolOwner poolOwner in _poolOwners)
|
lock (_poolOwners)
|
||||||
{
|
{
|
||||||
poolOwner.Pool.ForceModifiedEntry(poolOwner.ID);
|
foreach (TexturePoolOwner poolOwner in _poolOwners)
|
||||||
|
{
|
||||||
|
poolOwner.Pool.ForceModifiedEntry(poolOwner.ID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1538,6 +1545,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
_poolOwners.Add(new TexturePoolOwner { Pool = pool, ID = id, GpuAddress = gpuVa });
|
_poolOwners.Add(new TexturePoolOwner { Pool = pool, ID = id, GpuAddress = gpuVa });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_dirty)
|
||||||
|
{
|
||||||
|
pool.ForceModifiedEntry(id);
|
||||||
|
}
|
||||||
|
|
||||||
_referenceCount++;
|
_referenceCount++;
|
||||||
|
|
||||||
if (ShortCacheEntry != null)
|
if (ShortCacheEntry != null)
|
||||||
|
|
|
@ -254,8 +254,6 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Items[textureId]?.SynchronizeMemory();
|
|
||||||
|
|
||||||
bool textureModified = ModifiedEntries.Clear(textureId);
|
bool textureModified = ModifiedEntries.Clear(textureId);
|
||||||
|
|
||||||
if (samplerPool != null)
|
if (samplerPool != null)
|
||||||
|
@ -304,6 +302,10 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
/// <param name="id">ID of the texture</param>
|
/// <param name="id">ID of the texture</param>
|
||||||
private void UpdateBindlessInternal(IRenderer renderer, int id)
|
private void UpdateBindlessInternal(IRenderer renderer, int id)
|
||||||
{
|
{
|
||||||
|
// If the texture already exists, check if it has not been modified since the last use.
|
||||||
|
// If it was, update the data.
|
||||||
|
Items[id]?.SynchronizeMemory();
|
||||||
|
|
||||||
Texture texture = Items[id] ?? GetValidated(id);
|
Texture texture = Items[id] ?? GetValidated(id);
|
||||||
|
|
||||||
if (texture != null)
|
if (texture != null)
|
||||||
|
|
Loading…
Reference in a new issue