5d83c11169
- cpp/functions/gfx/dag_types: DagStep, DagNodeDef, DagControl (header-only) - cpp/functions/gfx/dag_catalog: 10 hardcoded nodes (4 gen, 3 op, 3 blend) ported from shader-dag-blends.jsx - cpp/functions/gfx/dag_compile: pipeline → GLSL 330 core with fan-in via source_id - cpp/functions/gfx/dag_uniforms: upload u_params[16] via glUniform4fv - cpp/functions/gfx/dag_panel: ImGui pipeline editor (add/remove/reorder/controls) - main.cpp: Code/DAG mode toggle, per-mode compile path and uniforms - gl_loader: +glUniform4fv - rebuild Windows .exe Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.9 KiB
1.9 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, params, output
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | params | output | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| dag_compile | function | cpp | gfx | 1.0.0 | pure | std::string compile_dag_to_glsl(const std::vector<DagStep>& pipeline) | Compila un pipeline DAG a GLSL 330 core listo para pasarle a gl_shader::compile_fragment. Emite uniform vec4 u_params[16], una funcion node_<i> por paso y void main() que encadena los outputs. Blends usan source_id para fan-in estable ante reorders. |
|
|
|
false |
|
false | cpp/functions/gfx/dag_compile.cpp |
|
String GLSL que se pega tras el preamble de gl_shader (que ya declara #version 330 core, fragColor, u_time, u_resolution, u_mouse). Incluye uniform vec4 u_params[16], funciones node_<i> y void main(). |
Estructura del GLSL emitido
uniform vec4 u_params[16];
vec4 node_0(vec4 c, vec2 uv) { ... }
vec4 node_1(vec4 a, vec4 b, vec2 uv) { ... } // blend
void main() {
vec2 uv = gl_FragCoord.xy / u_resolution;
vec4 c = vec4(0.04, 0.04, 0.06, 1.0);
vec4 out_0 = node_0(vec4(0.0, 0.0, 0.0, 1.0), uv);
vec4 out_1 = node_1(out_0, out_0, uv);
fragColor = out_1;
}
Notas
- El preamble de gl_shader::compile_fragment ya declara los 3 uniforms basicos. compile_dag_to_glsl NO los redeclara.
- Si el pipeline esta vacio, emite void main() que pinta gris oscuro (0.04, 0.04, 0.06).
- MAX_NODES = 16. Pipelines mas largos se truncan silenciosamente.
- source_id fallback: si el id no se encuentra o apunta a un indice >= idx, usa max(0, idx-2).