summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gpu/demo_effects.h2
-rw-r--r--src/gpu/effect.cc7
-rw-r--r--src/gpu/effects/cnn_effect.cc2
-rw-r--r--src/platform/stub_types.h3
4 files changed, 8 insertions, 6 deletions
diff --git a/src/gpu/demo_effects.h b/src/gpu/demo_effects.h
index 6e6cb73..72b3f65 100644
--- a/src/gpu/demo_effects.h
+++ b/src/gpu/demo_effects.h
@@ -184,7 +184,7 @@ class DistortEffect : public PostProcessEffect {
// (included above) FlashEffect now defined in gpu/effects/flash_effect.h
// (included above)
-class CNNEffect;
+#include "gpu/effects/cnn_effect.h"
// Auto-generated functions
void LoadTimeline(MainSequence& main_seq, const GpuContext& ctx);
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);
diff --git a/src/gpu/effects/cnn_effect.cc b/src/gpu/effects/cnn_effect.cc
index f5d0a51..cb00455 100644
--- a/src/gpu/effects/cnn_effect.cc
+++ b/src/gpu/effects/cnn_effect.cc
@@ -142,7 +142,7 @@ void CNNEffect::update_bind_group(WGPUTextureView input_view) {
bge[3].buffer = params_buffer_.get().buffer;
bge[3].size = params_buffer_.get().size;
bge[4].binding = 4;
- bge[4].textureView = original_view_ ? original_view_ : input_view_; // Fallback
+ bge[4].textureView = original_view_ ? original_view_ : input_view_;
WGPUBindGroupDescriptor bgd = {};
bgd.layout = bgl;
diff --git a/src/platform/stub_types.h b/src/platform/stub_types.h
index f532e04..ff9cccf 100644
--- a/src/platform/stub_types.h
+++ b/src/platform/stub_types.h
@@ -47,8 +47,9 @@ typedef enum {
} WGPUBufferBindingType;
typedef enum {
- WGPULoadOp_Clear = 0,
+ WGPULoadOp_Undefined = 0,
WGPULoadOp_Load = 1,
+ WGPULoadOp_Clear = 2,
} WGPULoadOp;
typedef enum {