update chroma key GetShaderCode sig

This commit is contained in:
itsmattkc
2022-05-07 13:55:05 -07:00
parent fdc2d76406
commit b4bf57ad50
4 changed files with 12 additions and 6 deletions
+3 -2
View File
@@ -94,9 +94,9 @@ void ChromaKeyNode::InputValueChangedEvent(const QString &input, int element)
GenerateProcessor();
}
ShaderCode ChromaKeyNode::GetShaderCode(const QString &) const
ShaderCode ChromaKeyNode::GetShaderCode(const ShaderRequest &request) const
{
return ShaderCode(FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/chromakey.frag")));
return ShaderCode(FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/chromakey.frag")).arg(request.stub));
}
void ChromaKeyNode::GenerateProcessor()
@@ -122,6 +122,7 @@ void ChromaKeyNode::Value(const NodeValueRow &value, const NodeGlobals &globals,
job.SetInputTexture(value[kTextureInput].data().value<TexturePtr>());
job.SetNeedsCustomShader(this);
job.SetFunctionName(QStringLiteral("SceneLinearToCIEXYZ_d65"));
job.SetOverrideID(id());
table->Push(NodeValue::kTexture, QVariant::fromValue(job), this);
}
+1 -1
View File
@@ -37,7 +37,7 @@ class ChromaKeyNode : public OCIOBaseNode {
virtual void InputValueChangedEvent(const QString& input, int element) override;
virtual ShaderCode GetShaderCode(const QString &shader_id) const override;
virtual ShaderCode GetShaderCode(const ShaderRequest &request) const override;
virtual void Value(const NodeValueRow& value, const NodeGlobals& globals, NodeValueTable* table) const override;
virtual void ConfigChanged() override;
+6
View File
@@ -672,6 +672,12 @@ public:
id = shader_id;
}
ShaderRequest(const QString &shader_id, const QString &shader_stub)
{
id = shader_id;
stub = shader_stub;
}
QString id;
QString stub;
};