summaryrefslogtreecommitdiff
path: root/cnn_v3/src/gbuffer_effect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cnn_v3/src/gbuffer_effect.cc')
-rw-r--r--cnn_v3/src/gbuffer_effect.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/cnn_v3/src/gbuffer_effect.cc b/cnn_v3/src/gbuffer_effect.cc
index 512843c..1bfd685 100644
--- a/cnn_v3/src/gbuffer_effect.cc
+++ b/cnn_v3/src/gbuffer_effect.cc
@@ -773,10 +773,18 @@ void GBufferEffect::update_raster_bind_group(NodeRegistry& nodes) {
wgpuBindGroupLayoutRelease(bgl);
}
+void GBufferEffect::wire_dag(const std::vector<EffectDAGNode>& dag) {
+ const std::string out = find_downstream_output(dag);
+ // "sink" is an external view (no owned texture) — not a valid copy source.
+ if (out != "sink") cnn_output_node_ = out;
+}
+
void GBufferEffect::post_render(WGPUCommandEncoder encoder, NodeRegistry& nodes) {
if (cnn_output_node_.empty() || !nodes.has_node(cnn_output_node_)) return;
+ WGPUTexture src_tex = nodes.get_texture(cnn_output_node_);
+ if (!src_tex) return; // external view (e.g. sink) — no owned texture to copy
WGPUTexelCopyTextureInfo src = {};
- src.texture = nodes.get_texture(cnn_output_node_);
+ src.texture = src_tex;
src.mipLevel = 0;
WGPUTexelCopyTextureInfo dst = {};
dst.texture = nodes.get_texture(node_prev_tex_);