diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TexturePool.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TexturePool.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TexturePool.cs b/Ryujinx.Graphics.Gpu/Image/TexturePool.cs index 6014f07c..47fa01b6 100644 --- a/Ryujinx.Graphics.Gpu/Image/TexturePool.cs +++ b/Ryujinx.Graphics.Gpu/Image/TexturePool.cs @@ -36,11 +36,7 @@ namespace Ryujinx.Graphics.Gpu.Image if (texture == null) { - ulong address = Address + (ulong)(uint)id * DescriptorSize; - - Span<byte> data = Context.PhysicalMemory.Read(address, DescriptorSize); - - TextureDescriptor descriptor = MemoryMarshal.Cast<byte, TextureDescriptor>(data)[0]; + TextureDescriptor descriptor = GetDescriptor(id); TextureInfo info = GetInfo(descriptor); @@ -66,6 +62,15 @@ namespace Ryujinx.Graphics.Gpu.Image return texture; } + public TextureDescriptor GetDescriptor(int id) + { + ulong address = Address + (ulong)(uint)id * DescriptorSize; + + Span<byte> data = Context.PhysicalMemory.Read(address, DescriptorSize); + + return MemoryMarshal.Cast<byte, TextureDescriptor>(data)[0]; + } + protected override void InvalidateRangeImpl(ulong address, ulong size) { ulong endAddress = address + size; |
