nodes: minor overhaul to functionality

The nodes now have more control over how their accelerated shaders/sample
functions are run, as well as how items are popped off the value tables.
This allows for various optimizations that we didn't have access to before.
This commit is contained in:
itsmattkc
2020-06-12 00:54:15 +10:00
parent 663cf4a020
commit dd7af0e6bd
44 changed files with 1051 additions and 697 deletions
+11 -4
View File
@@ -63,14 +63,21 @@ void SolidGenerator::Retranslate()
color_input_->set_name(tr("Color"));
}
Node::Capabilities SolidGenerator::GetCapabilities(const NodeValueDatabase &) const
NodeValueTable SolidGenerator::Value(NodeValueDatabase &value) const
{
return kShader;
ShaderJob job;
job.InsertValue(color_input_, value);
NodeValueTable table = value.Merge();
table.Push(NodeParam::kShaderJob, QVariant::fromValue(job), this);
return table;
}
QString SolidGenerator::ShaderFragmentCode(const NodeValueDatabase &) const
ShaderCode SolidGenerator::GetShaderCode(const QByteArray &shader_id) const
{
return ReadFileAsString(":/shaders/solid.frag");
Q_UNUSED(shader_id)
return ShaderCode(ReadFileAsString(":/shaders/solid.frag"), QString());
}
OLIVE_NAMESPACE_EXIT