| Age | Commit message (Collapse) | Author |
|
project_init.sh now checks/installs both wgpu-native and glfw via brew.
HOWTO.md documents the macOS prerequisites before the build steps.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
asset_packer now emits a zero-size empty stub for BINARY assets whose
file is not found, and continues with a warning rather than aborting.
Allows building without optional assets like cnn_v2_weights.bin.
handoff(Gemini): asset_packer tolerates missing BINARY files; GetAsset()
returns nullptr/size=0 for those assets at runtime.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Wine/Vulkan returns WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal
instead of SuccessOptimal, causing the blit pass to be skipped entirely
and the window to stay black.
Fixed in seq_compiler.py (the source template); regenerated timeline.cc.
Tests: 35/35.
handoff(Gemini): Wine black screen fixed — root cause was status code
check rejecting suboptimal swapchain; exe now renders on Wine.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
assets_data.cc was shared in src/generated/ across all builds. When a
native debug build regenerated it with --disk_load (file paths), then
build_win compiled with STRIP_ALL=ON, the disk-load fopen() path was
compiled out, leaving raw macOS paths as shader source content — causing
wgpu WGSL parse errors on Wine.
Fix: GEN_DEMO_H/CC and all stamps now live in CMAKE_CURRENT_BINARY_DIR/
src/generated/ so each build dir independently generates assets in the
correct mode (embedded vs disk-load). Added CMAKE_CURRENT_BINARY_DIR/src
to CORE_INCLUDES so the binary-dir assets.h is resolved first.
handoff(Gemini): build system fix — assets are now per-build-dir; tests
35/35 pass; build_win produces embedded shaders.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Write asset_packer_mode.flag at configure time so that switching between
disk-load (debug) and embedded (STRIP_ALL) modes invalidates assets_data.cc.
Previously a stale embedded assets_data.cc caused fopen() on WGSL bytes,
silently failing all shader snippet registration (vs_main not found crash).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
demo64k.exe runs under Wine but renders no visuals. Audio/timeline work.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- fetch_win_deps.sh: update wgpu-native v0.19.4.1 → v27.0.4.0 (same as macOS)
- platform.h: remove v0.19 compat shims, Windows now uses WGPUStringView API
- gpu.cc/gpu.h: remove DEMO_CROSS_COMPILE_WIN32 old-API branches
- texture_readback.cc, visual_debug.cc, hybrid3d_effect.cc: same cleanup
- rotating_cube_effect.cc: remove #ifdef guard for depthSlice
- glfw3webgpu.c: remove old WGPUSurfaceDescriptorFromWindowsHWND branch
- asset_manager.cc: fix DEMO_STRIP_ALL→STRIP_ALL guard (vs_main was missing
in STRIP_ALL Windows builds because disk-loading path ran on embedded data)
- tracker.cc: skip MP3 assets gracefully in STRIP_ALL builds instead of fatal
handoff(Gemini): Windows .exe now runs under Wine. demo64k.exe renders frames
and progresses through audio timeline. Pre-existing test failures unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
gpu_create_linear_sampler, gpu_create_nearest_sampler, and
gpu_create_dummy_scene_texture were defined only in gpu.cc, causing
link errors in DEMO_HEADLESS mode.
handoff(Gemini): headless mode link error fixed, 35/35 tests should still pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
m[5] = -1/tan(fov/2); larger FOV yields smaller magnitude (closer to 0),
so proj_varied.m[5] > proj.m[5], not <.
handoff(Gemini): fixed ThreeDSystemTest assertion in test_3d.cc:43
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
- particles: stagger respawn y by golden-ratio index offset to break
per-row synchronization (100 particles per row fell in lock-step)
- heptagon: fix swapped atan2(x,y)->atan2(y,x) and WGSL % truncation
for negative angles (broke SDF for entire lower half of shape)
handoff(Gemini): heptagon now correct; particles desynchronized
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Missing wgpuComputePassEncoderRelease/wgpuRenderPassEncoderRelease
caused per-frame leaks and command buffer corruption in wgpu-native.
handoff(Gemini): particles encoder leak fixed, 2 lines added to render()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
|
|
Add CLASS_TO_HEADER override map for classes that share a header file.
NtscYiq lives in ntsc_effect.h alongside Ntsc.
handoff(Gemini): seq_compiler.py fix for shared-header effect classes.
|
|
- Extract shared NTSC logic into render/ntsc_common.wgsl snippet
- sample_ntsc_signal() hook decouples input format from processing
- ntsc_rgb.wgsl: RGB input (converts via rgba_to_luma_chroma_phase)
- ntsc_yiq.wgsl: YIQ passthrough for RotatingCube output
- Add NtscYiq WgslEffect thin wrapper; register both in tests
handoff(Claude): NTSC refactor complete; NtscYiq ready for timeline use with RotatingCube.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
rotating_cube_effect.cc was bypassing ShaderComposer, causing #include
directives in rotating_cube.wgsl to fail at runtime.
handoff(Claude): ShaderComposer rule documented and enforced in rotating_cube.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Add rule to CODING_STYLE.md and apply to ntsc.wgsl.
handoff(Claude): rule added, ntsc.wgsl patched; scratch_lines and color_c64 already compliant.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
handoff(Gemini): SEQUENCE.md updated - removed obsolete v1 migration
notes, updated effect count 7→12, added absolute-time note, removed
completed TODO items.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
|
|
|
|
- math/color.wgsl: add rgba_to_yiqa, yiqa_to_rgba, rgba_to_luma_chroma_phase
- math/color_c64.wgsl: new file with C64 palette, Bayer 8x8, Dither()
- ntsc.wgsl: include both, remove local duplicates; Dither() now takes xsize/ysize
handoff(Claude): YIQ/dither helpers now reusable by other effects
|
|
|
|
|
|
- Replace _dbg_pixel() with _dbg_char(ascii, r, c) covering
printable ASCII 0x20-0x7E (95 glyphs, C64-style 8x8 bitmaps)
- Update debug_f32() to use ASCII codes directly
- Add debug_str(col, pos, origin, s: vec4u, len) for rendering
up to 16 chars packed 4-per-u32 big-endian
handoff(Claude): debug_print now supports full ASCII strings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
The fullscreen post-process VS uses Y-up UVs (uv.y=0 = bottom), so
textureSample() Y-flips any rasterized offscreen texture. SDF effects
author their content Y-down and look correct after the flip. Rasterized
effects (RotatingCube, Hybrid3D) must pre-flip their geometry:
- mat4::perspective(): m[5] = -t (negated Y scale)
- Pipelines with cullMode=Back: frontFace = WGPUFrontFace_CW (Y-flip
reverses winding, so CW becomes the visible face)
- Remove incorrect transposes from GlobalUniforms::make(),
ObjectData::make(), and Uniforms::make() — mini_math is column-major,
no transpose needed for GPU upload
- Document the convention in doc/3D.md under "Rasterized 3D and the
Y-flip rule"
handoff(Gemini): Y-flip rule now documented; all rasterized 3D pipelines
must follow it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Add SHADER_DEBUG_DEBUG_PRINT to assets.txt and register it as
"debug/debug_print" in InitShaderComposer() so ntsc.wgsl #include works.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Renders a f32 value (±999.999, 3 decimal digits) at a given screen
position using authentic C64 8x8 bitmap glyphs in yellow.
Usage: col = debug_f32(col, pos.xy, vec2f(10.0, 10.0), value);
Include: #include "debug/debug_print"
handoff(Gemini): new snippet at src/shaders/debug/debug_print.wgsl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
mini_math mat4 is row-major; WGSL mat4x4f is column-major. Matrices
uploaded without transposing were interpreted as their own transpose on
the GPU, causing RotatingCube and Renderer3D to render upside-down.
- Add gpu_upload_mat4() to post_process_helper for standalone uploads
- Add Uniforms::make() to RotatingCube::Uniforms (handles transpose)
- Add GlobalUniforms::make() and ObjectData::make() to renderer.h
- Update renderer_draw.cc and visual_debug.cc to use make()
handoff(Gemini): matrix layout bug fixed across all rasterized effects.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
WGSL shaders now join SPEC/MP3 in being loaded from disk in development
mode, enabling shader iteration without rebuild.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- 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 <noreply@anthropic.com>
|
|
- Updated 'src/tests/gpu/test_shader_composer.cc' to use 'ASSET_TEST_WGSL' and simplified the test.
- Overhauled 'src/tests/assets/test_assets.cc' to align with the new, more concise test asset manifest, resolving compilation errors and improving test focus.
|
|
Updated 'workspaces/test/assets.txt' to use the new explicit asset types, resolving a compilation error in the generated test assets.
Also, streamlined the asset list to include only a few representative examples, which will result in a more concise and focused generated test file.
|
|
Replaced the deleted 'AssetType::STATIC' with 'AssetType::BINARY' as the default return value for invalid asset IDs.
|
|
This commit introduces a dual-mode asset loading system to enhance developer workflow and optimize release builds.
Key changes include:
- **Dual-Mode Asset Loading:** Assets are now loaded from disk during development (when is OFF) for faster iteration, particularly for heavy assets like and files. For release builds ( ON), all assets are embedded directly into the binary, ensuring a single, self-contained executable.
- **Explicit Asset Typing:** Replaced generic asset type with specific types (, , , , ) in and the enum in for clearer categorization and more robust processing.
- **Build System Integration:** Modified to pass a flag to in development builds.
- **Asset Packer Updates:** now generates file paths for disk-loaded assets and embeds data for others based on the build mode.
- **Asset Manager Enhancements:** includes new logic in for loading and caching disk-based assets and updates to for proper memory deallocation.
- **Documentation:** Updated to reflect the new asset nomenclature and dual-mode loading strategy.
- **Project Rules:** Added a concise rule to mandating top-level documentation updates for medium/large sub-system changes.
handoff(Gemini): Implemented dual-mode asset loading and updated documentation.
|
|
conventions
- Add textureSampleYUp() helper to fullscreen_uv_vs.wgsl to correct
y-flip when sampling WebGPU textures with y-up UV coordinates
- Use textureSampleYUp() in passthrough, gaussian_blur, combined_postprocess
- Fix skybox.wgsl: remove erroneous (1.0 - uv.y) flip (double-flip bug)
- Document world/view/screen conventions in doc/3D.md, camera_common.wgsl,
and fullscreen_uv_vs.wgsl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
asset_packer always rewrote assets.h, bumping its mtime even when the
AssetId enum was unchanged, causing audio/3d TUs to recompile on every
.wgsl edit. Write to assets.h.new first and use copy_if_different so
assets.h mtime only advances when enum content actually changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
- scripts/validate_shaders.py: compose #includes then validate with naga-cli
(mirrors InitShaderComposer snippet map; skips runtime-substitution shaders)
- src/effects/ntsc.wgsl: remove broken GLSL-syntax vignette() function
(GLSL const/param syntax, f32→vec2f assignment; inline vignette at line 55
already handles darkening)
handoff(Gemini): validator at scripts/validate_shaders.py; install naga with
cargo install naga-cli; 29/29 shaders pass
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Paths like ../../src/effects/ntsc.wgsl were stored non-normalized in
the DEPENDS list, preventing Ninja/Make from detecting file changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
WGSL-only WgslEffect implementing barrel/fisheye distortion, RGB chroma
separation, scanlines, per-pixel temporal noise, rolling jitter line,
vignette, and warm NTSC phosphor tint. Applied across all main sequences.
handoff(Gemini): Ntsc effect added; 13 effects total, 35+1 tests expected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Replace boilerplate .h/.cc pairs for simple single-pass effects with a
generic WgslEffect base class that takes a shader string + optional
WgslEffectParams (binding 3). Port Flash, Passthrough, Heptagon, Scratch,
and GaussianBlur to thin header-only wrappers — no .cc files, no CMake
entries needed. Removes 5 .cc files (-243 lines).
Update EFFECT_WORKFLOW.md, CONTRIBUTING.md, and AI_RULES.md to document
the WgslEffect (Path A) vs full class (Path B) workflow. Doc cleanup:
fix stale GaussianBlurParams/PostProcessEffect references and test counts.
handoff(Claude): WgslEffect landed; 5 effects ported; docs updated.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
snippet
- src/shaders/render/scratch_lines.wgsl: reusable WGSL snippet registered as
"render/scratch_lines"; call scratch_lines(uv, resolution, time)->f32 from
any effect. Uses hash_1f from math/noise; 8 lines/frame, ~24fps flicker.
- src/effects/scratch.{wgsl,h,cc}: thin Scratch effect wrapping the snippet.
- Applied to "intro" and "rotating_cube" sequences as the final step.
- 35/35 tests passing.
handoff(Gemini): Scratch effect added. render/scratch_lines snippet is reusable.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
Synchronized GEMINI.md and CLAUDE.md to provide a consistent
and comprehensive context-loading structure for both AI agents.
- Consolidated the Tier 3 (Design Docs) and Tier 4 (Archive)
sections to include a detailed, verified list of all relevant
documentation.
- Standardized the use of the '@' prefix for all file paths,
assuming a common loader directive.
- Ensured project rules and maintenance guidelines are identical
between both files.
|