From 64f977f6fbedf75d5edbc3963e002b593c8428d8 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 17 Feb 2026 08:16:03 +0100 Subject: style: Apply clang-format --- src/gpu/sequence.cc | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'src/gpu/sequence.cc') diff --git a/src/gpu/sequence.cc b/src/gpu/sequence.cc index 0a0cb1e..5348992 100644 --- a/src/gpu/sequence.cc +++ b/src/gpu/sequence.cc @@ -42,9 +42,9 @@ NodeRegistry::~NodeRegistry() { } void NodeRegistry::declare_node(const std::string& name, NodeType type, - int width, int height) { - FATAL_CHECK(nodes_.find(name) == nodes_.end(), - "Node already declared: %s\n", name.c_str()); + int width, int height) { + FATAL_CHECK(nodes_.find(name) == nodes_.end(), "Node already declared: %s\n", + name.c_str()); if (width <= 0) width = default_width_; @@ -64,8 +64,8 @@ void NodeRegistry::declare_aliased_node(const std::string& name, const std::string& alias_of) { FATAL_CHECK(nodes_.find(alias_of) != nodes_.end(), "Alias target does not exist: %s\n", alias_of.c_str()); - FATAL_CHECK(aliases_.find(name) == aliases_.end(), "Alias already exists: %s\n", - name.c_str()); + FATAL_CHECK(aliases_.find(name) == aliases_.end(), + "Alias already exists: %s\n", name.c_str()); aliases_[name] = alias_of; } @@ -131,7 +131,7 @@ bool NodeRegistry::has_node(const std::string& name) const { } void NodeRegistry::set_external_view(const std::string& name, - WGPUTextureView view) { + WGPUTextureView view) { // Register external view (texture not owned by registry) Node node = {}; node.view = view; @@ -151,15 +151,25 @@ void NodeRegistry::create_texture(Node& node) { switch (node.type) { case NodeType::U8X4_NORM: format = WGPUTextureFormat_RGBA8Unorm; - usage = (WGPUTextureUsage)(WGPUTextureUsage_RenderAttachment | WGPUTextureUsage_TextureBinding | WGPUTextureUsage_CopySrc | WGPUTextureUsage_CopyDst); + usage = + (WGPUTextureUsage)(WGPUTextureUsage_RenderAttachment | + WGPUTextureUsage_TextureBinding | + WGPUTextureUsage_CopySrc | WGPUTextureUsage_CopyDst); break; case NodeType::F32X4: format = WGPUTextureFormat_RGBA32Float; - usage = (WGPUTextureUsage)(WGPUTextureUsage_RenderAttachment | WGPUTextureUsage_TextureBinding | WGPUTextureUsage_CopySrc | WGPUTextureUsage_CopyDst); + usage = + (WGPUTextureUsage)(WGPUTextureUsage_RenderAttachment | + WGPUTextureUsage_TextureBinding | + WGPUTextureUsage_CopySrc | WGPUTextureUsage_CopyDst); break; case NodeType::F16X8: - format = WGPUTextureFormat_RGBA16Float; // WebGPU doesn't have 8-channel, use RGBA16 - usage = (WGPUTextureUsage)(WGPUTextureUsage_RenderAttachment | WGPUTextureUsage_TextureBinding | WGPUTextureUsage_CopySrc | WGPUTextureUsage_CopyDst); + format = WGPUTextureFormat_RGBA16Float; // WebGPU doesn't have 8-channel, + // use RGBA16 + usage = + (WGPUTextureUsage)(WGPUTextureUsage_RenderAttachment | + WGPUTextureUsage_TextureBinding | + WGPUTextureUsage_CopySrc | WGPUTextureUsage_CopyDst); break; case NodeType::DEPTH24: format = WGPUTextureFormat_Depth24Plus; @@ -167,7 +177,8 @@ void NodeRegistry::create_texture(Node& node) { break; case NodeType::COMPUTE_F32: format = WGPUTextureFormat_RGBA32Float; - usage = (WGPUTextureUsage)(WGPUTextureUsage_StorageBinding | WGPUTextureUsage_TextureBinding); + usage = (WGPUTextureUsage)(WGPUTextureUsage_StorageBinding | + WGPUTextureUsage_TextureBinding); break; } @@ -207,8 +218,9 @@ Sequence::Sequence(const GpuContext& ctx, int width, int height) } void Sequence::preprocess(float seq_time, float beat_time, float beat_phase, - float audio_intensity) { - params_.resolution = {static_cast(width_), static_cast(height_)}; + float audio_intensity) { + params_.resolution = {static_cast(width_), + static_cast(height_)}; params_.aspect_ratio = static_cast(width_) / static_cast(height_); params_.time = seq_time; -- cgit v1.2.3