aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGamer64 <gamer64@eden-emu.dev>2025-10-01 01:21:12 +0200
committercrueter <crueter@eden-emu.dev>2025-10-01 01:21:12 +0200
commit43a7470a7d09ad412c7d9815ae23402f4bb7acb0 (patch)
treee477db8e86414d7b48f54fb5e3b13da6071988b8
parentdfca07f4e3df72b243828268d0a3c4a49279ff9f (diff)
[Maxwell]: Fix shaders compilation memory leak (#2606)
Co-authored-by: collecting <collecting@citron-emu.org> "The ObjectPool<Statement> was never being cleared after use. When compiling complex shaders, this would allocate gigabytes of memory, causing the emulator to run out of RAM and be killed by the operating system. This is a critical fix that prevents out-of-memory crashes on all operating systems when playing games with complex shaders." Co-authored-by: Gamer64 <76565986+Gamer64ytb@users.noreply.github.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2606 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Co-authored-by: Gamer64 <gamer64@eden-emu.dev> Co-committed-by: Gamer64 <gamer64@eden-emu.dev>
-rw-r--r--src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
index b5e1e70b4c..6d325b4aad 100644
--- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
+++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
@@ -991,6 +991,7 @@ IR::AbstractSyntaxList BuildASL(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::
Statement& root{goto_pass.RootStatement()};
IR::AbstractSyntaxList syntax_list;
TranslatePass{inst_pool, block_pool, stmt_pool, env, root, syntax_list, host_info};
+ stmt_pool.ReleaseContents();
return syntax_list;
}