summaryrefslogtreecommitdiff
path: root/src/gpu/effects/post_process_helper.h
AgeCommit message (Collapse)Author
15 hoursfix: Resolve WebGPU uniform buffer alignment issues (Task #74)skal
Fixed critical validation errors caused by WGSL vec3<f32> alignment mismatches. Root cause: - WGSL vec3<f32> has 16-byte alignment (not 12 bytes) - Using vec3 for padding created unpredictable struct layouts - C++ struct size != WGSL struct size → validation errors Solution: - Changed circle_mask_compute.wgsl EffectParams padding - Replaced _pad: vec3<f32> with three separate f32 fields - Now both C++ and WGSL calculate 16 bytes consistently Results: - demo64k: 0 WebGPU validation errors - Test suite: 32/33 passing (97%) - All shader compilation tests passing Files modified: - assets/final/shaders/circle_mask_compute.wgsl - TODO.md (updated task status) - PROJECT_CONTEXT.md (updated test results) - HANDOFF_2026-02-09_UniformAlignment.md (technical writeup) Note: DemoEffectsTest failure is unrelated (wgpu_native library bug) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
41 hoursstyle: Apply clang-format to all source filesskal
2 daysfeat(gpu): Systematize post-process bindings and enable vertex shader uniformsskal
- Add PP_BINDING_* macros for standard post-process bind group layout - PP_BINDING_SAMPLER (0): Input texture sampler - PP_BINDING_TEXTURE (1): Input texture from previous pass - PP_BINDING_UNIFORMS (2): Custom uniforms buffer - Change uniforms visibility from Fragment-only to Vertex|Fragment - Enables dynamic geometry in vertex shaders (e.g., peak meter bar) - Replace all hardcoded binding numbers with macros in post_process_helper.cc - Update test_demo.cc to use systematic bindings - Benefits: All post-process effects can now access uniforms in vertex shaders Result: More flexible post-process effects, better code maintainability
6 daysrefactor: Task #20 - Platform & Code Hygieneskal
- Consolidated all WebGPU shims and platform-specific logic into src/platform.h. - Refactored platform_init to return PlatformState by value and platform_poll to automatically refresh time and aspect_ratio. - Removed STL dependencies (std::map, std::vector, std::string) from AssetManager and Procedural subsystems. - Fixed Windows cross-compilation by adjusting include paths and linker flags in CMakeLists.txt and updating build_win.sh. - Removed redundant direct inclusions of GLFW/glfw3.h and WebGPU headers across the project. - Applied clang-format and updated documentation. handoff(Gemini): Completed Task #20 and 20.1. Platform abstraction is now unified, and core paths are STL-free. Windows build is stable.
9 daysChore: Apply clang-format to the codebaseskal
9 daysRefactor: Split demo effects and shaders into individual filesskal
Split src/gpu/demo_effects.cc into individual .cc files for each effect and created separate files for post-processing helpers and WGSL shaders. Updated src/gpu/demo_effects.h to be a central header for all effect-related declarations and adjusted CMakeLists.txt accordingly.