From ef205b6eda78f1dcf65aa696dedf1f8c0707ff30 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 10 Mar 2026 09:28:08 +0100 Subject: fix: use ShaderComposer in RotatingCube; add rule to CODING_STYLE 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 --- src/effects/rotating_cube_effect.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc index 197bc26..6ee3e85 100644 --- a/src/effects/rotating_cube_effect.cc +++ b/src/effects/rotating_cube_effect.cc @@ -6,6 +6,7 @@ #include "gpu/bind_group_builder.h" #include "gpu/gpu.h" #include "gpu/post_process_helper.h" +#include "gpu/shader_composer.h" #include "util/fatal_error.h" RotatingCube::RotatingCube(const GpuContext& ctx, @@ -43,9 +44,10 @@ RotatingCube::RotatingCube(const GpuContext& ctx, wgpuDeviceCreatePipelineLayout(ctx_.device, &pl_desc); // Load shader + const std::string composed = ShaderComposer::Get().Compose({}, rotating_cube_wgsl); WGPUShaderSourceWGSL wgsl_src = {}; wgsl_src.chain.sType = WGPUSType_ShaderSourceWGSL; - wgsl_src.code = str_view(rotating_cube_wgsl); + wgsl_src.code = str_view(composed.c_str()); WGPUShaderModuleDescriptor shader_desc = {}; shader_desc.nextInChain = &wgsl_src.chain; -- cgit v1.2.3