Files
craft-libs/crates/material-graph/src/lib.rs
T
Valentin Klein c3155aad96 Share the material graph runtime and WGSL pixel compiler (#3109)
* Extract the material graph runtime from TextureCraft

Preserve its evaluator, compiler, existing verification, and format reference from TextureCraft #777 at 22a37c29.

Original TextureCraft importer author: xilefenko (TextureCraft #521).

* Adapt graph helpers to the shared workspace lints

Preserve node evaluation and version tracking while splitting long dispatch branches. Update the EXR doctest and rule table references for the shared crate.

* Read the format reference with LF endings in its test

* Test that the format reference example reads the same with CRLF line endings

* Make the kind versions follow module attributes, arm order, raw strings, includes and the epoch

* Fix graph cache keys, publish, import and subgraph extraction; harden the graph tests

* Keep the cubic sampler from panicking on NaN texels; say what RGBE drops; check NaN halves by their bits

* Lower vector inputs of f_to_bool and f_vec to valid WGSL; tighten the FX-map error and pattern coverage tests; document clamping and the splatter data cutoff

* Say which composite glyph placements the font reader lacks; fail the y-up text test on a blank render

* Leave publish as it was; unit-test the WGSL vector lowering; document EPOCH and keep_outputs results

* Satisfy clippy in the version scanner and the WGSL lowering; compare cache hits by relation
2026-11-23 08:55:49 -05:00

45 lines
1.3 KiB
Rust

// SPDX-License-Identifier: MIT OR Apache-2.0
//! Material graphs parsed from text and evaluated to float RGBA images. The CPU evaluator provides a reference
//! implementation. Hosts can supply an [`accelerator::Accelerator`] to evaluate supported operations on a GPU.
//! Callers provide per-evaluation settings through [`context::EvalContext`] and allocate their own [`graph::NodeCache`].
//! The graph text format is documented in [`docs/format.md`](../docs/format.md).
#![forbid(unsafe_code)]
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::indexing_slicing, clippy::unimplemented, clippy::todo, clippy::unreachable)]
pub mod accelerator;
pub mod atomic;
pub mod checksum;
pub mod compiled_ops;
pub mod context;
pub mod curve;
pub mod deflate;
pub mod expr;
pub mod exr;
pub mod font;
pub mod func;
pub mod fxmap;
pub mod graph;
pub mod grunge;
pub mod half;
pub mod lcg_rand;
pub mod math;
pub mod measured;
pub mod names;
pub mod nodes2;
pub mod noise;
pub mod ops;
pub mod par;
pub mod params;
pub mod patterns;
pub mod png;
pub mod profile;
pub mod scatter;
pub mod tex;
pub mod vector;
pub mod versions;
/// The data-parallel library the engine runs on, for hosts that build an [`context::EvalContext::pool`].
pub use rayon;
#[cfg(test)]
mod rule_tables;