diff --git a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheHostStorage.cs b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheHostStorage.cs index 3f3c3723dc..32a592cb91 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheHostStorage.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheHostStorage.cs @@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache private const ushort FileFormatVersionMajor = 1; private const ushort FileFormatVersionMinor = 2; private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor; - private const uint CodeGenVersion = 7332; + private const uint CodeGenVersion = 6877; private const string SharedTocFileName = "shared.toc"; private const string SharedDataFileName = "shared.data"; diff --git a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ParallelDiskCacheLoader.cs b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ParallelDiskCacheLoader.cs index 2661a828ba..1aec895f03 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ParallelDiskCacheLoader.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ParallelDiskCacheLoader.cs @@ -22,6 +22,8 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache private readonly CancellationToken _cancellationToken; private readonly Action _stateChangeCallback; + private readonly HashSet _pipelineStateSet = new(); + /// /// Indicates if the cache should be loaded. /// @@ -302,7 +304,6 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache using var streams = _hostStorage.GetOutputStreams(_context); int packagedShaders = 0; - ProgramPipelineState previousPipelineState = default; ProgramPipelineState currentPipelineState = default; foreach (var kv in _programList) @@ -333,7 +334,6 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache currentPipelineState.PrimitiveRestartEnable = false; currentPipelineState.BiasEnable = 0; currentPipelineState.RasterizerDiscard = false; - } if (_context.Capabilities.SupportsLogicOpDynamicState) @@ -347,19 +347,20 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache } } - if (!currentPipelineState.Equals(previousPipelineState) || !_context.Capabilities.SupportsExtendedDynamicState || !program.SpecializationState.PipelineState.HasValue) + if (!_pipelineStateSet.Contains(currentPipelineState) || + !_context.Capabilities.SupportsExtendedDynamicState || + !program.SpecializationState.PipelineState.HasValue) { _hostStorage.AddShader(_context, program, binaryCode, streams); _stateChangeCallback(ShaderCacheState.Packaging, ++packagedShaders, _programList.Count); - } - if (_context.Capabilities.SupportsExtendedDynamicState) - { - previousPipelineState = currentPipelineState; + if (_context.Capabilities.SupportsExtendedDynamicState) + { + _pipelineStateSet.Add(currentPipelineState); + } } } - Logger.Info?.Print(LogClass.Gpu, $"Rebuilt {packagedShaders} shaders successfully."); } else