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:
@@ -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
|
||||
|
||||
@@ -39,8 +39,8 @@ public:
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual Capabilities GetCapabilities(const NodeValueDatabase&) const override;
|
||||
virtual QString ShaderFragmentCode(const NodeValueDatabase&) const override;
|
||||
virtual NodeValueTable Value(NodeValueDatabase &value) const override;
|
||||
virtual ShaderCode GetShaderCode(const QByteArray &shader_id) const override;
|
||||
|
||||
private:
|
||||
NodeInput* color_input_;
|
||||
|
||||
Reference in New Issue
Block a user