diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-10-30 19:18:28 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 23:18:28 +0100 |
commit | 9ef0be477bd6ea4c2c9aada53d94386824a87f00 (patch) | |
tree | 2954711eb9d4c8b4163a767bb295f12189e23f3c /src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs | |
parent | c14ce4d2a5c9b373fb454906a6dc142c028d7be2 (diff) |
Skip some invalid texture flushes (#5755)1.1.1066
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs index 746a95ff..21d7939a 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs @@ -1659,6 +1659,14 @@ namespace Ryujinx.Graphics.Gpu.Image return; } + // 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 + // 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; + } + // 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, // so there shouldn't be any issue as it's the same handler for all actions. |