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;