aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-02-10 11:47:59 -0300
committerGitHub <noreply@github.com>2023-02-10 11:47:59 -0300
commit61b1ce252f11e8f8e31080faee60d0a9d99cb67f (patch)
treee8a35bc52965183e0669cf31cf8a98408f3ec1b2 /Ryujinx.Graphics.Gpu/Image/TextureCache.cs
parent5f38086f9494a4ffbcb4b0ce4b7727ad8ac18b3e (diff)
Allow partially mapped textures with unmapped start (#4394)1.1.615
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureCache.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureCache.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
index 27bec786..f18de607 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
@@ -474,6 +474,13 @@ namespace Ryujinx.Graphics.Gpu.Image
{
address = memoryManager.Translate(info.GpuAddress);
+ // If the start address is unmapped, let's try to find a page of memory that is mapped.
+ if (address == MemoryManager.PteUnmapped)
+ {
+ address = memoryManager.TranslateFirstMapped(info.GpuAddress, (ulong)info.CalculateSizeInfo(layerSize).TotalSize);
+ }
+
+ // If address is still invalid, the texture is fully unmapped, so it has no data, just return null.
if (address == MemoryManager.PteUnmapped)
{
return null;