From ebecbc6d90739044bb4965718ed7ac516886a61c Mon Sep 17 00:00:00 2001 From: andy840119 Date: Thu, 7 Oct 2021 00:42:10 +0900 Subject: [PATCH] to make sure that re-create framebuffer will clear exist frame buffer also. --- .../Graphics/MultiShaderBufferedDrawNodeSharedData.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Framework.Font/Graphics/MultiShaderBufferedDrawNodeSharedData.cs b/osu.Framework.Font/Graphics/MultiShaderBufferedDrawNodeSharedData.cs index ba432fc..3207e9a 100644 --- a/osu.Framework.Font/Graphics/MultiShaderBufferedDrawNodeSharedData.cs +++ b/osu.Framework.Font/Graphics/MultiShaderBufferedDrawNodeSharedData.cs @@ -26,7 +26,7 @@ public MultiShaderBufferedDrawNodeSharedData(RenderbufferInternalFormat[] format public void CreateDefaultFrameBuffers(IShader[] shaders) { - shaderBuffers.Clear(); + clearBuffers(); var filterMode = PixelSnapping ? All.Nearest : All.Linear; @@ -57,7 +57,11 @@ public FrameBuffer[] GetDrawFrameBuffers() protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); + clearBuffers(); + } + private void clearBuffers() + { // clear all frame in the dictionary. foreach (var shaderBuffer in shaderBuffers) {