aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/Methods.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2019-12-06 20:19:12 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commit17fb11ddb98e94aaf494eaf6002ab149c5d54000 (patch)
treeefd9b4853181d1f5b0b7b56e186206ee49d692c1 /Ryujinx.Graphics.Gpu/Engine/Methods.cs
parentcb171f6ebfa7e1aa5721503d1c1115719957932d (diff)
Fix wrong maximum id on sampler pool in some cases
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Methods.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
index 5388c86d..29360cf9 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
@@ -123,7 +123,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
}
// Pools.
- if (state.QueryModified(MethodOffset.SamplerPoolState))
+ if (state.QueryModified(MethodOffset.SamplerPoolState, MethodOffset.SamplerIndex))
{
UpdateSamplerPoolState(state);
}
@@ -422,11 +422,16 @@ namespace Ryujinx.Graphics.Gpu.Engine
private void UpdateSamplerPoolState(GpuState state)
{
+ var texturePool = state.Get<PoolState>(MethodOffset.TexturePoolState);
var samplerPool = state.Get<PoolState>(MethodOffset.SamplerPoolState);
var samplerIndex = state.Get<SamplerIndex>(MethodOffset.SamplerIndex);
- _textureManager.SetGraphicsSamplerPool(samplerPool.Address.Pack(), samplerPool.MaximumId, samplerIndex);
+ int maximumId = samplerIndex == SamplerIndex.ViaHeaderIndex
+ ? texturePool.MaximumId
+ : samplerPool.MaximumId;
+
+ _textureManager.SetGraphicsSamplerPool(samplerPool.Address.Pack(), maximumId, samplerIndex);
}
private void UpdateTexturePoolState(GpuState state)