disambiguated whether NodeParam::parent() would return a Node* or a QObject*

Old code assumes that a NodeParam's parent will always be a Node. The function
has been separated off and tweaked in the event that this is not the case.
This commit is contained in:
itsmattkc
2019-11-30 23:58:56 +11:00
parent a478b11fd0
commit 092d76f41a
15 changed files with 72 additions and 43 deletions
+2 -2
View File
@@ -88,7 +88,7 @@ bool OpenGLBackend::TraverseCompiling(Node *n)
// Check if we have a shader or not
if (shader_cache_.GetShader(connected_output) == nullptr) {
// Since we don't have a shader, compile one now
QString node_code = connected_output->parent()->Code(connected_output);
QString node_code = connected_output->parentNode()->Code(connected_output);
// If the node has no code, it mustn't be GPU accelerated
if (!node_code.isEmpty()) {
@@ -126,7 +126,7 @@ bool OpenGLBackend::TraverseCompiling(Node *n)
}
}
if (!TraverseCompiling(connected_output->parent())) {
if (!TraverseCompiling(connected_output->parentNode())) {
return false;
}
}
@@ -10,7 +10,7 @@ OpenGLShaderCache::OpenGLShaderCache()
QString OpenGLShaderCache::GenerateShaderID(NodeOutput *output)
{
// Creates a unique identifier for this specific node and this specific output
return QString("%1:%2").arg(output->parent()->id(), output->id());
return QString("%1:%2").arg(output->parentNode()->id(), output->id());
}
void OpenGLShaderCache::Clear()
+1 -1
View File
@@ -86,7 +86,7 @@ void OpenGLWorker::ParametersChangedEvent()
QVariant OpenGLWorker::RunNodeAccelerated(NodeOutput *out)
{
OpenGLShaderPtr shader = shader_cache_->GetShader(out);
Node* node = out->parent();
Node* node = out->parentNode();
// Create the output texture
OpenGLTexturePtr output = std::make_shared<OpenGLTexture>();