#[non_exhaustive]pub enum OwnedData {
F32(Vec<f32>),
F64(Vec<f64>),
I32(Vec<i32>),
I64(Vec<i64>),
String(Vec<Vec<u8>>),
Reference(Vec<HostPointer>),
}Expand description
An ɴsɪ argument’s payload, owned.
Variants are storage representations, not ɴsɪ types: colour, point,
vector, normal and 4x4 f32 matrices all live in OwnedData::F32
and are told apart by OwnedArgument::type_tag.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
F32(Vec<f32>)
f32 scalars, flattened. Also holds colour, point, vector,
normal and 4x4 f32 matrices; OwnedArgument::type_tag tells them
apart.
F64(Vec<f64>)
f64 scalars, flattened. Also holds 4x4 f64 matrices.
I32(Vec<i32>)
32-bit integers.
I64(Vec<i64>)
64-bit integers.
String(Vec<Vec<u8>>)
Strings, copied out of their C representation.
Bytes, not String. An ɴsɪ string is whatever the C API was
handed. 3Delight writes a byte at or above 0x7f raw and reads
it back unchanged, and a file name on Linux is not required to be
UTF-8 – so an imagefilename naming café.exr in Latin-1 is a
value this crate must carry, not one it may repair. Storing
String here replaced the byte with U+FFFD at recording time,
which no amount of care at replay could undo.
Use String::from_utf8_lossy where text is wanted.
§A path value may need expanding
ɴsɪ streams carry ${VAR} references so a scene can move between
machines, and 3Delight expands them when it uses the value,
not when it reads the stream. A backend that opens a path from
here without expanding opens the wrong file – and only on the
machines where the variable mattered, which is when it is hardest
to diagnose.
The rules, measured rather than inferred, because each one changes what a backend must implement:
${NAME}only. A bare$NAMEis left alone: a probe naming$VAR/x.exrcreated a literal$VARdirectory.- Path-valued attributes only.
imagefilename,shaderfilenameandEvaluate’sfilenameexpand, and nest (${A}/${B}).drivernamedoes not – it fails withE6024 cannot find display driver '${...}'– nor does a node handle (E6087 unknown node handle), nor an attribute name, which is silently ignored. - Any variable, not just
NSI_PATH_.${HOME}expands. That prefix governs which variables 3Delight writes as references understreampathreplacement; on read it means nothing. - An unset variable stays literal, rather than expanding to
empty or erroring: a probe created a literal
${MISSING}directory.
One trap worth naming: ${...} in an output layer’s
variablename segfaults 3Delight 2.9.207. Do not pass one
through to a renderer expecting a diagnostic.
See specs/004 research Q1.
Reference(Vec<HostPointer>)
Raw host pointers. ɴsɪ calls this Reference (Pointer in the C
API); it is not an object link and is never forwarded to a
renderer as one. Stored so output-driver callbacks survive a
replay. The recorder never dereferences these.