summaryrefslogtreecommitdiff
path: root/src/effects
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/gaussian_blur_effect.cc7
-rw-r--r--src/effects/heptagon_effect.cc2
-rw-r--r--src/effects/heptagon_effect.h2
-rw-r--r--src/effects/hybrid3_d_effect.cc7
-rw-r--r--src/effects/hybrid3_d_effect.h2
-rw-r--r--src/effects/particles_effect.cc2
-rw-r--r--src/effects/particles_effect.h2
-rw-r--r--src/effects/peak_meter_effect.cc5
-rw-r--r--src/effects/peak_meter_effect.h2
-rw-r--r--src/effects/rotating_cube_effect.cc13
-rw-r--r--src/effects/scene1_effect.cc9
-rw-r--r--src/effects/scene2_effect.cc10
-rw-r--r--src/effects/scene2_effect.h10
13 files changed, 37 insertions, 36 deletions
diff --git a/src/effects/gaussian_blur_effect.cc b/src/effects/gaussian_blur_effect.cc
index a925dee..15d4d0a 100644
--- a/src/effects/gaussian_blur_effect.cc
+++ b/src/effects/gaussian_blur_effect.cc
@@ -7,9 +7,10 @@
GaussianBlur::GaussianBlur(const GpuContext& ctx,
const std::vector<std::string>& inputs,
- const std::vector<std::string>& outputs, float start_time,
- float end_time)
- : Effect(ctx, inputs, outputs, start_time, end_time), pipeline_(nullptr), bind_group_(nullptr) {
+ const std::vector<std::string>& outputs,
+ float start_time, float end_time)
+ : Effect(ctx, inputs, outputs, start_time, end_time), pipeline_(nullptr),
+ bind_group_(nullptr) {
HEADLESS_RETURN_IF_NULL(ctx_.device);
create_linear_sampler();
diff --git a/src/effects/heptagon_effect.cc b/src/effects/heptagon_effect.cc
index c02efb3..ac688df 100644
--- a/src/effects/heptagon_effect.cc
+++ b/src/effects/heptagon_effect.cc
@@ -9,7 +9,7 @@
Heptagon::Heptagon(const GpuContext& ctx,
const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
- float end_time)
+ float end_time)
: Effect(ctx, inputs, outputs, start_time, end_time) {
HEADLESS_RETURN_IF_NULL(ctx_.device);
diff --git a/src/effects/heptagon_effect.h b/src/effects/heptagon_effect.h
index 4563e47..ab7db8d 100644
--- a/src/effects/heptagon_effect.h
+++ b/src/effects/heptagon_effect.h
@@ -10,7 +10,7 @@ class Heptagon : public Effect {
public:
Heptagon(const GpuContext& ctx, const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
- float end_time);
+ float end_time);
void render(WGPUCommandEncoder encoder, const UniformsSequenceParams& params,
NodeRegistry& nodes) override;
diff --git a/src/effects/hybrid3_d_effect.cc b/src/effects/hybrid3_d_effect.cc
index 5832b57..37d4158 100644
--- a/src/effects/hybrid3_d_effect.cc
+++ b/src/effects/hybrid3_d_effect.cc
@@ -10,9 +10,10 @@
Hybrid3D::Hybrid3D(const GpuContext& ctx,
const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
- float end_time)
- : Effect(ctx, inputs, outputs, start_time, end_time), depth_node_(outputs[0] + "_depth"),
- dummy_texture_(nullptr), dummy_texture_view_(nullptr) {
+ float end_time)
+ : Effect(ctx, inputs, outputs, start_time, end_time),
+ depth_node_(outputs[0] + "_depth"), dummy_texture_(nullptr),
+ dummy_texture_view_(nullptr) {
// Headless mode: skip GPU resource creation (compiled out in STRIP_ALL)
HEADLESS_RETURN_IF_NULL(ctx_.device);
diff --git a/src/effects/hybrid3_d_effect.h b/src/effects/hybrid3_d_effect.h
index e0aa6da..13fd7df 100644
--- a/src/effects/hybrid3_d_effect.h
+++ b/src/effects/hybrid3_d_effect.h
@@ -13,7 +13,7 @@ class Hybrid3D : public Effect {
public:
Hybrid3D(const GpuContext& ctx, const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
- float end_time);
+ float end_time);
~Hybrid3D() override;
void declare_nodes(NodeRegistry& registry) override;
diff --git a/src/effects/particles_effect.cc b/src/effects/particles_effect.cc
index d0336f6..fc37a88 100644
--- a/src/effects/particles_effect.cc
+++ b/src/effects/particles_effect.cc
@@ -10,7 +10,7 @@
Particles::Particles(const GpuContext& ctx,
const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
- float end_time)
+ float end_time)
: Effect(ctx, inputs, outputs, start_time, end_time) {
HEADLESS_RETURN_IF_NULL(ctx_.device);
diff --git a/src/effects/particles_effect.h b/src/effects/particles_effect.h
index e855b7b..0d5a07e 100644
--- a/src/effects/particles_effect.h
+++ b/src/effects/particles_effect.h
@@ -22,7 +22,7 @@ class Particles : public Effect {
public:
Particles(const GpuContext& ctx, const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
- float end_time);
+ float end_time);
void render(WGPUCommandEncoder encoder, const UniformsSequenceParams& params,
NodeRegistry& nodes) override;
diff --git a/src/effects/peak_meter_effect.cc b/src/effects/peak_meter_effect.cc
index 2a7b7f9..d462fa0 100644
--- a/src/effects/peak_meter_effect.cc
+++ b/src/effects/peak_meter_effect.cc
@@ -8,8 +8,9 @@
PeakMeter::PeakMeter(const GpuContext& ctx,
const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
- float end_time)
- : Effect(ctx, inputs, outputs, start_time, end_time), pipeline_(nullptr), bind_group_(nullptr) {
+ float end_time)
+ : Effect(ctx, inputs, outputs, start_time, end_time), pipeline_(nullptr),
+ bind_group_(nullptr) {
HEADLESS_RETURN_IF_NULL(ctx_.device);
const char* shader_main = R"(
diff --git a/src/effects/peak_meter_effect.h b/src/effects/peak_meter_effect.h
index 1786522..1f19ed6 100644
--- a/src/effects/peak_meter_effect.h
+++ b/src/effects/peak_meter_effect.h
@@ -9,7 +9,7 @@ class PeakMeter : public Effect {
public:
PeakMeter(const GpuContext& ctx, const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
- float end_time);
+ float end_time);
~PeakMeter() override;
void render(WGPUCommandEncoder encoder, const UniformsSequenceParams& params,
diff --git a/src/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc
index 6c350a7..099d06c 100644
--- a/src/effects/rotating_cube_effect.cc
+++ b/src/effects/rotating_cube_effect.cc
@@ -9,9 +9,10 @@
RotatingCube::RotatingCube(const GpuContext& ctx,
const std::vector<std::string>& inputs,
- const std::vector<std::string>& outputs, float start_time,
- float end_time)
- : Effect(ctx, inputs, outputs, start_time, end_time), depth_node_(outputs[0] + "_depth") {
+ const std::vector<std::string>& outputs,
+ float start_time, float end_time)
+ : Effect(ctx, inputs, outputs, start_time, end_time),
+ depth_node_(outputs[0] + "_depth") {
// Headless mode: skip GPU resource creation (compiled out in STRIP_ALL)
HEADLESS_RETURN_IF_NULL(ctx_.device);
@@ -166,8 +167,8 @@ void RotatingCube::render(WGPUCommandEncoder encoder,
GpuTextureCopyInfo src = {
.texture = input_tex, .mipLevel = 0, .aspect = WGPUTextureAspect_All};
GpuTextureCopyInfo dst = {.texture = output_tex,
- .mipLevel = 0,
- .aspect = WGPUTextureAspect_All};
+ .mipLevel = 0,
+ .aspect = WGPUTextureAspect_All};
WGPUExtent3D copy_size = {(uint32_t)params.resolution.x,
(uint32_t)params.resolution.y, 1};
wgpuCommandEncoderCopyTextureToTexture(encoder, &src, &dst, &copy_size);
@@ -181,7 +182,7 @@ void RotatingCube::render(WGPUCommandEncoder encoder,
// Render pass with depth
WGPURenderPassColorAttachment color_attachment = {
.view = color_view,
- #if !defined(DEMO_CROSS_COMPILE_WIN32)
+#if !defined(DEMO_CROSS_COMPILE_WIN32)
.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED,
#endif
// .loadOp = WGPULoadOp_Clear,
diff --git a/src/effects/scene1_effect.cc b/src/effects/scene1_effect.cc
index 71e25a4..0aae94a 100644
--- a/src/effects/scene1_effect.cc
+++ b/src/effects/scene1_effect.cc
@@ -16,10 +16,11 @@ static CameraParams make_scene1_camera(float time) {
CameraParams cam;
cam.inv_view = mat4::look_at(ro, la, up).inverse();
- cam.fov = TAU / 6.0f; // full vfov=60°; tan(fov/2)=tan(PI/6)=1/sqrt(3)=1/shader_fov
+ cam.fov =
+ TAU / 6.0f; // full vfov=60°; tan(fov/2)=tan(PI/6)=1/sqrt(3)=1/shader_fov
cam.near_plane = 0.1f;
cam.far_plane = 100.0f;
- cam.aspect_ratio = 1.0f; // aspect handled in fs_main
+ cam.aspect_ratio = 1.0f; // aspect handled in fs_main
return cam;
}
@@ -40,9 +41,7 @@ Scene1::Scene1(const GpuContext& ctx, const std::vector<std::string>& inputs,
}
void Scene1::render(WGPUCommandEncoder encoder,
- const UniformsSequenceParams& params,
- NodeRegistry& nodes) {
-
+ const UniformsSequenceParams& params, NodeRegistry& nodes) {
camera_params_.update(ctx_.queue, make_scene1_camera(params.time));
WGPUTextureView output_view = nodes.get_view(output_nodes_[0]);
diff --git a/src/effects/scene2_effect.cc b/src/effects/scene2_effect.cc
index b1b9975..8c05574 100644
--- a/src/effects/scene2_effect.cc
+++ b/src/effects/scene2_effect.cc
@@ -9,9 +9,9 @@
#include "util/fatal_error.h"
Scene2Effect::Scene2Effect(const GpuContext& ctx,
- const std::vector<std::string>& inputs,
- const std::vector<std::string>& outputs,
- float start_time, float end_time)
+ const std::vector<std::string>& inputs,
+ const std::vector<std::string>& outputs,
+ float start_time, float end_time)
: Effect(ctx, inputs, outputs, start_time, end_time) {
HEADLESS_RETURN_IF_NULL(ctx_.device);
create_nearest_sampler();
@@ -21,8 +21,8 @@ Scene2Effect::Scene2Effect(const GpuContext& ctx,
}
void Scene2Effect::render(WGPUCommandEncoder encoder,
- const UniformsSequenceParams& params,
- NodeRegistry& nodes) {
+ const UniformsSequenceParams& params,
+ NodeRegistry& nodes) {
WGPUTextureView output_view = nodes.get_view(output_nodes_[0]);
// uniforms_buffer_ auto-updated by base class dispatch_render()
diff --git a/src/effects/scene2_effect.h b/src/effects/scene2_effect.h
index effc19f..da4cf7e 100644
--- a/src/effects/scene2_effect.h
+++ b/src/effects/scene2_effect.h
@@ -9,13 +9,11 @@
class Scene2Effect : public Effect {
public:
- Scene2Effect(const GpuContext& ctx,
- const std::vector<std::string>& inputs,
- const std::vector<std::string>& outputs,
- float start_time, float end_time);
+ Scene2Effect(const GpuContext& ctx, const std::vector<std::string>& inputs,
+ const std::vector<std::string>& outputs, float start_time,
+ float end_time);
- void render(WGPUCommandEncoder encoder,
- const UniformsSequenceParams& params,
+ void render(WGPUCommandEncoder encoder, const UniformsSequenceParams& params,
NodeRegistry& nodes) override;
private: