feat: get full evaluation back online

Very hacky, but this is enough to be finished with the graph IR for now.
This commit is contained in:
multisn8 2024-01-21 04:21:33 +01:00
parent 3c529c3a1a
commit 3e208335c3
Signed by: multisamplednight
GPG key ID: 6D525AA147CBDAE2
9 changed files with 105 additions and 26 deletions

View file

@ -49,7 +49,7 @@ impl Input {
///
/// In contrast to [`Input`]s, [`Output`]s may be used or unused.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
pub struct Output(pub(super) Socket);
pub struct Output(pub Socket); // TODO: Restrict publicness to super
impl Output {
#[must_use]
@ -75,7 +75,7 @@ pub struct Socket {
/// This really only serves for denoting where a socket is,
/// when it's already clear which instruction is referred to.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
pub struct SocketIdx(pub u16);
pub struct SocketIdx(pub u16); // TODO: Restrict publicness to super
impl fmt::Debug for SocketIdx {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

View file

@ -27,6 +27,8 @@ pub fn from_ron(source: &str) -> ron::error::SpannedResult<GraphIr> {
/// The toplevel representation of a whole pipeline.
///
/// # DAGs
///
/// Pipelines may not be fully linear. They may branch out and recombine later on.
/// As such, the representation for them which is currently used is a
/// [**D**irected **A**cyclic **G**raph](https://en.wikipedia.org/wiki/Directed_acyclic_graph).
@ -56,6 +58,27 @@ pub fn from_ron(source: &str) -> ron::error::SpannedResult<GraphIr> {
/// So the vertices of the DAG are the **sockets**
/// (which are either [`id::Input`] or [`id::Output`] depending on the direction),
/// and each **socket** in turn belongs to an **instruction**.
///
/// # Usage
///
/// - If you want to build one from scratch,
/// add a few helper methods like
/// constructing an empty one,
/// adding instructions and
/// adding edges
/// - If you want to construct one from an existing repr,
/// maybe you want to use [`semi_human::GraphIr`].
///
/// # Storing additional data
///
/// Chances are the graph IR seems somewhat fit to put metadata in it.
/// However, most likely you're interacting in context of some other system,
/// and also want to manage and index that data on your own.
///
/// As such, consider using _secondary_ maps instead.
/// That is, store in a data structure _you_ own a mapping
/// from [`id`]s
/// to whatever data you need.
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
pub struct GraphIr {
/// "Backbone" storage of all **instruction** IDs to

View file

@ -1,3 +0,0 @@
pub enum DynamicValue {
Image(DynamicImage),
}