From a8ce91ffbdb3881adec2dd01735c716796899984 Mon Sep 17 00:00:00 2001 From: Lucas Alber Date: Thu, 7 Nov 2024 10:09:20 +0100 Subject: [PATCH] merian: Context: Search merian-shaders in all parent paths --- src/merian/vk/context.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/merian/vk/context.cpp b/src/merian/vk/context.cpp index 8d54356..ad4b28e 100644 --- a/src/merian/vk/context.cpp +++ b/src/merian/vk/context.cpp @@ -541,11 +541,17 @@ void Context::prepare_shader_include_defines() { std::filesystem::path(MERIAN_INSTALL_INCLUDE_DIR); if (FileLoader::exists(development_headers / "merian-shaders")) { - SPDLOG_DEBUG("found merian-shaders development headers headers at {}", development_headers.string()); + SPDLOG_DEBUG("found merian-shaders development headers headers at {}", + development_headers.string()); default_shader_include_paths.emplace_back(development_headers.string()); } else if (FileLoader::exists(installed_headers / "merian-shaders")) { SPDLOG_DEBUG("found merian-shaders installed at {}", installed_headers.string()); default_shader_include_paths.emplace_back(installed_headers.string()); + } else if (const std::optional headers = + FileLoader::search_cwd_parents("include/merian-shaders"); + headers.has_value()) { + SPDLOG_DEBUG("found merian-shaders at {}", headers->parent_path().string()); + default_shader_include_paths.emplace_back(headers->parent_path().string()); } else { SPDLOG_ERROR("merian-shaders header not found! Shader compilers might not work correctly"); }