The expression system: GLSL expressions declared, compiled and evaluated. More...
| Header: | #include <eval> |
| namespace | internal |
| eval::Result<QVariant> | evaluate(const QString &expression, eval::Backend hint = Backend::Interpreted) |
| eval::Result<QVariant> | evaluate(const QString &expression, const QHash<QString, QVariant> &inputs, eval::Backend hint = Backend::Interpreted) |
libeval turns GLSL expressions into runnable programs. A caller declares input slots and output expressions on an eval::Graph and compiles it to an immutable eval::Program. eval::evaluate() does all of this in one call for a single expression.
The edit-time form of an expression program: input slots and output expressions. More...
An immutable compiled expression program, produced by an eval::Graph. More...
Parses, type-checks, compiles and evaluates expression, and returns its value or the diagnostics that stopped it.
hint selects the backend. The default, Backend::Interpreted, keeps a casual caller off the JIT's compile latency. Every call parses and compiles again, so a hot loop must hold an eval::Program instead.
Each entry in inputs becomes an input slot named by its key, set to its value, before expression is evaluated. The slot type follows the QVariant type: float, double, bool, uint, qint64 and quint64 keep their type, and any other type, int included, becomes a float slot.
This is an overloaded function.