Remove last of Great ScriptCanvas purge code, fix purity categorization handler connection control

Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
chcurran
2021-07-08 08:53:19 -07:00
parent 21b511b174
commit 3f231075fe
7 changed files with 23 additions and 77 deletions
@@ -146,7 +146,7 @@ namespace AZ {
AZStd::mutex g_dbgLoadingMutex;
HANDLE g_currentProcess = 0; /// We deal with only one process for now.
CRITICAL_SECTION g_csDbgHelpDll; /// All dbg help functions are single threaded, so we need to control the access.
AZStd::fixed_vector<SymbolStorage::ModuleInfo, 256> g_moduleInfo;
AZStd::fixed_vector<SymbolStorage::ModuleInfo, 2048> g_moduleInfo;
// reserve 4k of scratch space so that we can get some callstack information without any allocations and as little stack frame usage as possible.
const size_t g_scratchSpaceSize = 2048;
@@ -2949,45 +2949,6 @@ namespace ScriptCanvas
}
}
void Node::SetInput(const Datum& newInput, const SlotId& slotId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas);
ModifiableDatumView datumView;
FindModifiableDatumView(slotId, datumView);
if (datumView.IsValid())
{
datumView.AssignToDatum(newInput);
}
}
void Node::SetInput(Datum&& newInput, const SlotId& slotId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas);
ModifiableDatumView datumView;
FindModifiableDatumView(slotId, datumView);
if (datumView.IsValid())
{
datumView.AssignToDatum(newInput);
}
}
void Node::SetInput(Node& node, const SlotId& id, const Datum& input)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas);
node.SetInput(input, id);
}
void Node::SetInput(Node& node, const SlotId& id, Datum&& input)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::SetInput");
node.SetInput(AZStd::move(input), id);
}
AZStd::string Node::GetDebugName() const
{
if (GetEntityId().IsValid())
@@ -841,9 +841,6 @@ namespace ScriptCanvas
void SignalSlotsReordered();
static void SetInput(Node& node, const SlotId& id, const Datum& input);
static void SetInput(Node& node, const SlotId& id, Datum&& input);
// Will ignore any references and return the Datum that the slot represents.
void ModifyUnderlyingSlotDatum(const SlotId& id, ModifiableDatumView& datumView);
@@ -995,9 +992,6 @@ protected:
void SetOwningScriptCanvasId(ScriptCanvasId scriptCanvasId);
void SetGraphEntityId(AZ::EntityId graphEntityId);
virtual void SetInput(const Datum& input, const SlotId& id);
virtual void SetInput(Datum&& input, const SlotId& id);
bool SlotExists(AZStd::string_view name, const SlotDescriptor& slotDescriptor) const;
bool IsTargetInDataFlowPath(const ID& targetNodeId, AZStd::unordered_set<ID>& path) const;
@@ -2422,17 +2422,17 @@ namespace ScriptCanvas
ExecutionTreePtr start = OpenScope(nullptr, startNode, nullptr);
start->SetSymbol(Symbol::FunctionDefinition);
m_start = start; // cache the function definition
if (!m_subgraphStartCalls.empty())
{
m_start = start;
// call OnGraphStart on all the member nodeables first
for (auto node : m_subgraphStartCalls)
{
ExecutionTreePtr childStartCall = CreateChild(start, node, nullptr);
childStartCall->SetSymbol(Symbol::FunctionCall);
childStartCall->SetName(k_OnGraphStartFunctionName);
childStartCall->MarkStart();
childStartCall->MarkStartCall();
auto lexicalScopeOutcome = node->GetFunctionCallLexicalScope(nullptr);
@@ -2478,11 +2478,13 @@ namespace ScriptCanvas
}
}
// ExecutionTreePtr start is now either the last child start() call, or the beginning of the function block,
// either way, parsing can continue from the ExecutionTreePtr start.
if (!outSlots.empty())
{
start->AddChild({ outSlots[0], {}, nullptr });
start->MarkStart();
ParseExecutionMultipleOutSyntaxSugar(start, outNodes, outSlots);
PostParseProcess(start);
PostParseErrorDetect(start);
@@ -2490,24 +2492,10 @@ namespace ScriptCanvas
if (!IsErrorFree())
{
start->Clear();
if (m_start)
{
m_start->Clear();
}
m_start->Clear();
AddError(AZ::EntityId{}, nullptr, ScriptCanvas::ParseErrors::StartNodeFailedToParse);
return;
}
if (!m_start)
{
m_start = start;
}
}
else
{
// add warning or notification on useless start node?
}
if (m_start)
@@ -4428,6 +4416,7 @@ namespace ScriptCanvas
if (auto eventHandling = GetEBusEventHandling(node))
{
auto variable = AZStd::make_shared<Variable>();
variable->m_isMember = true;
variable->m_datum = Datum(eventHandling->m_handlerName);
execution->MarkInputHasThisPointer();
execution->AddInput({ nullptr, variable, DebugDataSource::FromInternal() });
@@ -354,9 +354,9 @@ namespace ScriptCanvas
return GetRoot()->m_isPure;
}
bool ExecutionTree::IsStart() const
bool ExecutionTree::IsStartCall() const
{
return m_isStart;
return m_isStartCall;
}
void ExecutionTree::MarkDebugEmptyStatement()
@@ -403,9 +403,9 @@ namespace ScriptCanvas
root->m_isLatent = true;
}
void ExecutionTree::MarkStart()
void ExecutionTree::MarkStartCall()
{
m_isStart = true;
m_isStartCall = true;
}
ExecutionChild& ExecutionTree::ModChild(size_t index)
@@ -199,7 +199,7 @@ namespace ScriptCanvas
bool IsPure() const;
bool IsStart() const;
bool IsStartCall() const;
void MarkDebugEmptyStatement();
@@ -215,7 +215,7 @@ namespace ScriptCanvas
void MarkRootLatent();
void MarkStart();
void MarkStartCall();
ExecutionChild& ModChild(size_t index);
@@ -286,7 +286,7 @@ namespace ScriptCanvas
bool m_isPure = false;
bool m_isStart = false;
bool m_isStartCall = false;
bool m_hasExplicitUserOutCalls = false;
@@ -806,7 +806,7 @@ namespace ScriptCanvas
m_dotLua.Write("(");
if (execution->IsStart() && execution->IsPure())
if (execution == m_model.GetStart() && execution->IsPure())
{
m_dotLua.Write(Grammar::k_executionStateVariableName);
@@ -1589,8 +1589,10 @@ namespace ScriptCanvas
break;
}
// #functions2 pure on graph start nodes with dependencies can only be added to the graph as variables
// if (execution->IsStart() && execution->IsPure())
// #functions2 pure on graph start nodes with dependencies can only be added to the graph as variables, which is a work-flow we may never want to support
// as it effectively duplicates the Component-Entity-System. Technically, if this functionality is desired, one could just add another script component
// with the additional graph...
// if (execution->IsStartCall() && execution->IsPure())
// {
// WriteFunctionCallInputOfChildStart(execution);
// }
@@ -1944,7 +1946,7 @@ namespace ScriptCanvas
{
const auto requirement = ParseConstructionRequirement(variable);
if (requirement == Grammar::VariableConstructionRequirement::None || (requirement != Grammar::VariableConstructionRequirement::Static && !execution->IsStart()))
if (requirement == Grammar::VariableConstructionRequirement::None || (requirement != Grammar::VariableConstructionRequirement::Static && !execution->IsStartCall()))
{
m_dotLua.WriteLineIndented("local %s = %s", variable->m_name.data(), ToValueString(variable->m_datum, m_configuration).data());
}