From 4c21145ce5e408dd38e8374eed320fcfac97c0c4 Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 13 Feb 2026 16:54:47 +0100 Subject: CNN v2: Add TODO for flexible feature layout in binary format v3 Document future enhancement for arbitrary feature vector layouts. Proposed feature descriptor in binary format v3: - Specify feature types, sources, and ordering - Enable runtime experimentation without shader recompilation - Examples: [R,G,B,dx,dy,uv_x,bias] or [mip1.r,mip2.g,laplacian,uv_x,sin20_x,bias] Added TODOs in: - CNN_V2_BINARY_FORMAT.md: Detailed proposal with struct layout - CNN_V2.md: Future extensions section - train_cnn_v2.py: compute_static_features() docstring - cnn_v2_static.wgsl: Shader header comment - cnn_v2_effect.cc: Version check comment Current limitation: Hardcoded [p0,p1,p2,p3,uv_x,uv_y,sin10_x,bias] layout. Co-Authored-By: Claude Sonnet 4.5 --- src/gpu/effects/cnn_v2_effect.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gpu/effects/cnn_v2_effect.cc') diff --git a/src/gpu/effects/cnn_v2_effect.cc b/src/gpu/effects/cnn_v2_effect.cc index 97e4790..566686e 100644 --- a/src/gpu/effects/cnn_v2_effect.cc +++ b/src/gpu/effects/cnn_v2_effect.cc @@ -88,6 +88,7 @@ void CNNv2Effect::load_weights() { FATAL_CHECK(magic != 0x324e4e43, "Invalid CNN v2 weights magic\n"); // 'CNN2' // Support both version 1 (16-byte header) and version 2 (20-byte header with mip_level) + // TODO: Version 3 should include feature descriptor for arbitrary layout/ordering if (version == 1) { mip_level_ = 0; // Default for v1 } else if (version == 2) { -- cgit v1.2.3