| Age | Commit message (Collapse) | Author |
|
Detect MP3 blobs by magic bytes in tracker_init(), decode to spectrogram
(hamming window + FDCT) using new mp3_decode(), and register with synth
exactly like .spec assets. STRIP_ALL builds guard with FATAL_CHECK.
handoff(Gemini): MP3 assets now usable in music.track with SAMPLE ASSET_*
syntax; see doc/TRACKER.md for usage. No synth/compiler/packer changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Adds mp3_open/mp3_decode_range/mp3_close API backed by miniaudio
ma_decoder for in-memory MP3 assets. Guarded by #if !defined(STRIP_ALL);
any use in stripped builds is a compile error. No new dependencies:
drmp3 is already compiled via MINIAUDIO_IMPLEMENTATION in audio.cc.
handoff(Gemini): mp3_sample.{h,cc} in AUDIO_SOURCES. Usage:
Mp3Decoder* d = mp3_open(GetAsset(id, &sz), sz);
mp3_decode_range(d, start_frame, num_frames, pcm_out);
mp3_close(d);
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
src/effects/
Move 13 effect-specific shaders from workspaces/main/shaders/ to src/effects/
so each effect's .h, .cc, and .wgsl are together. Update assets.txt paths in
both main and test workspaces. Update EFFECT_WORKFLOW.md to reflect new location.
Shared/reusable snippets remain in src/shaders/.
handoff(Gemini): shaders moved; src/effects/ now has .h, .cc, and .wgsl per effect.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
- Fix assets.txt path: shaders/xxx.wgsl (not ../../src/shaders/)
- Fix shader output path to workspaces/main/shaders/
- Step 5: reference cmake/DemoSourceLists.cmake COMMON_GPU_EFFECTS (not CMakeLists.txt GPU_SOURCES)
- Add step for test_demo_effects.cc
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Relocates shared WGSL shaders under src/ where all source code lives,
eliminating the top-level common/ directory.
- Update asset references in workspaces/main/assets.txt and workspaces/test/assets.txt
- Update docs: PROJECT_CONTEXT.md, ARCHITECTURE.md, WORKSPACE_SYSTEM.md, SHADER_REUSE_INVESTIGATION.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- asset_manager_dcl.h: clarify purpose vs asset_manager.h
- camera_params.h: broaden description to include 3D rendering
- sdf_cpu.h: simplify calc_normal formatting
- platform.h: add missing newline at EOF
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Keeps .h as declarations only; moves all method bodies to .cc.
Adds pipeline_builder.cc to COMMON_GPU_EFFECTS in DemoSourceLists.cmake.
handoff(Claude): pipeline_builder split to .h/.cc, builds clean.
|
|
get_or_create() and clear() moved out of the header-only class.
SamplerSpec and presets remain inline (trivial, no deps).
handoff(Gemini): sampler_cache split into .h/.cc, sampler_cache.cc added to COMMON_GPU_EFFECTS.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- Delete unused SDFEffect base class (src/gpu/sdf_effect.h)
- Delete sdf_test.wgsl and SHADER_SDF_TEST from assets.txt
- Rewrite SDF_EFFECT_GUIDE.md based on Scene1 canonical pattern:
correct bindings (2/3), vec4f syntax, UniformsSequenceParams
- Fix missing newline at end of gpu.h
handoff(Claude): SDF cleanup done, guide updated to match current Effect API
|
|
handoff(Gemini): deleted src/gpu/demo_effects.cc (empty stub), removed from
headless GPU_SOURCES in DemoSourceLists.cmake, dropped stale #include from
post_process_helper.cc.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
- NodeRegistry: skip external nodes (texture==nullptr) in ~NodeRegistry()
and resize() to avoid double-releasing views set via set_external_view()
- test_shader_assets: update PASSTHROUGH check to match #include pattern
handoff(Claude): 35/35 tests passing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
snippet
- Fix vs_main return type (VertexOutput, not vec4<f32>)
- Fix #include paths in passthrough, gaussian_blur, heptagon, combined_postprocess
- ShaderComposer: assert + suggest correct path on missing #include (non-STRIP_ALL)
- VerifyIncludes: upgrade WARNING to ERROR + assert, add "did you mean?" hint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- Fix stack-use-after-scope dangling reference by storing mutable GpuContext in WebGPUTestFixture.
- Fix wgpuDevicePoll causing SIGTRAP and replace with target.read_pixels() to block for GPU teardown safely.
- Fix WGPUCommandEncoder leak.
|
|
Replaces all instances of `vec<f32>` with the more concise `vec*f` alias (e.g., `vec3f`) across all `.wgsl` shaders. This improves readability and aligns with common graphics programming conventions.
Also adds a new coding style rule to `doc/CODING_STYLE.md` to enforce this standard going forward.
Finally, this commit fixes a build error in `test_effect_base.cc` by replacing a call to the non-existent `wgpuDeviceTick` with `wgpuDevicePoll`, which resolves the test failure.
|
|
The test `test_sequence_render` was disabled due to an intermittent SIGTRAP. The issue was caused by the test application exiting before the GPU finished rendering.
This commit fixes the issue by adding a call to `wgpuDeviceTick()` after submitting the command buffer. This ensures that the GPU has completed its work before the test finishes.
The test is now re-enabled and passes consistently.
|
|
|
|
Adds two convenient methods to the struct:
- : Rotates the vector by a given quaternion.
- : Rotates the vector around a given axis by an angle in radians.
These functions provide a more intuitive and streamlined syntax for vector rotation, improving code readability and usability.
|
|
|
|
|
|
Build camera via mat4::look_at + inverse in scene1_effect.cc, upload as
CameraParams at binding 3. Shader uses getCameraRay() from camera_common.
Enable camera_common snippet registration in shaders.cc.
handoff(Claude): Scene1 camera now driven by CameraParams uniform; fov=TAU/6 (60° vFOV) matches original tan(PI/3) parameterization.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- Add Scene1 effect: raymarching cube+sphere+ground (reflections, shadows)
- Fix scene1.wgsl: binding 0→2, CommonUniforms→UniformsSequenceParams
- Replace Heptagon+Placeholder stub in heptagon_scene with Scene1
- Fix seq_compiler.py: emit seq.start_time+effect.start/end (absolute times)
so dispatch_render active check works correctly for all sequences
Bug: effects in sequences starting after t=0 were never active because
local times (e.g. 0-8) never satisfied params.time<end for absolute time 20+.
34/34 tests passing.
handoff(Gemini): seq_compiler now emits absolute effect times. All existing
sequences affected — verify visual output across the full timeline.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Replace _pad with noise field in UniformsSequenceParams, providing
effects with non-deterministic random values [0..1] updated each frame.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Centralized uniforms_buffer_ initialization and updates to Effect base class:
- init_uniforms_buffer() now automatic in Effect::Effect()
- uniforms_buffer_.update() now automatic in dispatch_render()
- Removed redundant calls from all effect subclasses
- Updated effect.h comments to reflect automatic behavior
- Updated EFFECT_WORKFLOW.md templates
Benefits:
- 16 lines removed from effect implementations
- Consistent pattern enforced at compile time
- Reduced boilerplate for new effects
Tests: 34/34 passing
handoff(Claude): Effect base class now handles uniforms automatically
|
|
Introduces WGPUResource template with automatic release on destruction.
Reduces boilerplate in effect destructors and prevents resource leaks.
- set() for one-time initialization
- replace() for per-frame recreation
- Field ordering documented for dependency management
Converted 3 effects (Heptagon, Flash, Passthrough) and Effect base class.
All tests pass (34/34).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Eliminate ~100 lines of duplicated code across effect subclasses by moving common resource initialization to the base Effect class. Most effects repeatedly created uniforms buffers, samplers, and dummy textures with identical configurations.
Changes:
- Add shared members to Effect: uniforms_buffer_, sampler_, dummy_texture_*
- Add helpers: init_uniforms_buffer(), create_*_sampler(), create_dummy_scene_texture()
- Add gpu_create_*_sampler() and gpu_create_dummy_scene_texture() to gpu.h
- Move HEADLESS_RETURN_IF_NULL to Effect constructor
- Update 7 effects to use base class helpers (Flash, Heptagon, Passthrough, Placeholder, GaussianBlur, Particles, PeakMeter)
Benefits: Improved consistency, easier maintenance, reduced binary size.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Removed redundant and obvious comments from 7 GPU headers:
- post_process_helper.h: binding comments, stale UniformsSequenceParams note
- shader_composer.h: verbose Compose/VerifyIncludes descriptions
- uniform_helper.h: obvious method comments
- effect.h: redundant render/resize comments
- gpu.h: verbose struct/header comments, GPU perf placeholder
- sdf_effect.h: obvious method comments
- sequence.h: duplicate header, obvious API comments
Kept only non-obvious context (binding conventions, headless mode notes).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Removed outdated comments referencing old naming conventions and non-existent functions.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
This commit fixes several issues that caused the Windows cross-compilation build (`scripts/build_win.sh`) to fail.
The root causes were platform-specific API differences in the wgpu-native library and incorrect dependency tracking in the CMake build system for generated code.
Changes:
- **`tools/seq_compiler.py`**: The timeline generator now wraps `depthSlice` assignments in `#if !defined(DEMO_CROSS_COMPILE_WIN32)` directives to handle API differences in `WGPURenderPassColorAttachment`.
- **`src/gpu/gpu.h`**: The `gpu_init_color_attachment` helper is now platform-aware, using a preprocessor guard for the `depthSlice` member.
- **`src/effects/*.cc`**: All effects are updated to use the new platform-aware helper or have explicit guards for `depthSlice`. Also, replaced `WGPUTexelCopyTextureInfo` with the cross-platform alias `GpuTextureCopyInfo` in `rotating_cube_effect.cc`.
- **`cmake`**: Added `tools/seq_compiler.py` as an explicit dependency to the `generate_timeline` and `generate_test_demo_timeline` custom commands. This ensures that changes to the generator script correctly trigger a rebuild of the generated C++ files.
- **`scripts/build_win.sh`**: Removed the erroneous attempt to build the `seq_compiler.py` script as a native executable.
With these changes, the Windows cross-compilation build now completes successfully.
|
|
Refactors the SceneLoader class to a namespace. Since it only contained a single static utility function, a namespace is a more appropriate and idiomatic C++ construct. No functional changes.
|
|
|
|
Converts all static_cast<>, reinterpret_cast<> to C-style casts
per CODING_STYLE.md guidelines.
- Modified 12 files across gpu, 3d, util, tests, and tools
- All builds passing, 34/34 tests passing
- No functional changes, pure style cleanup
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Move platform-specific type definitions to gpu.h and establish coding rule
that platform ifdefs must be confined to gpu/platform layers.
- gpu.h: add GpuTextureCopyInfo, GpuTextureDataLayout type aliases
- effect.cc: use GpuTextureCopyInfo instead of platform ifdefs
- texture_manager.cc: use type aliases and label_view() helper
- CODING_STYLE.md: add platform-specific code section with rule
Tests: 34/34 passing
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Effects now accept start/end time parameters and automatically passthrough
when inactive. Implements buffer chain integrity via compile-time validation.
- Effect base class: dispatch_render() checks time bounds, auto-passthroughs
1:1 input/output effects outside [start, end] interval
- seq_compiler.py: validates producer/consumer lifespan constraints for
multi-output effects, adds --validate flag, always validates before codegen
- Updated all 9 effect classes and test fixtures to pass start/end times
- check_all.sh: includes timeline validation step
- Tests: 34/34 passing, demo runs successfully
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
|
|
- Removed unused v1 shader declarations (13 variables)
- Removed _v2 suffix from active shader names
- Moved shaders.{h,cc} from src/gpu to src/effects
- Updated all includes and build references
- All tests pass (34/34)
handoff(Claude): Cleaned up shader management, tests passing
|
|
Switches miniaudio from conservative to low_latency performance profile
to fix irregular beat timing on macOS. Conservative profile caused
uneven callback intervals, desynchronizing playback.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
- Change draw call from 21 to 3 vertices (fullscreen triangle)
- Replace broken folding-based SDF with IQ's atan-based regular polygon formula
- Simplify test timeline to render Heptagon directly to sink
- Reduce heptagon radius from 0.5 to 0.3 for better visibility
The effect was not visible due to incorrect vertex count and broken SDF
returning negative values everywhere (showing only fill color).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Hybrid3D was calling Renderer3D::render() which creates its own command
encoder, bypassing the sequence system. Now uses renderer_.draw() with
the passed encoder.
Also adds texture blit support for RotatingCube compositing.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
- Fix shader struct to match C++ (add strength_audio, stretch)
- Increase default blur strength to 8.0 for visibility
- Add blur effect to test sequence for validation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Update effect class definitions in headers and implementations to match
timeline.seq naming convention. All tests passing (34/34).
Classes renamed:
- PassthroughEffect → Passthrough
- GaussianBlurEffect → GaussianBlur
- PlaceholderEffect → Placeholder
- HeptagonEffect → Heptagon
- ParticlesEffect → Particles
- RotatingCubeEffect → RotatingCube
- Hybrid3DEffect → Hybrid3D
- FlashEffect → Flash
- PeakMeterEffect → PeakMeter
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Ports PeakMeterEffect to v2 Effect system with proper DAG routing.
Red horizontal bar overlay displays audio_intensity for visual debugging
of audio-visual synchronization.
Changes:
- New: src/effects/peak_meter_effect.{h,cc} - v2 implementation
- Timeline: FlashEffect -> flash_out -> PeakMeterEffect -> sink
- Build: Added to COMMON_GPU_EFFECTS and demo_effects.h
- Test: Added to test_demo_effects.cc (9/9 effects pass)
- Cleanup: Removed old disabled PeakMeterEffect code from test_demo.cc
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
- seq_compiler.py: Calculate beat_phase from beat_time (was hardcoded 0.0f)
- Refactor: Replace CommonPostProcessUniforms with UniformsSequenceParams
- Remove duplicate struct definition in post_process_helper.h
- Update all CNN effects and tests to use unified uniform struct
- Fixes FlashEffect showing solid white instead of flashing to beat
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
RotatingCubeEffect was failing with "Unable to find entry point 'vs_main'"
because shader was hardcoded to empty string. Load from ASSET_SHADER_ROTATING_CUBE_V2.
Fixes DemoEffectsTest (34/34 tests now pass).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
WGPU_DEPTH_SLICE_UNDEFINED is defined unconditionally via platform.h
(native headers or Win32 macro). Remove redundant conditional compilation
from 7 effects and gpu.h helper.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
- FlashEffect: Beat-synchronized white flash using ShaderComposer
- Loads shader from assets (flash.wgsl) with sequence_uniforms include
- Uses pow(1.0 - beat_phase, 4.0) for sharp flash at beat start
- Updated test_demo.seq to use FlashEffect (was HeptagonEffect)
- Added FlashEffect to test suite (test_demo_effects.cc)
- Made cnn_test conditional on main workspace (fixes build error)
- Flash intensity: 1.0 at beat start, fades to 0.0 by beat end
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Function had no implementation and served no purpose. Removed declaration, definition, and all call sites.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Added HEADLESS_RETURN_IF_NULL/HEADLESS_RETURN_VAL_IF_NULL macros
that compile to no-ops in STRIP_ALL/FINAL_STRIP modes.
Files updated:
- fatal_error.h: New headless check macros
- sequence.cc: NodeRegistry::create_texture
- post_process_helper.cc: Pipeline creation functions
- sampler_cache.h: SamplerCache::get_or_create
- bind_group_builder.h: Layout/group builders
- pipeline_builder.h: Shader and pipeline builders
- All effect constructors (7 files)
Headless tests passing. STRIP_ALL builds will have zero overhead.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|