From 0c4a5f54f23d9204634d6359fddf01b7b7f46326 Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Mon, 9 Jun 2025 00:25:50 +0800 Subject: [PATCH] [Fix] (Diligent/PSO): Avoid adding duplicate shader resources. --- MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp b/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp index 620dee05..fb8f1067 100644 --- a/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp +++ b/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp @@ -214,7 +214,7 @@ namespace MG_Diligent { PSOKey key{program, currentStateHash}; auto it = psoCache.find(key); - if (it != psoCache.end()) { + if (it != psoCache.end() && it->second) { return it->second; } @@ -302,6 +302,8 @@ namespace MG_Diligent { static std::vector Variables; static std::vector ImmutableSamplers; + Variables.clear(); + ImmutableSamplers.clear(); MG_Global::unordered_map shaderSourcesMap;