aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.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/TextureBindingsManager.cs
parent2eccc7023ae0d1247378516b14507d422e4915c5 (diff)
Support texture rectangle targets (non-normalized coords)
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
index 63a42709..ce58e5c5 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
@@ -199,6 +199,21 @@ namespace Ryujinx.Graphics.Gpu.Image
}
}
+ public TextureDescriptor GetTextureDescriptor(GpuState state, int stageIndex, int handle)
+ {
+ int packedId = ReadPackedId(stageIndex, handle);
+
+ int textureId = UnpackTextureId(packedId);
+
+ var poolState = state.Get<PoolState>(MethodOffset.TexturePoolState);
+
+ ulong poolAddress = _context.MemoryManager.Translate(poolState.Address.Pack());
+
+ TexturePool texturePool = _texturePoolCache.FindOrCreate(poolAddress, poolState.MaximumId);
+
+ return texturePool.GetDescriptor(textureId);
+ }
+
private int ReadPackedId(int stage, int wordOffset)
{
ulong address;