From dd0faf70a773933c96977ae3ea942de94061efc8 Mon Sep 17 00:00:00 2001 From: Gabriel A Date: Mon, 13 Nov 2023 21:59:23 -0300 Subject: [PATCH] Fix one NRE, remove unused code --- src/Ryujinx.Graphics.Gpu/Image/Pool.cs | 23 ------------------- .../Image/TextureBindingsManager.cs | 2 +- .../BindlessManager.cs | 1 - 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/Ryujinx.Graphics.Gpu/Image/Pool.cs b/src/Ryujinx.Graphics.Gpu/Image/Pool.cs index ca2e6b7b0..87ac039f0 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/Pool.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/Pool.cs @@ -207,29 +207,6 @@ namespace Ryujinx.Graphics.Gpu.Image return false; } - /// - /// Updates the set of entries that have been modified. - /// - /// Start address of the region of the pool that has been modfied - /// End address of the region of the pool that has been modified, exclusive - protected void UpdateModifiedEntries(ulong address, ulong endAddress) - { - // TODO: Remove this method (it's unused now). - - int startId = (int)((address - Address) / DescriptorSize); - int endId = (int)((endAddress - Address + (DescriptorSize - 1)) / DescriptorSize) - 1; - - if (endId < startId) - { - return; - } - - ModifiedEntries.SetRange(startId, endId); - - _minimumAccessedId = Math.Min(_minimumAccessedId, startId); - _maximumAccessedId = Math.Max(_maximumAccessedId, endId); - } - /// /// Updates a entry that has been modified. /// diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs index a9168cd9d..abef8d0ee 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs @@ -929,7 +929,7 @@ namespace Ryujinx.Graphics.Gpu.Image samplerId = TextureHandle.UnpackSamplerId(packedId); } - if (samplerPool.TryGetBindlessSampler(samplerId, out Sampler sampler)) + if (samplerPool.TryGetBindlessSampler(samplerId, out Sampler sampler) && sampler != null) { _context.Renderer.Pipeline.RegisterBindlessSampler(samplerId, sampler.GetHostSampler(null)); } diff --git a/src/Ryujinx.Graphics.Vulkan/BindlessManager.cs b/src/Ryujinx.Graphics.Vulkan/BindlessManager.cs index 52623ee06..79bced771 100644 --- a/src/Ryujinx.Graphics.Vulkan/BindlessManager.cs +++ b/src/Ryujinx.Graphics.Vulkan/BindlessManager.cs @@ -3,7 +3,6 @@ using Ryujinx.Graphics.GAL; using Silk.NET.Vulkan; using System; using System.Collections.Generic; -using System.ComponentModel.Design; using System.Numerics; using System.Runtime.InteropServices;