From af55c4a7a54a90d4c252aa4fe354e7bf8624072e Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 9 Feb 2026 15:20:09 +0100 Subject: 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 --- src/tests/test_demo_effects.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tests/test_demo_effects.cc') diff --git a/src/tests/test_demo_effects.cc b/src/tests/test_demo_effects.cc index d0163c2..0d2b09a 100644 --- a/src/tests/test_demo_effects.cc +++ b/src/tests/test_demo_effects.cc @@ -197,6 +197,9 @@ static void test_effect_type_classification() { int main() { fprintf(stdout, "=== Demo Effects Tests ===\n"); + extern void InitShaderComposer(); + InitShaderComposer(); + test_post_process_effects(); test_scene_effects(); test_effect_type_classification(); -- cgit v1.2.3