summaryrefslogtreecommitdiff
path: root/src/effects/placeholder_effect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/placeholder_effect.cc')
-rw-r--r--src/effects/placeholder_effect.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/effects/placeholder_effect.cc b/src/effects/placeholder_effect.cc
index 73ee5a8..1428779 100644
--- a/src/effects/placeholder_effect.cc
+++ b/src/effects/placeholder_effect.cc
@@ -1,15 +1,15 @@
// Placeholder effect implementation - logs TODO warning once
#include "effects/placeholder_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"
#include <cstdio>
Placeholder::Placeholder(const GpuContext& ctx,
- const std::vector<std::string>& inputs,
- const std::vector<std::string>& outputs,
- const char* placeholder_name)
+ const std::vector<std::string>& inputs,
+ const std::vector<std::string>& outputs,
+ const char* placeholder_name)
: Effect(ctx, inputs, outputs), pipeline_(nullptr), bind_group_(nullptr),
sampler_(nullptr), name_(placeholder_name) {
// Log once on construction
@@ -19,8 +19,8 @@ Placeholder::Placeholder(const GpuContext& ctx,
HEADLESS_RETURN_IF_NULL(ctx_.device);
uniforms_buffer_.init(ctx_.device);
- pipeline_ = create_post_process_pipeline(ctx_.device, WGPUTextureFormat_RGBA8Unorm,
- passthrough_shader_wgsl);
+ pipeline_ = create_post_process_pipeline(
+ ctx_.device, WGPUTextureFormat_RGBA8Unorm, passthrough_shader_wgsl);
WGPUSamplerDescriptor sampler_desc = {};
sampler_desc.addressModeU = WGPUAddressMode_ClampToEdge;
@@ -34,8 +34,8 @@ Placeholder::Placeholder(const GpuContext& ctx,
}
void Placeholder::render(WGPUCommandEncoder encoder,
- const UniformsSequenceParams& params,
- NodeRegistry& nodes) {
+ const UniformsSequenceParams& params,
+ NodeRegistry& nodes) {
WGPUTextureView input_view = nodes.get_view(input_nodes_[0]);
WGPUTextureView output_view = nodes.get_view(output_nodes_[0]);
@@ -45,18 +45,18 @@ void Placeholder::render(WGPUCommandEncoder encoder,
uniforms_buffer_.get(), {nullptr, 0});
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);