summaryrefslogtreecommitdiff
path: root/src/gpu/sequence.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-17 08:16:03 +0100
committerskal <pascal.massimino@gmail.com>2026-02-17 08:16:03 +0100
commit64f977f6fbedf75d5edbc3963e002b593c8428d8 (patch)
treeef711b63d34b5c3f5ecc93d46a0a3ab0b6d26a6f /src/gpu/sequence.cc
parent8c9332c16b44270921eb1b6a2886717eb3435d5d (diff)
style: Apply clang-format
Diffstat (limited to 'src/gpu/sequence.cc')
-rw-r--r--src/gpu/sequence.cc38
1 files changed, 25 insertions, 13 deletions
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<float>(width_), static_cast<float>(height_)};
+ float audio_intensity) {
+ params_.resolution = {static_cast<float>(width_),
+ static_cast<float>(height_)};
params_.aspect_ratio =
static_cast<float>(width_) / static_cast<float>(height_);
params_.time = seq_time;