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:
mirrorcult
2026-05-05 10:44:42 +00:00
committed by GitHub
parent 17a15b15d7
commit f95a16cf2e
+19 -2
View File
@@ -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);
}
}
}