Перейти к содержанию

Render Graph Resource Types Plan

Goal

Make render graph resources typed enough to represent an FBO as a tuple of attachments, while allowing passes to consume color and depth attachments as sampled textures.

Initial public resource/socket types:

  • fbo: tuple resource with color attachment and optional depth attachment.
  • color_texture: sampled/view reference to an FBO color attachment.
  • depth_texture: sampled/view reference to an FBO depth attachment.
  • shadow: existing shadow resource type.

FboSplit and FboJoin are compile-time graph nodes. They are not runtime passes and must not create tc_pass instances.

Implementation Checklist

  1. [x] Add graph utility node definitions.
  2. [x] Add termin/render/graph_node_def.hpp.
  3. [x] Add termin-render/src/graph_node_def.cpp.
  4. [x] Register boundary/utility node definitions in one C++ source of truth: resource, external_rt, render_target_input, pipeline_output, output, fbo_split, fbo_join.

  5. [x] Add resource alias model.

  6. [x] Add AttachmentKind, ResourceView, and FboComposition.
  7. [x] Store views/compositions in ResourceNaming.
  8. [x] Store views/compositions in PipelineRenderCache so RenderEngine can use the compiled graph metadata.

  9. [x] Update C++ graph data parsing.

  10. [x] GraphData::from_trent must get boundary/utility sockets from graph node definitions instead of hard-coded if/else sockets.
  11. [x] Pass sockets still come from inspect graph metadata.

  12. [x] Update graph compilation.

  13. [x] is_pass_node must treat registered non-executable graph nodes as non-passes.
  14. [x] assign_resource_names must create view aliases for fbo_split: A.color -> {parent=A, attachment=color} and A.depth -> {parent=A, attachment=depth}.
  15. [x] assign_resource_names must create FBO compositions for fbo_join.
  16. [x] compile_graph must copy the alias maps into PipelineRenderCache.
  17. [x] FboSplit/FboJoin must not add resource specs and must not create runtime passes.

  18. [x] Add type validation.

  19. [x] Allow same-type connections.
  20. [x] Require explicit FboSplit/FboJoin for conversions between fbo, color_texture, and depth_texture.
  21. [x] Log/throw compile errors instead of guessing.

  22. [x] Update render engine.

  23. [x] After collecting FBO textures, apply resource_views.
  24. [x] After views, apply fbo_compositions.
  25. [x] Do not allocate a new FBO for composed FBO resources.
  26. [x] Log ERROR when a view/composition refers to a missing attachment.

  27. [x] Update UI editors.

  28. [x] Add FBO Split and FBO Join in tcgui pipeline editor.
  29. [x] Add matching nodes in Qt nodegraph.
  30. [x] Both editors must serialize to the same graph format; compilation remains C++ only.

  31. [x] Add tests.

  32. [x] Split creates color_texture and depth_texture views.
  33. [x] Join creates an FBO composition and no runtime pass.
  34. [x] Split/join nodes do not add resource specs.
  35. [x] Invalid direct type conversion fails.
  36. [x] RenderTargetInput.color -> FboSplit -> FboJoin -> PipelineOutput.color compiles through the C++ compiler.