diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-09 15:20:09 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-09 15:20:09 +0100 |
| commit | af55c4a7a54a90d4c252aa4fe354e7bf8624072e (patch) | |
| tree | 6aef045c1f52f0df766e5b091cfb61a950d48c3f /assets/final/shaders/distort.wgsl | |
| parent | ff4108b383e8b543a298debdb3518a19e08d74ab (diff) | |
refactor: Deduplicate CommonUniforms with #include in WGSL shaders
Replace redundant CommonUniforms struct definitions across 13 shaders
with #include "common_uniforms" directive. Integrate ShaderComposer
preprocessing into all shader creation pipelines.
Changes:
- Replace 9-line CommonUniforms definitions with single #include line
- Add ShaderComposer.Compose() to create_post_process_pipeline()
- Add ShaderComposer.Compose() to gpu_create_render_pass()
- Add ShaderComposer.Compose() to gpu_create_compute_pass()
- Add InitShaderComposer() calls to test_effect_base and test_demo_effects
- Update test_shader_compilation to compose shaders before validation
Net reduction: 83 lines of duplicate code eliminated
All 35 tests passing (100%)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'assets/final/shaders/distort.wgsl')
| -rw-r--r-- | assets/final/shaders/distort.wgsl | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/assets/final/shaders/distort.wgsl b/assets/final/shaders/distort.wgsl index 4de8441..5d35129 100644 --- a/assets/final/shaders/distort.wgsl +++ b/assets/final/shaders/distort.wgsl @@ -1,15 +1,7 @@ @group(0) @binding(0) var smplr: sampler; @group(0) @binding(1) var txt: texture_2d<f32>; -struct CommonUniforms { - resolution: vec2<f32>, - _pad0: f32, - _pad1: f32, - aspect_ratio: f32, - time: f32, - beat: f32, - audio_intensity: f32, -}; +#include "common_uniforms" struct DistortParams { strength: f32, |
