From 94df5a1bb429b54463caa1c05b62d14df0da3ae1 Mon Sep 17 00:00:00 2001 From: Filoppi Date: Fri, 12 Jul 2024 15:23:49 +0300 Subject: [PATCH] Fix "unload shaders" button not disabling test on all shaders --- src/devkit/addon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devkit/addon.cpp b/src/devkit/addon.cpp index 39d81104..f9a70e2e 100644 --- a/src/devkit/addon.cpp +++ b/src/devkit/addon.cpp @@ -231,9 +231,9 @@ void UnloadCustomShaders(const std::unordered_set& pipelines_filter = auto& cached_pipeline = pair.second; if (cached_pipeline == nullptr || (!pipelines_filter.empty() && !pipelines_filter.contains(cached_pipeline->pipeline.handle))) continue; + cached_pipeline->test = false; // Disable testing here, otherwise we might not always have a way to do it if (!cached_pipeline->cloned) continue; cached_pipeline->cloned = false; // This stops the cloned pipeline from being used in the next frame, allowing us to destroy it - cached_pipeline->test = false; // Disable testing here, otherwise we might not always have a way to do it cached_pipeline->compilation_error.clear(); cloned_pipeline_count--; cloned_pipelines_changed = true; @@ -1130,7 +1130,7 @@ void OnBindPipeline( auto* cached_pipeline = pair->second; if (cached_pipeline->test) { - // This will make the shader output black, or skip drawing, so we can easily detect it. This might not be very safe but seems to work. + // This will make the shader output black, or skip drawing, so we can easily detect it. This might not be very safe but seems to work in DX11. // TODO: replace the pipeline with a shader that outputs all "SV_Target" as purple for more visiblity cmd_list->bind_pipeline(stages, reshade::api::pipeline{0}); }