From 64f977f6fbedf75d5edbc3963e002b593c8428d8 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 17 Feb 2026 08:16:03 +0100 Subject: style: Apply clang-format --- src/tests/gpu/test_demo_effects.cc | 63 ++++++++++++++------------------ src/tests/gpu/test_effect_base.cc | 22 +++++------ src/tests/gpu/test_noise_functions.cc | 2 +- src/tests/gpu/test_sequence.cc | 21 +++++------ src/tests/gpu/test_sequence_e2e.cc | 32 +++++++--------- src/tests/gpu/test_shader_compilation.cc | 2 +- 6 files changed, 64 insertions(+), 78 deletions(-) (limited to 'src/tests/gpu') diff --git a/src/tests/gpu/test_demo_effects.cc b/src/tests/gpu/test_demo_effects.cc index d012afb..7f9d3da 100644 --- a/src/tests/gpu/test_demo_effects.cc +++ b/src/tests/gpu/test_demo_effects.cc @@ -37,42 +37,33 @@ static void test_effects() { } std::vector>> effects = { - {"Passthrough", - std::make_shared( - fixture.ctx(), std::vector{"source"}, - std::vector{"sink"})}, - {"GaussianBlur", - std::make_shared( - fixture.ctx(), std::vector{"source"}, - std::vector{"sink"})}, - {"Placeholder", - std::make_shared( - fixture.ctx(), std::vector{"source"}, - std::vector{"sink"})}, - {"Heptagon", - std::make_shared( - fixture.ctx(), std::vector{"source"}, - std::vector{"sink"})}, - {"Particles", - std::make_shared( - fixture.ctx(), std::vector{"source"}, - std::vector{"sink"})}, - {"RotatingCube", - std::make_shared( - fixture.ctx(), std::vector{"source"}, - std::vector{"sink"})}, - {"Hybrid3D", - std::make_shared( - fixture.ctx(), std::vector{"source"}, - std::vector{"sink"})}, - {"Flash", - std::make_shared( - fixture.ctx(), std::vector{"source"}, - std::vector{"sink"})}, - {"PeakMeter", - std::make_shared( - fixture.ctx(), std::vector{"source"}, - std::vector{"sink"})}, + {"Passthrough", std::make_shared( + fixture.ctx(), std::vector{"source"}, + std::vector{"sink"})}, + {"GaussianBlur", std::make_shared( + fixture.ctx(), std::vector{"source"}, + std::vector{"sink"})}, + {"Placeholder", std::make_shared( + fixture.ctx(), std::vector{"source"}, + std::vector{"sink"})}, + {"Heptagon", std::make_shared( + fixture.ctx(), std::vector{"source"}, + std::vector{"sink"})}, + {"Particles", std::make_shared( + fixture.ctx(), std::vector{"source"}, + std::vector{"sink"})}, + {"RotatingCube", std::make_shared( + fixture.ctx(), std::vector{"source"}, + std::vector{"sink"})}, + {"Hybrid3D", std::make_shared( + fixture.ctx(), std::vector{"source"}, + std::vector{"sink"})}, + {"Flash", std::make_shared(fixture.ctx(), + std::vector{"source"}, + std::vector{"sink"})}, + {"PeakMeter", std::make_shared( + fixture.ctx(), std::vector{"source"}, + std::vector{"sink"})}, }; int passed = 0; diff --git a/src/tests/gpu/test_effect_base.cc b/src/tests/gpu/test_effect_base.cc index ecf1dca..f46a4ef 100644 --- a/src/tests/gpu/test_effect_base.cc +++ b/src/tests/gpu/test_effect_base.cc @@ -102,11 +102,11 @@ static void test_effect_in_sequence() { // Create minimal sequence with one effect class TestSequence : public Sequence { - public: + public: TestSequence(const GpuContext& ctx, int w, int h) : Sequence(ctx, w, h) { - auto effect = std::make_shared( - ctx, std::vector{"source"}, - std::vector{"sink"}); + auto effect = + std::make_shared(ctx, std::vector{"source"}, + std::vector{"sink"}); effect_dag_.push_back({effect, {"source"}, {"sink"}, 0}); init_effect_nodes(); @@ -134,11 +134,11 @@ static void test_sequence_render() { OffscreenRenderTarget target(fixture.instance(), fixture.device(), 256, 256); class TestSequence : public Sequence { - public: + public: TestSequence(const GpuContext& ctx, int w, int h) : Sequence(ctx, w, h) { - auto effect = std::make_shared( - ctx, std::vector{"source"}, - std::vector{"sink"}); + auto effect = + std::make_shared(ctx, std::vector{"source"}, + std::vector{"sink"}); effect_dag_.push_back({effect, {"source"}, {"sink"}, 0}); init_effect_nodes(); @@ -154,8 +154,8 @@ static void test_sequence_render() { seq->preprocess(0.0f, 0.0f, 0.0f, 0.0f); // Create encoder and attempt render - WGPUCommandEncoder encoder = wgpuDeviceCreateCommandEncoder( - fixture.device(), nullptr); + WGPUCommandEncoder encoder = + wgpuDeviceCreateCommandEncoder(fixture.device(), nullptr); seq->render_effects(encoder); @@ -177,7 +177,7 @@ static void test_sequence_time_params() { } class TestSequence : public Sequence { - public: + public: TestSequence(const GpuContext& ctx, int w, int h) : Sequence(ctx, w, h) { init_effect_nodes(); } diff --git a/src/tests/gpu/test_noise_functions.cc b/src/tests/gpu/test_noise_functions.cc index 4e1791f..d96a982 100644 --- a/src/tests/gpu/test_noise_functions.cc +++ b/src/tests/gpu/test_noise_functions.cc @@ -1,9 +1,9 @@ // This file is part of the 64k demo project. // It validates that the noise.wgsl functions are accessible and usable. +#include "effects/shaders.h" #include "generated/assets.h" #include "gpu/shader_composer.h" -#include "effects/shaders.h" #include #include #include diff --git a/src/tests/gpu/test_sequence.cc b/src/tests/gpu/test_sequence.cc index 337381a..fa6bd5e 100644 --- a/src/tests/gpu/test_sequence.cc +++ b/src/tests/gpu/test_sequence.cc @@ -1,8 +1,8 @@ // Test file for Sequence v2 system // Phase 1: Foundation tests (NodeRegistry, Sequence base class) -#include "gpu/sequence.h" #include "gpu/effect.h" +#include "gpu/sequence.h" #include "tests/common/webgpu_test_fixture.h" #include #include @@ -11,7 +11,7 @@ class TestEffect : public Effect { public: TestEffect(const GpuContext& ctx, const std::vector& inputs, - const std::vector& outputs) + const std::vector& outputs) : Effect(ctx, inputs, outputs), render_called_(false) { } @@ -132,16 +132,15 @@ void test_sequence_v2_dag_execution() { class TestSequence : public Sequence { public: TestSequence(const GpuContext& ctx) - : Sequence(ctx, 1280, 720), - effect1_(std::make_shared(ctx, std::vector{"source"}, - std::vector{"temp"})), - effect2_(std::make_shared(ctx, std::vector{"temp"}, - std::vector{"sink"})) { + : Sequence(ctx, 1280, 720), effect1_(std::make_shared( + ctx, std::vector{"source"}, + std::vector{"temp"})), + effect2_(std::make_shared( + ctx, std::vector{"temp"}, + std::vector{"sink"})) { // Build DAG (2 effects in sequence) - effect_dag_.push_back( - {effect1_, {"source"}, {"temp"}, 0}); - effect_dag_.push_back( - {effect2_, {"temp"}, {"sink"}, 1}); + effect_dag_.push_back({effect1_, {"source"}, {"temp"}, 0}); + effect_dag_.push_back({effect2_, {"temp"}, {"sink"}, 1}); } std::shared_ptr effect1_; diff --git a/src/tests/gpu/test_sequence_e2e.cc b/src/tests/gpu/test_sequence_e2e.cc index 6ae82bd..ed8920a 100644 --- a/src/tests/gpu/test_sequence_e2e.cc +++ b/src/tests/gpu/test_sequence_e2e.cc @@ -1,12 +1,12 @@ // End-to-end test for Sequence v2 system // Tests compiler output instantiation and execution -#include "gpu/sequence.h" -#include "gpu/effect.h" #include "effects/gaussian_blur_effect.h" #include "effects/heptagon_effect.h" #include "effects/passthrough_effect.h" #include "effects/shaders.h" +#include "gpu/effect.h" +#include "gpu/sequence.h" #include "tests/common/webgpu_test_fixture.h" #include #include @@ -21,22 +21,18 @@ class SimpleTestSequence : public Sequence { nodes_.declare_node("temp", NodeType::U8X4_NORM, width_, height_); // Effect DAG construction (2 effects: source->temp->sink) - effect_dag_.push_back({ - .effect = std::make_shared(ctx, - std::vector{"source"}, - std::vector{"temp"}), - .input_nodes = {"source"}, - .output_nodes = {"temp"}, - .execution_order = 0 - }); - effect_dag_.push_back({ - .effect = std::make_shared(ctx, - std::vector{"temp"}, - std::vector{"sink"}), - .input_nodes = {"temp"}, - .output_nodes = {"sink"}, - .execution_order = 1 - }); + effect_dag_.push_back({.effect = std::make_shared( + ctx, std::vector{"source"}, + std::vector{"temp"}), + .input_nodes = {"source"}, + .output_nodes = {"temp"}, + .execution_order = 0}); + effect_dag_.push_back({.effect = std::make_shared( + ctx, std::vector{"temp"}, + std::vector{"sink"}), + .input_nodes = {"temp"}, + .output_nodes = {"sink"}, + .execution_order = 1}); } }; diff --git a/src/tests/gpu/test_shader_compilation.cc b/src/tests/gpu/test_shader_compilation.cc index 3f2219d..2aff115 100644 --- a/src/tests/gpu/test_shader_compilation.cc +++ b/src/tests/gpu/test_shader_compilation.cc @@ -5,9 +5,9 @@ // - Missing binding declarations // - Type mismatches +#include "effects/shaders.h" #include "generated/assets.h" #include "gpu/shader_composer.h" -#include "effects/shaders.h" #include "platform/platform.h" #include #include -- cgit v1.2.3