- DagStep: preview_open flag (default false).
- dag_compile: emit `uniform int u_preview_target` and a series of
early-return branches at the start of fragColor selection. -1 (default)
falls through to the real Output-driven fragColor.
- dag_node_previews (new fn): per-node FBO keyed by editor_uid, lazy
created. Renders each node with preview_open=true to its FBO by
setting u_preview_target = step index. Texture exposed via
dag_preview_texture(uid) for ImGui::Image.
- dag_node_editor: small toggle button "[+] preview"/"[-] preview" in
each non-Output node; when open, ImGui::Image(96x64, V-flipped).
- dag_node_editor: double right-click on hovered node deletes it
(Output is protected).
- main.cpp: dag_previews_render after Canvas DAG; dag_previews_destroy
on shutdown.
Single GL program drives both the canvas and all thumbnails — moving
sliders never recompiles, only the topology change does.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous InvisibleButton captured mouse events, so you could drag
from the Functions palette into the canvas, but node dragging and
slider interaction inside the canvas stopped working.
Fix: watch the global drag-drop payload without an explicit target. When
the mouse releases LMB over the DAG window with a "DAG_NODE_TYPE"
payload active, queue an add at that canvas position. No button, no
capture.
Tests (compiled standalone with preprocessor defines):
- dag_compile: 6/6 asserts (empty, single gen, op chain, multi-source
blend, Output-driven fragColor, unconnected-Output fallback).
- dag_catalog: 8/8 asserts (uniqueness, per-kind input invariants,
exactly one Output, body_glsl present & returns, control param
indices valid).
Build with:
g++ -std=c++17 -Icpp/functions -DDAG_COMPILE_TEST cpp/functions/gfx/dag_compile.cpp cpp/functions/gfx/dag_catalog.cpp -o /tmp/dag_compile_test
g++ -std=c++17 -Icpp/functions -DDAG_CATALOG_TEST cpp/functions/gfx/dag_catalog.cpp -o /tmp/dag_catalog_test
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>