summaryrefslogtreecommitdiff
path: root/src/effects
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/gaussian_blur_effect.cc5
-rw-r--r--src/effects/heptagon_effect.cc5
-rw-r--r--src/effects/hybrid3_d_effect.cc5
-rw-r--r--src/effects/particles_effect.cc5
-rw-r--r--src/effects/passthrough_effect.cc5
5 files changed, 25 insertions, 0 deletions
diff --git a/src/effects/gaussian_blur_effect.cc b/src/effects/gaussian_blur_effect.cc
index 17c657f..fdf1807 100644
--- a/src/effects/gaussian_blur_effect.cc
+++ b/src/effects/gaussian_blur_effect.cc
@@ -9,6 +9,11 @@ GaussianBlurEffect::GaussianBlurEffect(const GpuContext& ctx,
const std::vector<std::string>& outputs)
: Effect(ctx, inputs, outputs), pipeline_(nullptr), bind_group_(nullptr),
sampler_(nullptr) {
+ // Headless mode: skip GPU resource creation
+ if (ctx_.device == nullptr) {
+ return;
+ }
+
// Create pipeline
pipeline_ = create_post_process_pipeline(ctx_.device, WGPUTextureFormat_RGBA8Unorm,
gaussian_blur_v2_shader_wgsl);
diff --git a/src/effects/heptagon_effect.cc b/src/effects/heptagon_effect.cc
index 27d59da..3321517 100644
--- a/src/effects/heptagon_effect.cc
+++ b/src/effects/heptagon_effect.cc
@@ -9,6 +9,11 @@ HeptagonEffect::HeptagonEffect(const GpuContext& ctx,
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
+ if (ctx_.device == nullptr) {
+ return;
+ }
+
// Init uniforms
uniforms_buffer_.init(ctx_.device);
diff --git a/src/effects/hybrid3_d_effect.cc b/src/effects/hybrid3_d_effect.cc
index ced5b42..2a015a0 100644
--- a/src/effects/hybrid3_d_effect.cc
+++ b/src/effects/hybrid3_d_effect.cc
@@ -10,6 +10,11 @@ Hybrid3DEffect::Hybrid3DEffect(const GpuContext& ctx,
const std::vector<std::string>& outputs)
: Effect(ctx, inputs, outputs), depth_node_(outputs[0] + "_depth"),
dummy_texture_(nullptr), dummy_texture_view_(nullptr) {
+ // Headless mode: skip GPU resource creation
+ if (ctx_.device == nullptr) {
+ return;
+ }
+
// Initialize renderer (format is always RGBA8Unorm for v2)
renderer_.init(ctx_.device, ctx_.queue, WGPUTextureFormat_RGBA8Unorm);
diff --git a/src/effects/particles_effect.cc b/src/effects/particles_effect.cc
index 9d73bf7..709acbf 100644
--- a/src/effects/particles_effect.cc
+++ b/src/effects/particles_effect.cc
@@ -10,6 +10,11 @@ ParticlesEffect::ParticlesEffect(const GpuContext& ctx,
const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs)
: Effect(ctx, inputs, outputs) {
+ // Headless mode: skip GPU resource creation
+ if (ctx_.device == nullptr) {
+ return;
+ }
+
// Initialize uniforms
uniforms_.init(ctx_.device);
diff --git a/src/effects/passthrough_effect.cc b/src/effects/passthrough_effect.cc
index ba98657..c4106b1 100644
--- a/src/effects/passthrough_effect.cc
+++ b/src/effects/passthrough_effect.cc
@@ -9,6 +9,11 @@ PassthroughEffect::PassthroughEffect(const GpuContext& ctx,
const std::vector<std::string>& outputs)
: Effect(ctx, inputs, outputs), pipeline_(nullptr), bind_group_(nullptr),
sampler_(nullptr) {
+ // Headless mode: skip GPU resource creation
+ if (ctx_.device == nullptr) {
+ return;
+ }
+
// Init uniform buffer
uniforms_buffer_.init(ctx_.device);
// Create pipeline (simple version without effect params)