summaryrefslogtreecommitdiff
path: root/src/gpu/effect.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-10 13:56:06 +0100
committerskal <pascal.massimino@gmail.com>2026-02-10 13:56:06 +0100
commitebb1a07857fe25fdaa66b2f86303bc8fbd621cfe (patch)
tree3e5920c9336a328eff83d0d66a5bafee22c69d66 /src/gpu/effect.cc
parent6944733a6a2f05c18e7e0b73f847a4c9144801fd (diff)
fix: Capture scene framebuffer before post-processing for CNN effect
CNNEffect's "original" input was black because FadeEffect (priority 1) ran before CNNEffect (priority 1), fading the scene. Changed framebuffer capture to use framebuffer_a (scene output) instead of current_input (post-chain). Also add seq_compiler validation to detect post-process priority collisions within and across concurrent sequences, preventing similar render order issues. Updated stub_types.h WGPULoadOp enum values to match webgpu.h spec. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/gpu/effect.cc')
-rw-r--r--src/gpu/effect.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gpu/effect.cc b/src/gpu/effect.cc
index 0662f26..b50acce 100644
--- a/src/gpu/effect.cc
+++ b/src/gpu/effect.cc
@@ -349,8 +349,9 @@ void MainSequence::render_frame(float global_time, float beat, float peak,
WGPURenderPassColorAttachment capture_attachment = {};
capture_attachment.view = captured_view;
capture_attachment.resolveTarget = nullptr;
- capture_attachment.loadOp = WGPULoadOp_Load;
+ capture_attachment.loadOp = WGPULoadOp_Clear;
capture_attachment.storeOp = WGPUStoreOp_Store;
+ capture_attachment.clearValue = {0.0f, 0.0f, 0.0f, 1.0f};
#if !defined(DEMO_CROSS_COMPILE_WIN32)
capture_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED;
#endif
@@ -362,10 +363,10 @@ void MainSequence::render_frame(float global_time, float beat, float peak,
(float)width_, (float)height_, 0.0f,
1.0f);
- // Use passthrough effect to copy current_input to captured_frame
+ // Use passthrough effect to copy framebuffer_a (scene) to captured_frame
PostProcessEffect* passthrough =
(PostProcessEffect*)passthrough_effect_.get();
- passthrough->update_bind_group(current_input);
+ passthrough->update_bind_group(framebuffer_view_a_);
passthrough->render(capture_pass, 0, 0, 0, aspect_ratio);
wgpuRenderPassEncoderEnd(capture_pass);