From 550fd4a7338eded794bf961ef6fd0c38643471c8 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 14 Aug 2023 13:57:39 -0300 Subject: Simplify resolution scale updates (#5541) --- .../Image/TextureBindingsManager.cs | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs') diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs index d1454fc9..8eca18b4 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs @@ -61,8 +61,6 @@ namespace Ryujinx.Graphics.Gpu.Image private int _textureBufferIndex; - private readonly float[] _scales; - private bool _scaleChanged; private int _lastFragmentTotal; /// @@ -72,14 +70,12 @@ namespace Ryujinx.Graphics.Gpu.Image /// The GPU channel that the texture bindings manager belongs to /// Texture pools cache used to get texture pools from /// Sampler pools cache used to get sampler pools from - /// Array where the scales for the currently bound textures are stored /// True if the bindings manager is used for the compute engine public TextureBindingsManager( GpuContext context, GpuChannel channel, TexturePoolCache texturePoolCache, SamplerPoolCache samplerPoolCache, - float[] scales, bool isCompute) { _context = context; @@ -87,7 +83,6 @@ namespace Ryujinx.Graphics.Gpu.Image _texturePoolCache = texturePoolCache; _samplerPoolCache = samplerPoolCache; - _scales = scales; _isCompute = isCompute; int stages = isCompute ? 1 : Constants.ShaderStages; @@ -239,12 +234,7 @@ namespace Ryujinx.Graphics.Gpu.Image } } - if (result != _scales[index]) - { - _scaleChanged = true; - - _scales[index] = result; - } + _context.SupportBufferUpdater.UpdateRenderScale(index, result); return changed; } @@ -290,11 +280,6 @@ namespace Ryujinx.Graphics.Gpu.Image // - Vertex stage has bindings that require scale. // - Fragment stage binding count has been updated since last render scale update. - _scaleChanged = true; - } - - if (_scaleChanged) - { if (!_isCompute) { total += fragmentTotal; // Add the fragment bindings to the total. @@ -302,9 +287,7 @@ namespace Ryujinx.Graphics.Gpu.Image _lastFragmentTotal = fragmentTotal; - _context.SupportBufferUpdater.UpdateRenderScale(_scales, total, fragmentTotal); - - _scaleChanged = false; + _context.SupportBufferUpdater.UpdateRenderScaleFragmentCount(total, fragmentTotal); } } -- cgit v1.2.3