Skip to content

Commit

Permalink
Traktor: Fixed asserts in FragmentLinker causing validation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed Jun 5, 2024
1 parent 39e5805 commit d5161f8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions code/Render/Editor/Shader/FragmentLinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class PortConnector : public Node
public:
explicit PortConnector(const Guid& fromFragmentId)
: m_fromFragmentId(fromFragmentId)
, m_inputPin(this, Guid::null, L"Input", false)
, m_outputPin(this, Guid::null, L"Output")
, m_inputPin(this, Guid(L"{7efbd768-2381-11ef-a168-7fa583325338}"), L"Input", false)
, m_outputPin(this, Guid(L"{8a3561bc-2381-11ef-9b5c-3f9b39355b23}"), L"Output")
{
}

Expand Down Expand Up @@ -288,6 +288,11 @@ Ref< ShaderGraph > FragmentLinker::resolve(const ShaderGraph* shaderGraph, const
for (auto destinationPin : destinationPins)
{
T_FATAL_ASSERT(destinationPin->getNode() != sourcePin->getNode());

Edge* existingEdge = mutableShaderGraph->findEdge(destinationPin);
if (existingEdge)
mutableShaderGraph->removeEdge(existingEdge);

mutableShaderGraph->addEdge(new Edge(
sourcePin,
destinationPin
Expand Down

0 comments on commit d5161f8

Please sign in to comment.