From a109983c194c45ad85f0e481232bc605c7cfd85b Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 13 Feb 2026 08:34:24 +0100 Subject: Remediation: Implement shared common/shaders/ directory Eliminates 36 duplicate shader files across workspaces. Structure: - common/shaders/{math,render,compute}/ - Shared utilities (20 files) - workspaces/*/shaders/ - Workspace-specific only Changes: - Created common/shaders/ with math, render, compute subdirectories - Moved 20 common shaders from workspaces to common/ - Removed duplicates from test workspace - Updated assets.txt: ../../common/shaders/ references - Enhanced asset_packer.cc: filesystem path normalization for ../ resolution Implementation: Option 1 from SHADER_REUSE_INVESTIGATION.md - Single source of truth for common code - Workspace references via relative paths - Path normalization in asset packer handoff(Claude): Common shader directory implemented --- tools/asset_packer.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/asset_packer.cc') diff --git a/tools/asset_packer.cc b/tools/asset_packer.cc index 4aaa0e7..5646716 100644 --- a/tools/asset_packer.cc +++ b/tools/asset_packer.cc @@ -6,6 +6,7 @@ #include #include // for simplicity, use fprintf() for output generation #include // For std::memcpy +#include // For path normalization #include #include #include // For std::regex @@ -320,7 +321,9 @@ int main(int argc, char* argv[]) { if (!info.is_procedural) { std::string base_dir = assets_txt_path.substr(0, assets_txt_path.find_last_of("/\\") + 1); - std::string full_path = base_dir + info.filename; + std::filesystem::path base_path = std::filesystem::absolute(base_dir); + std::filesystem::path combined_path = base_path / info.filename; + std::string full_path = combined_path.lexically_normal().string(); std::vector buffer; bool is_image = HasImageExtension(info.filename); -- cgit v1.2.3