summaryrefslogtreecommitdiff
path: root/src/effects/hybrid3_d_effect.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-16 15:20:39 +0100
committerskal <pascal.massimino@gmail.com>2026-02-16 15:20:39 +0100
commit1c9bc4abd5ab90a61e3485fe30ff3c6f9b4b319c (patch)
treeae97a9712411eedc1fee98c134fc54e53de8b047 /src/effects/hybrid3_d_effect.cc
parent80d395b8bc0c37778401eb771094c25db7a1b8a4 (diff)
refactor(headless): convert nullptr checks to strippable macros
Added HEADLESS_RETURN_IF_NULL/HEADLESS_RETURN_VAL_IF_NULL macros that compile to no-ops in STRIP_ALL/FINAL_STRIP modes. Files updated: - fatal_error.h: New headless check macros - sequence.cc: NodeRegistry::create_texture - post_process_helper.cc: Pipeline creation functions - sampler_cache.h: SamplerCache::get_or_create - bind_group_builder.h: Layout/group builders - pipeline_builder.h: Shader and pipeline builders - All effect constructors (7 files) Headless tests passing. STRIP_ALL builds will have zero overhead. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/effects/hybrid3_d_effect.cc')
-rw-r--r--src/effects/hybrid3_d_effect.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/effects/hybrid3_d_effect.cc b/src/effects/hybrid3_d_effect.cc
index 2a015a0..0e6ea35 100644
--- a/src/effects/hybrid3_d_effect.cc
+++ b/src/effects/hybrid3_d_effect.cc
@@ -1,6 +1,7 @@
// This file is part of the 64k demo project.
// It implements Hybrid3DEffect (simplified v2 port).
// TODO: Full Renderer3D integration with texture manager, noise assets
+#include "util/fatal_error.h"
#include "effects/hybrid3_d_effect.h"
#include <cmath>
@@ -10,10 +11,8 @@ 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;
- }
+ // Headless mode: skip GPU resource creation (compiled out in STRIP_ALL)
+ HEADLESS_RETURN_IF_NULL(ctx_.device);
// Initialize renderer (format is always RGBA8Unorm for v2)
renderer_.init(ctx_.device, ctx_.queue, WGPUTextureFormat_RGBA8Unorm);