mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-06-09 10:06:34 +02:00
Always clean up render handle state after overlay draws (#6508)
* Always clean up render handle state after overlay draws * i just forgot to commit that part i guess --------- Co-authored-by: mirrorcult <mirrorcult@pm.me>
This commit is contained in:
@@ -163,7 +163,15 @@ namespace Robust.Client.Graphics.Clyde
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logManager.GetSawmill("clyde.overlay").Error($"Caught exception while drawing overlay {overlay.GetType()}. Exception: {e}");
|
||||
_logManager.GetSawmill("clyde.overlay")
|
||||
.Error($"Caught exception while drawing overlay {overlay.GetType()}. Exception: {e}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
// cleanup state so shaders/transforms dont leak into future overlays
|
||||
// many overlays already do cleanup manually, but ideally they don't have to at all
|
||||
_renderHandle.SetModelTransform(Matrix3x2.Identity);
|
||||
_renderHandle.UseShader(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +235,16 @@ namespace Robust.Client.Graphics.Clyde
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logManager.GetSawmill("clyde.overlay").Error($"Caught exception while drawing overlay {overlay.GetType()}. Exception: {e}");
|
||||
_logManager.GetSawmill("clyde.overlay")
|
||||
.Error($"Caught exception while drawing overlay {overlay.GetType()}. Exception: {e}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
// cleanup state so shaders/transforms dont leak into future overlays
|
||||
// many overlays already do cleanup manually, but ideally they don't have to at all
|
||||
// screen and world handles are backed by the same renderhandle, so we only need to do this for one
|
||||
handle.DrawingHandleScreen.SetTransform(Matrix3x2.Identity);
|
||||
handle.DrawingHandleScreen.UseShader(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user