From c712874ece1ca7073904f5fb84cc866d28084de0 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 9 Feb 2026 13:52:37 +0100 Subject: feat(gpu): Add GPU procedural texture generation system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 1 implementation complete: - GPU compute shader for noise generation (gen_noise.wgsl) - TextureManager extensions: create_gpu_noise_texture(), dispatch_noise_compute() - Asset packer PROC_GPU() syntax support with validation - ShaderComposer integration for #include resolution - Zero CPU memory overhead (GPU-only textures) - Init-time and on-demand generation modes Technical details: - 8×8 workgroup size for 256×256 textures - UniformBuffer for params (width, height, seed, frequency) - Storage texture binding (rgba8unorm, write-only) - Lazy pipeline compilation on first use - ~300 bytes code (Phase 1) Testing: - New test: test_gpu_procedural.cc (passes) - All 34 tests passing (100%) Future phases: - Phase 2: Add gen_perlin, gen_grid compute shaders - Phase 3: Variable dimensions, async generation Co-Authored-By: Claude Sonnet 4.5 --- src/util/asset_manager.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/util') diff --git a/src/util/asset_manager.h b/src/util/asset_manager.h index 1e0638c..168bfca 100644 --- a/src/util/asset_manager.h +++ b/src/util/asset_manager.h @@ -10,6 +10,7 @@ struct AssetRecord { size_t size; // Size of the asset data bool is_procedural; // True if data was dynamically allocated by a procedural // generator + bool is_gpu_procedural; // True if GPU compute shader generates texture const char* proc_func_name_str; // Name of procedural generation function // (string literal) const float* proc_params; // Parameters for procedural generation (static, -- cgit v1.2.3