summaryrefslogtreecommitdiff
path: root/src/effects
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-05-21 08:10:47 +0200
committerskal <pascal.massimino@gmail.com>2026-05-21 08:10:47 +0200
commitd806027dcaeadcdd8d2febd88bc46b2fd2c465de (patch)
tree30bc1ef9f40ccab7c00e31ee20e62bb86755fa26 /src/effects
parent680042a18c11ad5e58757e45b260745c2f52417f (diff)
style: apply clang-formatHEADmain
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/flash_effect.h3
-rw-r--r--src/effects/gaussian_blur_effect.h3
-rw-r--r--src/effects/heptagon_effect.h3
-rw-r--r--src/effects/ntsc_effect.h9
-rw-r--r--src/effects/passthrough_effect.h3
-rw-r--r--src/effects/peak_meter_effect.cc5
-rw-r--r--src/effects/rotating_cube_effect.cc8
-rw-r--r--src/effects/scene2_effect.h3
-rw-r--r--src/effects/scratch_effect.h3
-rw-r--r--src/effects/shaders.cc37
10 files changed, 44 insertions, 33 deletions
diff --git a/src/effects/flash_effect.h b/src/effects/flash_effect.h
index 1cfe1ee..1871186 100644
--- a/src/effects/flash_effect.h
+++ b/src/effects/flash_effect.h
@@ -9,5 +9,6 @@ struct Flash : public WgslEffect {
const std::vector<std::string>& outputs, float start_time,
float end_time)
: WgslEffect(ctx, inputs, outputs, start_time, end_time,
- flash_shader_wgsl) {}
+ flash_shader_wgsl) {
+ }
};
diff --git a/src/effects/gaussian_blur_effect.h b/src/effects/gaussian_blur_effect.h
index 0c528c5..43d0120 100644
--- a/src/effects/gaussian_blur_effect.h
+++ b/src/effects/gaussian_blur_effect.h
@@ -11,5 +11,6 @@ struct GaussianBlur : public WgslEffect {
float end_time)
: WgslEffect(ctx, inputs, outputs, start_time, end_time,
gaussian_blur_shader_wgsl, WGPULoadOp_Clear,
- WgslEffectParams{{8.0f, 0.5f, 1.0f, 0.0f}, {}}) {}
+ WgslEffectParams{{8.0f, 0.5f, 1.0f, 0.0f}, {}}) {
+ }
};
diff --git a/src/effects/heptagon_effect.h b/src/effects/heptagon_effect.h
index 3762202..ff1be46 100644
--- a/src/effects/heptagon_effect.h
+++ b/src/effects/heptagon_effect.h
@@ -9,5 +9,6 @@ struct Heptagon : public WgslEffect {
const std::vector<std::string>& outputs, float start_time,
float end_time)
: WgslEffect(ctx, inputs, outputs, start_time, end_time,
- heptagon_shader_wgsl) {}
+ heptagon_shader_wgsl) {
+ }
};
diff --git a/src/effects/ntsc_effect.h b/src/effects/ntsc_effect.h
index 4737291..b975c4d 100644
--- a/src/effects/ntsc_effect.h
+++ b/src/effects/ntsc_effect.h
@@ -9,14 +9,17 @@ struct Ntsc : public WgslEffect {
const std::vector<std::string>& outputs, float start_time,
float end_time)
: WgslEffect(ctx, inputs, outputs, start_time, end_time,
- ntsc_rgb_shader_wgsl) {}
+ ntsc_rgb_shader_wgsl) {
+ }
};
-// YIQ input: input texture already stores luma/chroma/phase (e.g. RotatingCube output).
+// YIQ input: input texture already stores luma/chroma/phase (e.g. RotatingCube
+// output).
struct NtscYiq : public WgslEffect {
NtscYiq(const GpuContext& ctx, const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
float end_time)
: WgslEffect(ctx, inputs, outputs, start_time, end_time,
- ntsc_yiq_shader_wgsl) {}
+ ntsc_yiq_shader_wgsl) {
+ }
};
diff --git a/src/effects/passthrough_effect.h b/src/effects/passthrough_effect.h
index 285663f..9137b48 100644
--- a/src/effects/passthrough_effect.h
+++ b/src/effects/passthrough_effect.h
@@ -9,5 +9,6 @@ struct Passthrough : public WgslEffect {
const std::vector<std::string>& outputs, float start_time,
float end_time)
: WgslEffect(ctx, inputs, outputs, start_time, end_time,
- passthrough_shader_wgsl) {}
+ passthrough_shader_wgsl) {
+ }
};
diff --git a/src/effects/peak_meter_effect.cc b/src/effects/peak_meter_effect.cc
index 8956e32..6c6e8fd 100644
--- a/src/effects/peak_meter_effect.cc
+++ b/src/effects/peak_meter_effect.cc
@@ -67,9 +67,8 @@ void PeakMeter::render(WGPUCommandEncoder encoder,
WGPUTextureView input_view = nodes.get_view(input_nodes_[0]);
WGPUTextureView output_view = nodes.get_view(output_nodes_[0]);
- pp_update_bind_group(ctx_.device, pipeline_.get(),
- bind_group_.get_address(), input_view,
- uniforms_buffer_.get(), {nullptr, 0});
+ pp_update_bind_group(ctx_.device, pipeline_.get(), bind_group_.get_address(),
+ input_view, uniforms_buffer_.get(), {nullptr, 0});
run_fullscreen_pass(encoder, pipeline_.get(), bind_group_.get(), output_view,
WGPULoadOp_Load);
diff --git a/src/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc
index 000d177..ec587b5 100644
--- a/src/effects/rotating_cube_effect.cc
+++ b/src/effects/rotating_cube_effect.cc
@@ -44,7 +44,8 @@ RotatingCube::RotatingCube(const GpuContext& ctx,
wgpuDeviceCreatePipelineLayout(ctx_.device, &pl_desc);
// Load shader
- const std::string composed = ShaderComposer::Get().Compose({}, rotating_cube_wgsl);
+ const std::string composed =
+ ShaderComposer::Get().Compose({}, rotating_cube_wgsl);
WGPUShaderSourceWGSL wgsl_src = {};
wgsl_src.chain.sType = WGPUSType_ShaderSourceWGSL;
wgsl_src.code = str_view(composed.c_str());
@@ -78,7 +79,7 @@ RotatingCube::RotatingCube(const GpuContext& ctx,
pipeline_desc.vertex.entryPoint = str_view("vs_main");
pipeline_desc.primitive.topology = WGPUPrimitiveTopology_TriangleList;
pipeline_desc.primitive.cullMode = WGPUCullMode_Back;
- pipeline_desc.primitive.frontFace = WGPUFrontFace_CW; // Y-flipped perspective
+ pipeline_desc.primitive.frontFace = WGPUFrontFace_CW; // Y-flipped perspective
pipeline_desc.depthStencil = &depth_stencil;
pipeline_desc.multisample.count = 1;
pipeline_desc.multisample.mask = 0xFFFFFFFF;
@@ -136,8 +137,7 @@ void RotatingCube::render(WGPUCommandEncoder encoder,
// Update uniforms
const Uniforms uniforms = Uniforms::make(
- view_proj,
- vec4(camera_pos.x, camera_pos.y, camera_pos.z, params.time),
+ view_proj, vec4(camera_pos.x, camera_pos.y, camera_pos.z, params.time),
vec4(1.0f, 0.0f, 0.0f, 0.0f), params.resolution, params.aspect_ratio);
const ObjectData obj_data = {
diff --git a/src/effects/scene2_effect.h b/src/effects/scene2_effect.h
index 0e26fc3..1ede2e7 100644
--- a/src/effects/scene2_effect.h
+++ b/src/effects/scene2_effect.h
@@ -13,5 +13,6 @@ struct Scene2Effect : public WgslEffect {
float end_time)
: WgslEffect(ctx, inputs, outputs, start_time, end_time,
scene2_shader_wgsl, WGPULoadOp_Clear, {},
- WgslSamplerType::Nearest) {}
+ WgslSamplerType::Nearest) {
+ }
};
diff --git a/src/effects/scratch_effect.h b/src/effects/scratch_effect.h
index 6c0e0cb..dc67118 100644
--- a/src/effects/scratch_effect.h
+++ b/src/effects/scratch_effect.h
@@ -9,5 +9,6 @@ struct Scratch : public WgslEffect {
const std::vector<std::string>& outputs, float start_time,
float end_time)
: WgslEffect(ctx, inputs, outputs, start_time, end_time,
- scratch_shader_wgsl) {}
+ scratch_shader_wgsl) {
+ }
};
diff --git a/src/effects/shaders.cc b/src/effects/shaders.cc
index 7ca66fa..a099bf4 100644
--- a/src/effects/shaders.cc
+++ b/src/effects/shaders.cc
@@ -51,7 +51,7 @@ void InitShaderComposer() {
register_if_exists("ray_box", AssetId::ASSET_SHADER_RAY_BOX);
register_if_exists("ray_triangle", AssetId::ASSET_SHADER_RAY_TRIANGLE);
- register_if_exists("ray_sphere", AssetId::ASSET_SHADER_RAY_SPHERE);
+ register_if_exists("ray_sphere", AssetId::ASSET_SHADER_RAY_SPHERE);
register_if_exists("debug/debug_print",
AssetId::ASSET_SHADER_DEBUG_DEBUG_PRINT);
@@ -73,12 +73,13 @@ void InitShaderComposer() {
register_if_exists("render/raymarching_id",
AssetId::ASSET_SHADER_RENDER_RAYMARCHING_ID);
// CNN v3 inference snippets
- register_if_exists("cnn_v3/common", AssetId::ASSET_SHADER_CNN_V3_COMMON);
- register_if_exists("cnn_v3/enc0", AssetId::ASSET_SHADER_CNN_V3_ENC0);
- register_if_exists("cnn_v3/enc1", AssetId::ASSET_SHADER_CNN_V3_ENC1);
- register_if_exists("cnn_v3/bottleneck", AssetId::ASSET_SHADER_CNN_V3_BOTTLENECK);
- register_if_exists("cnn_v3/dec1", AssetId::ASSET_SHADER_CNN_V3_DEC1);
- register_if_exists("cnn_v3/dec0", AssetId::ASSET_SHADER_CNN_V3_DEC0);
+ register_if_exists("cnn_v3/common", AssetId::ASSET_SHADER_CNN_V3_COMMON);
+ register_if_exists("cnn_v3/enc0", AssetId::ASSET_SHADER_CNN_V3_ENC0);
+ register_if_exists("cnn_v3/enc1", AssetId::ASSET_SHADER_CNN_V3_ENC1);
+ register_if_exists("cnn_v3/bottleneck",
+ AssetId::ASSET_SHADER_CNN_V3_BOTTLENECK);
+ register_if_exists("cnn_v3/dec1", AssetId::ASSET_SHADER_CNN_V3_DEC1);
+ register_if_exists("cnn_v3/dec0", AssetId::ASSET_SHADER_CNN_V3_DEC0);
// CNN shaders (workspace-specific)
// register_if_exists("cnn_activation", AssetId::ASSET_SHADER_CNN_ACTIVATION);
@@ -119,16 +120,18 @@ const char* scene2_shader_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_SCENE2);
const char* scratch_shader_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_SCRATCH);
const char* ntsc_rgb_shader_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_NTSC_RGB);
const char* ntsc_yiq_shader_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_NTSC_YIQ);
-const char* gbuf_raster_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_RASTER);
-const char* gbuf_pack_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_PACK);
-const char* gbuf_shadow_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_SHADOW);
-const char* gbuf_view_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_VIEW);
-const char* gbuf_deferred_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_DEFERRED);
-const char* cnn_v3_enc0_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_ENC0);
-const char* cnn_v3_enc1_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_ENC1);
-const char* cnn_v3_bottleneck_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_BOTTLENECK);
-const char* cnn_v3_dec1_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_DEC1);
-const char* cnn_v3_dec0_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_DEC0);
+const char* gbuf_raster_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_RASTER);
+const char* gbuf_pack_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_PACK);
+const char* gbuf_shadow_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_SHADOW);
+const char* gbuf_view_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_VIEW);
+const char* gbuf_deferred_wgsl =
+ SafeGetAsset(AssetId::ASSET_SHADER_GBUF_DEFERRED);
+const char* cnn_v3_enc0_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_ENC0);
+const char* cnn_v3_enc1_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_ENC1);
+const char* cnn_v3_bottleneck_wgsl =
+ SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_BOTTLENECK);
+const char* cnn_v3_dec1_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_DEC1);
+const char* cnn_v3_dec0_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_DEC0);
// Compute shaders
const char* gen_noise_compute_wgsl =