mirror of
https://github.com/storytold/materialcraft.git
synced 2026-11-28 17:19:17 +01:00
Auto: Reuse SBS parsing and fix stale preview cache failures
Integrate main's read limits and preserve the font, evaluator, converter, and measured preview repairs. Complete the scoped type, comment, and spacing cleanup. Reuse one validated XML document for library layout and graph reads. Associate cache maintenance completion with its submitted revision so old failures cannot consume new settings or clear requests.
This commit is contained in:
commit
1a7225c8c2
158 files changed
+2536
-788
No files matched your search
@@ -12,7 +12,8 @@ pub(crate) fn evaluate(
|
||||
) -> Result<Value, String> {
|
||||
let program = compile(function, seed)?;
|
||||
let scalar_channel = allow_scalar && expected == ValueType::Float4 && program.output_type() == ValueType::Float as u32;
|
||||
// A color parameter also takes a gray level or an opaque RGB triple.
|
||||
|
||||
// A color parameter also takes a gray level or an opaque RGB triple
|
||||
let widened = expected == ValueType::Float4 && [ValueType::Float as u32, ValueType::Float3 as u32].contains(&program.output_type());
|
||||
if program.output_type() != expected as u32 && !scalar_channel && !widened {
|
||||
return Err(format!("output must be {}", expected.label()));
|
||||
@@ -28,6 +29,7 @@ pub(crate) fn evaluate(
|
||||
Value::Float4(values) | Value::Color(values) => values.iter().all(|value| value.is_finite()),
|
||||
_ => true,
|
||||
};
|
||||
|
||||
if !finite {
|
||||
return Err("function returned a non-finite value".into());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user