File tree Expand file tree Collapse file tree
source/funkin/backend/system Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,6 +162,8 @@ class Main extends Sprite
162162 initTransition ();
163163 }
164164
165+ static var persistShaderKeys : Map <String , Bool >;
166+
165167 public static function refreshAssets () @:privateAccess {
166168 FunkinCache .instance .clearSecondLayer ();
167169
@@ -178,6 +180,18 @@ class Main extends Sprite
178180 }
179181
180182 game .addChildAt (game .soundTray = daSndTray , index );
183+
184+ if (persistShaderKeys == null ) {
185+ persistShaderKeys = [for (k in @:privateAccess Lib .current .stage .context3D .__programs .keys ()) k => true ];
186+ }
187+ else {
188+ for (key => program in @:privateAccess Lib .current .stage .context3D .__programs ) {
189+ if (persistShaderKeys .get (key ) || Type .resolveClass (key ) != null ) continue ;
190+
191+ program .dispose ();
192+ @:privateAccess Lib .current .stage .context3D .__programs .remove (key );
193+ }
194+ }
181195 }
182196
183197 public static function initTransition () {
You can’t perform that action at this time.
0 commit comments