feat(shaders_lab): visual node editor (imgui-node-editor) + multi-source

- cpp/vendor/imgui-node-editor: vendorized thedmd/imgui-node-editor v0.9.4
- cpp/functions/gfx/dag_node_editor: new visual pipeline editor replacing dag_panel
- DagStep: source_ids[4] + editor_pos + editor_uid (multi-input support)
- DagNodeDef: num_inputs explicit; circle reclassified as Op
- dag_compile: N inputs per node, topological ordering preserved
- main: use node editor; destroy on shutdown
- patch imgui_extra_math.inl: guard operator*(float, ImVec2) for imgui >= 18955

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-24 21:55:43 +02:00
parent bf5011de93
commit 88fca7b128
89 changed files with 22289 additions and 41 deletions
+43
View File
@@ -0,0 +1,43 @@
---
name: dag_node_editor
kind: function
lang: cpp
domain: gfx
version: "1.0.0"
purity: impure
signature: "bool dag_node_editor(std::vector<DagStep>& pipeline)"
description: "Renderiza el node editor visual (imgui-node-editor) para el DAG de shaders. Modifica el pipeline in-place: añade/borra nodos, gestiona aristas (source_ids). Devuelve true si la topologia cambio."
tags: [dag, imgui, node-editor, shader, visual, pipeline, gfx]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: ["imgui_node_editor.h", "gfx/dag_catalog.h", "gfx/dag_types.h"]
tested: false
tests: []
test_file_path: ""
file_path: "cpp/functions/gfx/dag_node_editor.cpp"
params:
- name: pipeline
desc: "vector de DagStep que representa el pipeline actual; modificado in-place"
output: "true si la topologia cambio (nodos o aristas añadidos/quitados); false en caso contrario"
---
## Notas
Sustituye a `dag_panel` como UI del pipeline. Usa `ax::NodeEditor` (thedmd/imgui-node-editor v0.9.4) con contexto singleton estático.
Codificacion de IDs:
- Node id = `editor_uid` del step
- Output pin = `(uid << 8) | 0`
- Input pin = `(uid << 8) | (slot + 1)`
- Link id = `(from_uid << 20) | (to_uid << 8) | slot`
Aplica topological sort (Kahn) tras cada cambio de topologia. Rechaza ciclos en `BeginCreate`.
Multi-source: cada nodo declara `num_inputs` (0-4). Los slots de `source_ids[]` se mapean a los inputs del shader GLSL (`a`, `b`, `c`, `d`).
## Dependencia
Requiere `imgui_node_editor` static library linkeada (`cpp/vendor/imgui-node-editor`).