diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-17 08:16:03 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-17 08:16:03 +0100 |
| commit | 64f977f6fbedf75d5edbc3963e002b593c8428d8 (patch) | |
| tree | ef711b63d34b5c3f5ecc93d46a0a3ab0b6d26a6f /src/effects/passthrough_effect.cc | |
| parent | 8c9332c16b44270921eb1b6a2886717eb3435d5d (diff) | |
style: Apply clang-format
Diffstat (limited to 'src/effects/passthrough_effect.cc')
| -rw-r--r-- | src/effects/passthrough_effect.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/effects/passthrough_effect.cc b/src/effects/passthrough_effect.cc index 94da241..be53846 100644 --- a/src/effects/passthrough_effect.cc +++ b/src/effects/passthrough_effect.cc @@ -1,13 +1,13 @@ // Passthrough effect implementation #include "effects/passthrough_effect.h" -#include "util/fatal_error.h" -#include "gpu/post_process_helper.h" #include "effects/shaders.h" +#include "gpu/post_process_helper.h" +#include "util/fatal_error.h" Passthrough::Passthrough(const GpuContext& ctx, - const std::vector<std::string>& inputs, - const std::vector<std::string>& outputs) + const std::vector<std::string>& inputs, + const std::vector<std::string>& outputs) : Effect(ctx, inputs, outputs), pipeline_(nullptr), bind_group_(nullptr), sampler_(nullptr) { // Headless mode: skip GPU resource creation (compiled out in STRIP_ALL) @@ -16,8 +16,8 @@ Passthrough::Passthrough(const GpuContext& ctx, // Init uniform buffer uniforms_buffer_.init(ctx_.device); // Create pipeline (simple version without effect params) - pipeline_ = create_post_process_pipeline_simple(ctx_.device, WGPUTextureFormat_RGBA8Unorm, - passthrough_shader_wgsl); + pipeline_ = create_post_process_pipeline_simple( + ctx_.device, WGPUTextureFormat_RGBA8Unorm, passthrough_shader_wgsl); // Create sampler WGPUSamplerDescriptor sampler_desc = {}; @@ -32,8 +32,8 @@ Passthrough::Passthrough(const GpuContext& ctx, } void Passthrough::render(WGPUCommandEncoder encoder, - const UniformsSequenceParams& params, - NodeRegistry& nodes) { + const UniformsSequenceParams& params, + NodeRegistry& nodes) { // Get input/output views WGPUTextureView input_view = nodes.get_view(input_nodes_[0]); WGPUTextureView output_view = nodes.get_view(output_nodes_[0]); @@ -63,21 +63,21 @@ void Passthrough::render(WGPUCommandEncoder encoder, // Render pass WGPURenderPassColorAttachment color_attachment = { - .view = output_view, - .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, - .loadOp = WGPULoadOp_Clear, - .storeOp = WGPUStoreOp_Store, - .clearValue = {0.0, 0.0, 0.0, 1.0} - }; + .view = output_view, + .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, + .loadOp = WGPULoadOp_Clear, + .storeOp = WGPUStoreOp_Store, + .clearValue = {0.0, 0.0, 0.0, 1.0}}; WGPURenderPassDescriptor pass_desc = {}; pass_desc.colorAttachmentCount = 1; pass_desc.colorAttachments = &color_attachment; - WGPURenderPassEncoder pass = wgpuCommandEncoderBeginRenderPass(encoder, &pass_desc); + WGPURenderPassEncoder pass = + wgpuCommandEncoderBeginRenderPass(encoder, &pass_desc); wgpuRenderPassEncoderSetPipeline(pass, pipeline_); wgpuRenderPassEncoderSetBindGroup(pass, 0, bind_group_, 0, nullptr); - wgpuRenderPassEncoderDraw(pass, 3, 1, 0, 0); // Fullscreen triangle + wgpuRenderPassEncoderDraw(pass, 3, 1, 0, 0); // Fullscreen triangle wgpuRenderPassEncoderEnd(pass); wgpuRenderPassEncoderRelease(pass); } |
