-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23034 from peppy/fix-ruleset-shader-caching
Fix stutters during gameplay due to shaders not correctly using cache
- Loading branch information
Showing
8 changed files
with
43 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
|
@@ -51,9 +49,11 @@ public void TestRetrieveSample() | |
[Test] | ||
public void TestRetrieveShader() | ||
{ | ||
AddAssert("ruleset shaders retrieved", () => | ||
Dependencies.Get<ShaderManager>().LoadRaw(@"sh_TestVertex.vs") != null && | ||
Dependencies.Get<ShaderManager>().LoadRaw(@"sh_TestFragment.fs") != null); | ||
AddStep("ruleset shaders retrieved without error", () => | ||
{ | ||
Dependencies.Get<ShaderManager>().LoadRaw(@"sh_TestVertex.vs"); | ||
Dependencies.Get<ShaderManager>().LoadRaw(@"sh_TestFragment.fs"); | ||
}); | ||
} | ||
|
||
[Test] | ||
|
@@ -76,12 +76,12 @@ public TestRuleset() | |
} | ||
|
||
public override IResourceStore<byte[]> CreateResourceStore() => new NamespacedResourceStore<byte[]>(TestResources.GetStore(), @"Resources"); | ||
public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new TestRulesetConfigManager(); | ||
public override IRulesetConfigManager CreateConfig(SettingsStore? settings) => new TestRulesetConfigManager(); | ||
|
||
public override IEnumerable<Mod> GetModsFor(ModType type) => Array.Empty<Mod>(); | ||
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => null; | ||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => null; | ||
public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => null; | ||
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => null!; | ||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => null!; | ||
public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => null!; | ||
} | ||
|
||
private class TestRulesetConfigManager : IRulesetConfigManager | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters