summaryrefslogtreecommitdiff
path: root/src/gpu/effects
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-01 01:47:41 +0100
committerskal <pascal.massimino@gmail.com>2026-02-01 01:47:41 +0100
commitb2d4d2cd06e28b012115bdafaa0bd015888d5452 (patch)
treee1fd467dff6fead734cfbf366ce4df7085dc5efb /src/gpu/effects
parente6e34e551a73e65301685071445aaec9aaf60fd2 (diff)
Chore: Apply clang-format to the codebase
Diffstat (limited to 'src/gpu/effects')
-rw-r--r--src/gpu/effects/distort_effect.cc3
-rw-r--r--src/gpu/effects/heptagon_effect.cc3
-rw-r--r--src/gpu/effects/particles_effect.cc3
-rw-r--r--src/gpu/effects/post_process_helper.cc11
-rw-r--r--src/gpu/effects/post_process_helper.h3
5 files changed, 13 insertions, 10 deletions
diff --git a/src/gpu/effects/distort_effect.cc b/src/gpu/effects/distort_effect.cc
index 1f2b8fc..d9aa308 100644
--- a/src/gpu/effects/distort_effect.cc
+++ b/src/gpu/effects/distort_effect.cc
@@ -11,7 +11,8 @@ DistortEffect::DistortEffect(WGPUDevice device, WGPUQueue queue,
uniforms_ =
gpu_create_buffer(device_, sizeof(float) * 4,
WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst);
- pipeline_ = create_post_process_pipeline(device_, format, distort_shader_wgsl);
+ pipeline_ =
+ create_post_process_pipeline(device_, format, distort_shader_wgsl);
}
void DistortEffect::render(WGPURenderPassEncoder pass, float t, float b,
float i, float a) {
diff --git a/src/gpu/effects/heptagon_effect.cc b/src/gpu/effects/heptagon_effect.cc
index 64e4b47..c982912 100644
--- a/src/gpu/effects/heptagon_effect.cc
+++ b/src/gpu/effects/heptagon_effect.cc
@@ -12,7 +12,8 @@ HeptagonEffect::HeptagonEffect(WGPUDevice device, WGPUQueue queue,
gpu_create_buffer(device_, sizeof(float) * 4,
WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst);
ResourceBinding bindings[] = {{uniforms_, WGPUBufferBindingType_Uniform}};
- pass_ = gpu_create_render_pass(device_, format, main_shader_wgsl, bindings, 1);
+ pass_ =
+ gpu_create_render_pass(device_, format, main_shader_wgsl, bindings, 1);
pass_.vertex_count = 21;
}
void HeptagonEffect::render(WGPURenderPassEncoder pass, float t, float b,
diff --git a/src/gpu/effects/particles_effect.cc b/src/gpu/effects/particles_effect.cc
index f2ef96b..6218af9 100644
--- a/src/gpu/effects/particles_effect.cc
+++ b/src/gpu/effects/particles_effect.cc
@@ -18,7 +18,8 @@ ParticlesEffect::ParticlesEffect(WGPUDevice device, WGPUQueue queue,
WGPUBufferUsage_Storage | WGPUBufferUsage_Vertex, init_p.data());
ResourceBinding cb[] = {{particles_buffer_, WGPUBufferBindingType_Storage},
{uniforms_, WGPUBufferBindingType_Uniform}};
- compute_pass_ = gpu_create_compute_pass(device_, particle_compute_wgsl, cb, 2);
+ compute_pass_ =
+ gpu_create_compute_pass(device_, particle_compute_wgsl, cb, 2);
compute_pass_.workgroup_size_x = (NUM_PARTICLES + 63) / 64;
ResourceBinding rb[] = {
{particles_buffer_, WGPUBufferBindingType_ReadOnlyStorage},
diff --git a/src/gpu/effects/post_process_helper.cc b/src/gpu/effects/post_process_helper.cc
index 7c64844..db89d77 100644
--- a/src/gpu/effects/post_process_helper.cc
+++ b/src/gpu/effects/post_process_helper.cc
@@ -6,9 +6,9 @@
#include <cstring>
// Helper to create a standard post-processing pipeline
-WGPURenderPipeline
-create_post_process_pipeline(WGPUDevice device, WGPUTextureFormat format,
- const char* shader_code) {
+WGPURenderPipeline create_post_process_pipeline(WGPUDevice device,
+ WGPUTextureFormat format,
+ const char* shader_code) {
WGPUShaderModuleDescriptor shader_desc = {};
WGPUShaderSourceWGSL wgsl_src = {};
wgsl_src.chain.sType = WGPUSType_ShaderSourceWGSL;
@@ -63,9 +63,8 @@ create_post_process_pipeline(WGPUDevice device, WGPUTextureFormat format,
// --- PostProcess Implementation Helper ---
void pp_update_bind_group(WGPUDevice device, WGPURenderPipeline pipeline,
- WGPUBindGroup* bind_group,
- WGPUTextureView input_view,
- GpuBuffer uniforms) {
+ WGPUBindGroup* bind_group, WGPUTextureView input_view,
+ GpuBuffer uniforms) {
if (*bind_group)
wgpuBindGroupRelease(*bind_group);
WGPUBindGroupLayout bgl = wgpuRenderPipelineGetBindGroupLayout(pipeline, 0);
diff --git a/src/gpu/effects/post_process_helper.h b/src/gpu/effects/post_process_helper.h
index 098687b..d3a37bd 100644
--- a/src/gpu/effects/post_process_helper.h
+++ b/src/gpu/effects/post_process_helper.h
@@ -7,7 +7,8 @@
#include <webgpu.h>
// Helper to create a standard post-processing pipeline
-WGPURenderPipeline create_post_process_pipeline(WGPUDevice device, WGPUTextureFormat format,
+WGPURenderPipeline create_post_process_pipeline(WGPUDevice device,
+ WGPUTextureFormat format,
const char* shader_code);
// Helper to update bind group for post-processing effects