summaryrefslogtreecommitdiff
path: root/src/tests/assets
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-11 11:34:08 +0100
committerskal <pascal.massimino@gmail.com>2026-02-11 11:34:08 +0100
commitd378da77eec4d506bc01e4c08c38644d72969cc7 (patch)
tree5cc38517320ba3aefb46a2f9c939c9fdc8ed5fae /src/tests/assets
parent4da0a3a5369142078fd7c681e3f0f1817bd6e2f3 (diff)
refactor: Simplify effect render API and fix uniform initialization
Root cause: Uniform buffers created but not initialized before bind group creation, causing undefined UV coordinates in circle_mask_compute.wgsl. Changes: - Add get_common_uniforms() helper to Effect base class - Refactor render()/compute() signatures: 5 params → CommonPostProcessUniforms& - Fix uninitialized uniforms in CircleMaskEffect and CNNEffect - Update all 19 effect implementations and headers - Fix WGSL syntax error in FlashEffect (u.audio_intensity → audio_intensity) - Update test files (test_sequence.cc) Benefits: - Cleaner API: construct uniforms once per frame, reuse across effects - More maintainable: CommonPostProcessUniforms changes need no call site updates - Fixes UV coordinate bug in circle_mask_compute.wgsl All 36 tests passing (100%) handoff(Claude): Effect API refactor complete
Diffstat (limited to 'src/tests/assets')
-rw-r--r--src/tests/assets/test_sequence.cc27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/tests/assets/test_sequence.cc b/src/tests/assets/test_sequence.cc
index d79ec1d..44aac46 100644
--- a/src/tests/assets/test_sequence.cc
+++ b/src/tests/assets/test_sequence.cc
@@ -38,22 +38,16 @@ class DummyEffect : public Effect {
void start() override {
++start_calls;
}
- void render(WGPURenderPassEncoder pass, float time, float beat,
- float intensity, float aspect_ratio) override {
+ void render(WGPURenderPassEncoder pass,
+ const CommonPostProcessUniforms& uniforms) override {
++render_calls;
(void)pass;
- (void)time;
- (void)beat;
- (void)intensity;
- (void)aspect_ratio;
+ (void)uniforms;
}
- void compute(WGPUCommandEncoder encoder, float time, float beat,
- float intensity, float aspect_ratio) override {
+ void compute(WGPUCommandEncoder encoder,
+ const CommonPostProcessUniforms& uniforms) override {
(void)encoder;
- (void)time;
- (void)beat;
- (void)intensity;
- (void)aspect_ratio;
+ (void)uniforms;
}
void end() override {
++end_calls;
@@ -77,14 +71,11 @@ class DummyPostProcessEffect : public PostProcessEffect {
++init_calls;
(void)demo;
}
- void render(WGPURenderPassEncoder pass, float time, float beat,
- float intensity, float aspect_ratio) override {
+ void render(WGPURenderPassEncoder pass,
+ const CommonPostProcessUniforms& uniforms) override {
++render_calls;
(void)pass;
- (void)time;
- (void)beat;
- (void)intensity;
- (void)aspect_ratio;
+ (void)uniforms;
}
void update_bind_group(WGPUTextureView input_view) override {
++update_bind_group_calls;