aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TexturePool.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2019-12-16 01:59:46 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commit9d7a142a48a5f804127fcae2265bb6ec5495d178 (patch)
tree4ba4de906d74404760fcbebe9aeb51460252f500 /Ryujinx.Graphics.Gpu/Image/TexturePool.cs
parent2eccc7023ae0d1247378516b14507d422e4915c5 (diff)
Support texture rectangle targets (non-normalized coords)
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TexturePool.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TexturePool.cs15
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;