From 1438cfe727adc7b6a5d84c76b0878ed77ef254a8 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 8 Mar 2026 10:13:01 +0100 Subject: feat: WGSL asset load-from-disk in dev mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - asset_packer: include WGSL in --disk_load path storage (alongside SPEC/MP3) - asset_manager: disk-load WGSL assets at runtime when !DEMO_STRIP_ALL - DemoCodegen: pass ASSET_PACKER_FLAGS to pack_test_assets so test assets also use disk-load paths in dev mode (fixes pre-existing SPEC/WGSL test failures) - test_shader_composer: fix stale assertions (fn test_wgsl → fn snippet_a, correct ordering check) 35/35 tests passing. handoff(Claude): WGSL disk-loading implemented. Shaders now loaded from disk in dev mode, enabling hot-reload without rebuild. Tests fixed. Co-Authored-By: Claude Sonnet 4.6 --- src/util/asset_manager.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/util') diff --git a/src/util/asset_manager.cc b/src/util/asset_manager.cc index 6cad083..1c02626 100644 --- a/src/util/asset_manager.cc +++ b/src/util/asset_manager.cc @@ -78,7 +78,8 @@ const uint8_t* GetAsset(AssetId asset_id, size_t* out_size) { #if !defined(DEMO_STRIP_ALL) if (source_record.type == AssetType::SPEC || - source_record.type == AssetType::MP3) { + source_record.type == AssetType::MP3 || + source_record.type == AssetType::WGSL) { const char* path = (const char*)source_record.data; FILE* f = fopen(path, "rb"); if (!f) { @@ -224,7 +225,8 @@ void DropAsset(AssetId asset_id, const uint8_t* asset) { #if !defined(DEMO_STRIP_ALL) if (g_asset_cache[index].data == asset && (g_asset_cache[index].type == AssetType::SPEC || - g_asset_cache[index].type == AssetType::MP3)) { + g_asset_cache[index].type == AssetType::MP3 || + g_asset_cache[index].type == AssetType::WGSL)) { delete[] g_asset_cache[index].data; g_asset_cache[index] = {}; } -- cgit v1.2.3