mirror of
https://github.com/osukey/osukey.git
synced 2025-06-08 04:48:04 +09:00
Merge pull request #23111 from peppy/fix-debug-perf-drd
Fix abysmal debug performance due to try-catch logic in `DrawableRulesetDependencies`
This commit is contained in:
commit
aa94e61559
@ -206,7 +206,13 @@ namespace osu.Game.Rulesets.UI
|
|||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When the debugger is attached, exceptions are expensive.
|
||||||
|
// Manually work around this by caching failed lookups and falling back straight to parent.
|
||||||
|
private readonly HashSet<(string, string)> failedLookups = new HashSet<(string, string)>();
|
||||||
|
|
||||||
public override IShader Load(string vertex, string fragment)
|
public override IShader Load(string vertex, string fragment)
|
||||||
|
{
|
||||||
|
if (!failedLookups.Contains((vertex, fragment)))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -215,9 +221,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
// Shader lookup is very non-standard. Rather than returning null on missing shaders, exceptions are thrown.
|
// Shader lookup is very non-standard. Rather than returning null on missing shaders, exceptions are thrown.
|
||||||
|
failedLookups.Add((vertex, fragment));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return parent.Load(vertex, fragment);
|
return parent.Load(vertex, fragment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user