diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-04-02 11:33:39 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-02 16:33:39 +0200 |
| commit | f665e1b40969d1673c7a12c44235aefb2a2ea627 (patch) | |
| tree | b97dc6b308ffb3b8ccacd09c9eaa2512a0c2fdd8 /Ryujinx.Graphics.Gpu/Image/Texture.cs | |
| parent | 9ae60207c4e93388b97e10af5ead090a038f8a7c (diff) | |
Hold reference for render targets in use (#2156)
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/Texture.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/Texture.cs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/Texture.cs b/Ryujinx.Graphics.Gpu/Image/Texture.cs index 26e102a9..6d2510f1 100644 --- a/Ryujinx.Graphics.Gpu/Image/Texture.cs +++ b/Ryujinx.Graphics.Gpu/Image/Texture.cs @@ -73,7 +73,7 @@ namespace Ryujinx.Graphics.Gpu.Image public bool ChangedSize { get; private set; } /// <summary> - /// Set when a texture's GPU VA has ever been partially or fully unmapped. + /// Set when a texture's GPU VA has ever been partially or fully unmapped. /// This indicates that the range must be fully checked when matching the texture. /// </summary> public bool ChangedMapping { get; private set; } @@ -628,7 +628,7 @@ namespace Ryujinx.Graphics.Gpu.Image } /// <summary> - /// Fully synchronizes guest and host memory. + /// Fully synchronizes guest and host memory. /// This will replace the entire texture with the data present in guest memory. /// </summary> public void SynchronizeFull() @@ -1127,7 +1127,7 @@ namespace Ryujinx.Graphics.Gpu.Image { TextureCreateInfo createInfo = TextureManager.GetCreateInfo(view.Info, _context.Capabilities, ScaleFactor); - ITexture newView = parent.HostTexture.CreateView(createInfo, view.FirstLayer + firstLayer, view.FirstLevel + firstLevel); + ITexture newView = parent.HostTexture.CreateView(createInfo, view.FirstLayer + firstLayer, view.FirstLevel + firstLevel); view.ReplaceView(parent, view.Info, newView, view.FirstLayer + firstLayer, view.FirstLevel + firstLevel); } @@ -1188,6 +1188,15 @@ namespace Ryujinx.Graphics.Gpu.Image IsModified = true; Group.SignalModifying(this, bound, !wasModified); } + + if (bound) + { + IncrementReferenceCount(); + } + else + { + DecrementReferenceCount(); + } } /// <summary> |
