diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-17 13:05:11 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-17 13:05:11 +0100 |
| commit | bdb1a4e95a545f3f4d88630b8aec6ab771776d99 (patch) | |
| tree | 97a3a15381a7ff9780644ec8876535dd219f23cf /src/gpu/effect.h | |
| parent | a32c7456588abf4f44866d0c055fa94d105e8ef7 (diff) | |
refactor(effects): Streamline uniforms initialization
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
Diffstat (limited to 'src/gpu/effect.h')
| -rw-r--r-- | src/gpu/effect.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gpu/effect.h b/src/gpu/effect.h index d47a8b7..bfd5743 100644 --- a/src/gpu/effect.h +++ b/src/gpu/effect.h @@ -53,22 +53,19 @@ class Effect { int width_ = 1280; int height_ = 720; - // Common resources for most effects - UniformBuffer<UniformsSequenceParams> uniforms_buffer_; + // Common resources (initialized automatically in base class) + UniformBuffer<UniformsSequenceParams> uniforms_buffer_; // Auto-updated in dispatch_render() Sampler sampler_; Texture dummy_texture_; TextureView dummy_texture_view_; - // Helper: Initialize uniforms buffer (call in subclass constructor) - void init_uniforms_buffer(); - - // Helper: Create linear sampler (call in subclass constructor) + // Helper: Create linear sampler (call in subclass constructor if needed) void create_linear_sampler(); - // Helper: Create nearest sampler (call in subclass constructor) + // Helper: Create nearest sampler (call in subclass constructor if needed) void create_nearest_sampler(); - // Helper: Create dummy texture for scene effects (call in subclass constructor) + // Helper: Create dummy texture for scene effects (call in subclass constructor if needed) void create_dummy_scene_texture(); private: |
