From e25b7c9848b6ec486eb513297b5c536857665c7f Mon Sep 17 00:00:00 2001 From: gdkchan Date: Thu, 5 Dec 2019 17:34:47 -0300 Subject: Initial support for the guest OpenGL driver (NVIDIA and Nouveau) --- Ryujinx.Graphics.Gpu/Image/TextureManager.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image/TextureManager.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs index 5e5b1c97..ce0cc249 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs @@ -81,14 +81,14 @@ namespace Ryujinx.Graphics.Gpu.Image _gpBindingsManager.SetTextureBufferIndex(index); } - public void SetComputeSamplerPool(ulong gpuVa, int maximumId) + public void SetComputeSamplerPool(ulong gpuVa, int maximumId, SamplerIndex samplerIndex) { - _cpBindingsManager.SetSamplerPool(gpuVa, maximumId); + _cpBindingsManager.SetSamplerPool(gpuVa, maximumId, samplerIndex); } - public void SetGraphicsSamplerPool(ulong gpuVa, int maximumId) + public void SetGraphicsSamplerPool(ulong gpuVa, int maximumId, SamplerIndex samplerIndex) { - _gpBindingsManager.SetSamplerPool(gpuVa, maximumId); + _gpBindingsManager.SetSamplerPool(gpuVa, maximumId, samplerIndex); } public void SetComputeTexturePool(ulong gpuVa, int maximumId) @@ -599,6 +599,19 @@ namespace Ryujinx.Graphics.Gpu.Image } } + public void Flush(ulong address, ulong size) + { + foreach (Texture texture in _cache) + { + if (texture.OverlapsWith(address, size) && texture.Modified) + { + texture.Flush(); + + texture.Modified = false; + } + } + } + public void RemoveTextureFromCache(Texture texture) { _textures.Remove(texture); -- cgit v1.2.3