From f4db6dc0e7ce889cbf43b797216cc104df3aaf17 Mon Sep 17 00:00:00 2001 From: Ole Bueker Date: Fri, 10 Jul 2026 08:42:48 +0200 Subject: [PATCH] fix(shaderdebugger): wire Refresh All to reload tracked shaders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Shader Debugger panel's "Refresh All" button was a no-op TODO. Wire it to ShaderLibrary::ReloadShaders() for both the 3D and 2D shader libraries — the same reload path (Shader::Reload()) used by the filewatch hot-reload and already exposed to Lua/C# scripting and the olo_shader_reload MCP tool, so compile errors surface identically via the existing OnCompilationEnd/OnReloadEnd hooks. Fixes #594 Co-Authored-By: Claude Sonnet 5 --- .../src/OloEngine/Renderer/Debug/ShaderDebugger.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OloEngine/src/OloEngine/Renderer/Debug/ShaderDebugger.cpp b/OloEngine/src/OloEngine/Renderer/Debug/ShaderDebugger.cpp index 55f7aecc6..60d701edc 100644 --- a/OloEngine/src/OloEngine/Renderer/Debug/ShaderDebugger.cpp +++ b/OloEngine/src/OloEngine/Renderer/Debug/ShaderDebugger.cpp @@ -2,6 +2,8 @@ #include "ShaderDebugger.h" #include "OloEngine/Core/Log.h" #include "OloEngine/Core/Application.h" +#include "OloEngine/Renderer/Renderer2D.h" +#include "OloEngine/Renderer/Renderer3D.h" #include "OloEngine/Threading/UniqueLock.h" #include @@ -963,7 +965,13 @@ namespace OloEngine // Bottom controls if (ImGui::Button("Refresh All")) { - // TODO(olbu): Trigger reload of all shaders (#594) + // Same reload path the filewatch hot-reload uses (ShaderLibrary::ReloadShaders() + // -> Shader::Reload() per shader) so compile errors surface identically — via + // OLO_SHADER_COMPILATION_END / OnReloadEnd, both invoked from Reload() itself. + // Must run on the render/main thread: Reload() recompiles GL programs directly. + OLO_CORE_INFO("ShaderDebugger: Refresh All triggered — reloading all tracked shaders"); + Renderer3D::GetShaderLibrary().ReloadShaders(); + Renderer2D::GetShaderLibrary().ReloadShaders(); } ImGui::SameLine(); if (ImGui::Button("Clear Selection"))