From e6e58389164fe7cb6894dfd6e8ac1cc7d9ec7d11 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 13 Nov 2023 18:07:05 -0300 Subject: Do not set modified flag again if texture was not modified (#5909) * Do not set modified flag again if texture was not modified * Formatting * Fix copy dep regression --- src/Ryujinx.Graphics.Gpu/Image/TextureManager.cs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/Ryujinx.Graphics.Gpu/Image/TextureManager.cs') diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureManager.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureManager.cs index ed181640..e9f58314 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureManager.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureManager.cs @@ -413,21 +413,35 @@ namespace Ryujinx.Graphics.Gpu.Image { bool anyChanged = false; - if (_rtHostDs != _rtDepthStencil?.HostTexture) + Texture dsTexture = _rtDepthStencil; + ITexture hostDsTexture = null; + + if (dsTexture != null) { - _rtHostDs = _rtDepthStencil?.HostTexture; + hostDsTexture = dsTexture.HostTexture; + dsTexture.ModifiedSinceLastFlush = true; + } + if (_rtHostDs != hostDsTexture) + { + _rtHostDs = hostDsTexture; anyChanged = true; } 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) { _rtHostColors[index] = hostTexture; - anyChanged = true; } } -- cgit v1.2.3