aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2022-02-22 14:21:29 +0000
committerGitHub <noreply@github.com>2022-02-22 11:21:29 -0300
commitc9c65af59edea05e7206a076cb818128c004384e (patch)
tree11441b1b91be53ecc6e5d642123a3111c05ec282 /Ryujinx.Graphics.Gpu/Image
parentdc063eac8330da0b18f0f76c7c9c0e484fa10c56 (diff)
Perform unscaled 2d engine copy on CPU if source texture isn't in cache. (#3112)
* Initial implementation of fast 2d copy TODO: Partial copy for mismatching region/size. * WIP * Cleanup * Update Ryujinx.Graphics.Gpu/Engine/Twod/TwodClass.cs Co-authored-by: gdkchan <gab.dark.100@gmail.com> Co-authored-by: gdkchan <gab.dark.100@gmail.com>
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureCache.cs10
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureSearchFlags.cs3
2 files changed, 12 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
index fed89770..203a3a12 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
@@ -194,6 +194,7 @@ namespace Ryujinx.Graphics.Gpu.Image
TwodTexture copyTexture,
ulong offset,
FormatInfo formatInfo,
+ bool shouldCreate,
bool preferScaling = true,
Size? sizeHint = null)
{
@@ -234,6 +235,11 @@ namespace Ryujinx.Graphics.Gpu.Image
flags |= TextureSearchFlags.WithUpscale;
}
+ if (!shouldCreate)
+ {
+ flags |= TextureSearchFlags.NoCreate;
+ }
+
Texture texture = FindOrCreateTexture(memoryManager, flags, info, 0, sizeHint);
texture?.SynchronizeMemory();
@@ -480,6 +486,10 @@ namespace Ryujinx.Graphics.Gpu.Image
return texture;
}
+ else if (flags.HasFlag(TextureSearchFlags.NoCreate))
+ {
+ return null;
+ }
// Calculate texture sizes, used to find all overlapping textures.
SizeInfo sizeInfo = info.CalculateSizeInfo(layerSize);
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureSearchFlags.cs b/Ryujinx.Graphics.Gpu/Image/TextureSearchFlags.cs
index 45e55c02..aea7b167 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureSearchFlags.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureSearchFlags.cs
@@ -12,6 +12,7 @@ namespace Ryujinx.Graphics.Gpu.Image
Strict = 1 << 0,
ForSampler = 1 << 1,
ForCopy = 1 << 2,
- WithUpscale = 1 << 3
+ WithUpscale = 1 << 3,
+ NoCreate = 1 << 4
}
} \ No newline at end of file