From 42de5c4e5aeb486b4afb5b73bcb6a9d5ba567cbd Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 16 Feb 2026 15:15:40 +0100 Subject: fix(headless): add nullptr checks for GPU resource creation - NodeRegistry::create_texture: skip texture creation when device is nullptr - Post-process helpers: skip pipeline/bind group creation in headless mode - SamplerCache: return nullptr for headless mode - BindGroupLayoutBuilder/BindGroupBuilder: skip creation with null device - RenderPipelineBuilder: skip shader module and pipeline creation in headless - PlaceholderEffect: skip sampler creation in headless mode - RotatingCubeEffect: early return in constructor for headless mode WIP: Some effects (GaussianBlur, etc.) still need headless checks Co-Authored-By: Claude Sonnet 4.5 --- src/effects/rotating_cube_effect.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/effects/rotating_cube_effect.cc') diff --git a/src/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc index 3f1d445..e7ed52e 100644 --- a/src/effects/rotating_cube_effect.cc +++ b/src/effects/rotating_cube_effect.cc @@ -10,6 +10,11 @@ RotatingCubeEffect::RotatingCubeEffect(const GpuContext& ctx, const std::vector& inputs, const std::vector& outputs) : Effect(ctx, inputs, outputs), depth_node_(outputs[0] + "_depth") { + // Headless mode: skip GPU resource creation + if (ctx_.device == nullptr) { + return; + } + // Create uniform buffers uniform_buffer_ = gpu_create_buffer(ctx_.device, sizeof(Uniforms), -- cgit v1.2.3