Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added main functions, runtime libraries & pipe update #93

Merged
merged 20 commits into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated Pipe: Combined ecs into PipeECS.h
  • Loading branch information
muit committed Jun 22, 2023
commit 98790cd55943692a10293e9f3f823d6749901f00
11 changes: 5 additions & 6 deletions Libs/Backends/LLVM/Compiler/Src/LLVMBackend/IRGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <llvm/IR/Function.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/Verifier.h>
#include <Pipe/ECS/Utils/Hierarchy.h>


namespace rift::LLVM
Expand Down Expand Up @@ -52,14 +51,14 @@ namespace rift::LLVM

// Get all rift types from the module
TArray<AST::Id> typeIds;
ecs::GetChildren(ast, moduleId, typeIds);
GetChildren(ast, moduleId, typeIds);
ExcludeIdsWithout<AST::CDeclType>(ast, typeIds);

{ // Native declarations
TArray<AST::Id> cStructIds = FindIdsWith<CDeclCStruct>(ast, typeIds);
TArray<AST::Id> cStaticIds = FindIdsWith<CDeclCStatic>(ast, typeIds);
TArray<AST::Id> cFunctionIds;
p::ecs::GetChildren(ast, cStaticIds, cFunctionIds);
p::GetChildren(ast, cStaticIds, cFunctionIds);
ExcludeIdsWithout<AST::CDeclFunction>(ast, cFunctionIds);
DeclareStructs(gen, ast, cStructIds);
DeclareFunctions(gen, ast, cFunctionIds, false);
Expand All @@ -71,8 +70,8 @@ namespace rift::LLVM
TArray<AST::Id> classIds = FindIdsWith<AST::CDeclClass>(ast, typeIds);
TArray<AST::Id> staticFunctionIds;
TArray<AST::Id> classFunctionIds;
p::ecs::GetChildren(ast, staticIds, staticFunctionIds);
p::ecs::GetChildren(ast, classIds, classFunctionIds);
p::GetChildren(ast, staticIds, staticFunctionIds);
p::GetChildren(ast, classIds, classFunctionIds);
ExcludeIdsWithout<AST::CDeclFunction>(ast, staticFunctionIds);
ExcludeIdsWithout<AST::CDeclFunction>(ast, classFunctionIds);
TArray<AST::Id> functionIds;
Expand Down Expand Up @@ -168,7 +167,7 @@ namespace rift::LLVM
// Add members
memberIds.Clear(false);
memberTypes.Clear(false);
p::ecs::GetChildren(access, id, memberIds);
p::GetChildren(access, id, memberIds);
ExcludeIdsWithout<AST::CDeclVariable>(access, memberIds);
for (AST::Id memberId : memberIds)
{
Expand Down
3 changes: 0 additions & 3 deletions Libs/Editor/Include/Tools/ASTDebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
#include <AST/Components/CNamespace.h>
#include <Pipe/Core/Platform.h>
#include <Pipe/Core/StringView.h>
#include <Pipe/ECS/Components/CChild.h>
#include <Pipe/ECS/Components/CParent.h>
#include <Pipe/Math/Vector.h>
#include <Pipe/Memory/BigBestFitArena.h>
#include <Pipe/Memory/Block.h>
#include <Pipe/PipeECS.h>
#include <UI/UI.h>



namespace rift::Editor
{
struct ASTDebugger
Expand Down
1 change: 0 additions & 1 deletion Libs/Editor/Include/Utils/DetailsPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <AST/Tree.h>
#include <AST/Utils/TransactionUtils.h>
#include <Pipe/Core/StringView.h>
#include <Pipe/ECS/Components/CParent.h>
#include <Pipe/PipeECS.h>


Expand Down
1 change: 0 additions & 1 deletion Libs/Editor/Include/Utils/ElementsPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <AST/Tree.h>
#include <AST/Utils/TransactionUtils.h>
#include <Pipe/Core/StringView.h>
#include <Pipe/ECS/Components/CParent.h>
#include <Pipe/PipeECS.h>


Expand Down
3 changes: 1 addition & 2 deletions Libs/Editor/Src/Panels/FileExplorerPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <Pipe/Core/PlatformProcess.h>
#include <Pipe/Core/Profiler.h>
#include <Pipe/Core/StringView.h>
#include <Pipe/ECS/Utils/Hierarchy.h>
#include <Pipe/Files/FileDialog.h>
#include <Pipe/Files/Files.h>
#include <Pipe/Files/Paths.h>
Expand Down Expand Up @@ -402,7 +401,7 @@ namespace rift::Editor
const StringView parsedNewName = Strings::RemoveFromEnd(renameBuffer, ".rf");
const bool nameIsEmpty = parsedNewName.empty();
const Id sameNameFuncId =
AST::FindChildByName(ast, p::ecs::GetParent(ast, item.id), Tag{parsedNewName});
AST::FindChildByName(ast, p::GetParent(ast, item.id), Tag{parsedNewName});
if (nameIsEmpty || (!IsNone(sameNameFuncId) && item.id != sameNameFuncId))
{
UI::PushTextColor(LinearColor::Red());
Expand Down
3 changes: 1 addition & 2 deletions Libs/Editor/Src/Tools/ASTDebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <AST/Utils/Namespaces.h>
#include <AST/Utils/Paths.h>
#include <IconsFontAwesome5.h>
#include <Pipe/ECS/Utils/Hierarchy.h>
#include <Pipe/Reflect/TypeRegistry.h>
#include <UI/Inspection.h>
#include <UI/UI.h>
Expand Down Expand Up @@ -157,7 +156,7 @@ namespace rift::Editor
if (showHierarchy && !filter.IsActive())
{
TArray<AST::Id> roots;
p::ecs::GetRoots(access, roots);
p::GetRoots(access, roots);
for (auto root : roots)
{
DrawNode(access, root, true);
Expand Down
2 changes: 0 additions & 2 deletions Libs/Editor/Src/Utils/DetailsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
#include <GLFW/glfw3.h>
#include <IconsFontAwesome5.h>
#include <Pipe/Core/EnumFlags.h>
#include <Pipe/ECS/Utils/Hierarchy.h>
#include <Pipe/PipeECS.h>
#include <UI/UI.h>



namespace rift::Editor
{
void EditFunctionPin(AST::Tree& ast, AST::Id ownerId, AST::Id id)
Expand Down
7 changes: 3 additions & 4 deletions Libs/Editor/Src/Utils/ElementsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <GLFW/glfw3.h>
#include <IconsFontAwesome5.h>
#include <Pipe/Core/EnumFlags.h>
#include <Pipe/ECS/Utils/Hierarchy.h>
#include <Pipe/PipeECS.h>
#include <UI/UI.h>

Expand Down Expand Up @@ -179,7 +178,7 @@ namespace rift::Editor
{
UI::Indent(10.f);
TArray<AST::Id> variableIds;
p::ecs::GetChildren(access, typeId, variableIds);
p::GetChildren(access, typeId, variableIds);
ExcludeIdsWithout<AST::CDeclVariable>(access, variableIds);

UI::PushStyleVar(ImGuiStyleVar_CellPadding, {1.f, 3.f});
Expand Down Expand Up @@ -224,7 +223,7 @@ namespace rift::Editor
UI::Indent(10.f);

TArray<AST::Id> functionIds;
p::ecs::GetChildren(ast, typeId, functionIds);
p::GetChildren(ast, typeId, functionIds);
ExcludeIdsWithout<AST::CDeclFunction>(ast, functionIds);
for (AST::Id functionId : functionIds)
{
Expand Down Expand Up @@ -281,7 +280,7 @@ namespace rift::Editor
// If pin has not been marked for removal, destroy the entity
if (!removedPin)
{
p::ecs::Remove(ast, editor.pendingDeletePropertyId, true);
p::Remove(ast, editor.pendingDeletePropertyId, true);
editor.pendingDeletePropertyId = AST::NoId;
}
}
Expand Down
5 changes: 2 additions & 3 deletions Libs/Editor/Src/Utils/FunctionGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <AST/Utils/Statements.h>
#include <AST/Utils/TransactionUtils.h>
#include <GLFW/glfw3.h>
#include <Pipe/ECS/Utils/Hierarchy.h>
#include <Pipe/PipeECS.h>
#include <UI/Style.h>
#include <Utils/Nodes.h>
Expand Down Expand Up @@ -700,7 +699,7 @@ namespace rift::Editor::Graph
BeginNode(access, id);
{
pinIds.Clear(false);
p::ecs::GetChildren(access, id, pinIds);
p::GetChildren(access, id, pinIds);
if (!Ensure(pinIds.Size() >= 2))
{
continue;
Expand Down Expand Up @@ -853,7 +852,7 @@ namespace rift::Editor::Graph
}

TArray<AST::Id> children;
p::ecs::GetChildren(ast, typeId, children);
p::GetChildren(ast, typeId, children);

// Nodes
DrawFunctionDecls(ast, FindIdsWith<AST::CDeclFunction>(ast, children));
Expand Down
5 changes: 2 additions & 3 deletions Libs/Editor/Src/Utils/FunctionGraphContextMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <AST/Utils/TransactionUtils.h>
#include <GLFW/glfw3.h>
#include <IconsFontAwesome5.h>
#include <Pipe/ECS/Utils/Hierarchy.h>
#include <UI/UI.h>


Expand Down Expand Up @@ -196,7 +195,7 @@ namespace rift::Editor::Graph
{
Tag name = access.Get<const AST::CNamespace>(functionId).name;
label.clear();
AST::Id funcTypeId = ecs::GetParent(access, functionId);
AST::Id funcTypeId = GetParent(access, functionId);
if (!IsNone(funcTypeId) && access.Has<AST::CDeclType, AST::CNamespace>(funcTypeId))
{
Strings::FormatTo(label, "{} ({})", name,
Expand All @@ -223,7 +222,7 @@ namespace rift::Editor::Graph
{
Tag name = access.Get<const AST::CNamespace>(variableId).name;
label.clear();
AST::Id typeId = p::ecs::GetParent(access, variableId);
AST::Id typeId = p::GetParent(access, variableId);
if (!IsNone(typeId) && access.Has<AST::CDeclType, AST::CNamespace>(typeId))
{
Strings::FormatTo(
Expand Down
6 changes: 2 additions & 4 deletions Libs/Framework/Include/AST/Id.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#include <Pipe/Core/Platform.h>
#include <Pipe/Core/TypeList.h>
#include <Pipe/ECS/Components/CChild.h>
#include <Pipe/ECS/Components/CParent.h>
#include <Pipe/PipeECS.h>
#include <Pipe/Reflect/Builders/NativeTypeBuilder.h>
#include <Pipe/Serialize/SerializationFwd.h>
Expand All @@ -16,6 +14,6 @@ namespace rift::AST
using Id = p::Id;
constexpr Id NoId = p::NoId;

using CParent = p::ecs::CParent;
using CChild = p::ecs::CChild;
using CParent = p::CParent;
using CChild = p::CChild;
} // namespace rift::AST
2 changes: 0 additions & 2 deletions Libs/Framework/Include/AST/Utils/Namespaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include "AST/Id.h"

#include <Pipe/Core/GenericEnums.h>
#include <Pipe/ECS/Components/CChild.h>
#include <Pipe/ECS/Utils/Hierarchy.h>
#include <Pipe/Math/Math.h>
#include <Pipe/PipeECS.h>
#include <Pipe/Reflect/EnumType.h>
Expand Down
1 change: 0 additions & 1 deletion Libs/Framework/Include/AST/Utils/TransactionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "AST/Components/Tags/CChanged.h"
#include "AST/Components/Tags/CDirty.h"

#include <Pipe/ECS/Components/CChild.h>
#include <Pipe/PipeECS.h>


Expand Down
2 changes: 0 additions & 2 deletions Libs/Framework/Include/AST/Utils/TypeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include "AST/Tree.h"
#include "AST/TypeRef.h"

#include <Pipe/ECS/Components/CChild.h>
#include <Pipe/ECS/Components/CParent.h>
#include <Pipe/PipeECS.h>


Expand Down
11 changes: 5 additions & 6 deletions Libs/Framework/Src/AST/Systems/FunctionsSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "AST/Utils/Namespaces.h"
#include "AST/Utils/TypeUtils.h"

#include <Pipe/ECS/Utils/Hierarchy.h>
#include <Pipe/PipeECS.h>


Expand Down Expand Up @@ -170,7 +169,7 @@ namespace rift::AST::FunctionsSystem
{
Id id = ast.Create();
access.Add<CNamespace>(id, *name);
p::ecs::Attach(ast, call.id, id);
p::Attach(ast, call.id, id);
callOutputs.Add(id);
}
else
Expand All @@ -189,7 +188,7 @@ namespace rift::AST::FunctionsSystem
{
Id id = ast.Create();
access.Add<CNamespace>(id, *name);
p::ecs::Attach(ast, call.id, id);
p::Attach(ast, call.id, id);
callOutputs.Insert(i, id);
}
else if (callPinIdx > i)
Expand Down Expand Up @@ -241,7 +240,7 @@ namespace rift::AST::FunctionsSystem
{
Id id = ast.Create();
access.Add<CNamespace>(id, *name);
p::ecs::Attach(ast, call.id, id);
p::Attach(ast, call.id, id);
callInputs.Add(id);
}
else
Expand All @@ -260,7 +259,7 @@ namespace rift::AST::FunctionsSystem
{
Id id = ast.Create();
access.Add<CNamespace>(id, *name);
p::ecs::Attach(ast, call.id, id);
p::Attach(ast, call.id, id);
callInputs.Insert(i, id);
}
else if (callPinIdx > i)
Expand Down Expand Up @@ -330,7 +329,7 @@ namespace rift::AST::FunctionsSystem

TArray<Id> pinsToRemove = FindAllIdsWith<CInvalid>(access);
ExcludeIdsWith<CTmpInvalidKeep>(access, pinsToRemove);
p::ecs::Remove(access, pinsToRemove);
p::Remove(access, pinsToRemove);

access.GetPool<CTmpInvalidKeep>()->Clear();
}
Expand Down
5 changes: 2 additions & 3 deletions Libs/Framework/Src/AST/Systems/LoadSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "Pipe/Files/Paths.h"

#include <Pipe/Core/Profiler.h>
#include <Pipe/ECS/Utils/Hierarchy.h>
#include <Pipe/Files/Files.h>
#include <Pipe/Serialize/Formats/JsonFormat.h>

Expand Down Expand Up @@ -155,7 +154,7 @@ namespace rift::AST::LoadSystem

// Link modules to the project
const Id projectId = GetProjectId(access);
p::ecs::Attach(access, projectId, ids);
p::Attach(access, projectId, ids);
}

void CreateTypesFromPaths(Tree& ast, TSpan<ModuleTypePaths> pathsByModule, TArray<Id>& ids)
Expand Down Expand Up @@ -192,7 +191,7 @@ namespace rift::AST::LoadSystem
ast.Add(id, CFileRef{Move(path)});
}

p::ecs::Attach(ast, modulePaths.moduleId, typeIds);
p::Attach(ast, modulePaths.moduleId, typeIds);
ids.Append(typeIds);
}
}
Expand Down
3 changes: 1 addition & 2 deletions Libs/Framework/Src/AST/Systems/TypeSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "AST/Utils/Namespaces.h"
#include "AST/Utils/TypeUtils.h"

#include <Pipe/ECS/Utils/Hierarchy.h>
#include <Pipe/PipeECS.h>


Expand Down Expand Up @@ -91,7 +90,7 @@ namespace rift::AST::TypeSystem
TArray<Id> dirtyTypeIds = FindAllIdsWith<CDeclType, CChanged>(access);

TArray<Id> dirtyNodeIds;
p::ecs::GetChildren(access, dirtyTypeIds, dirtyNodeIds);
p::GetChildren(access, dirtyTypeIds, dirtyNodeIds);

// Make sure the nodes have inputs and outputs
ExcludeIdsWithout<CExprInputs, CExprOutputs>(access, dirtyNodeIds);
Expand Down
6 changes: 2 additions & 4 deletions Libs/Framework/Src/AST/Utils/Expressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "AST/Id.h"

#include <Pipe/ECS/Utils/Hierarchy.h>


namespace rift::AST
{
Expand Down Expand Up @@ -173,7 +171,7 @@ namespace rift::AST
input.nodeId = pinId;
if (!IsNone(input.nodeId) && !access.Has<CExprInputs>(input.nodeId))
{
input.nodeId = p::ecs::GetParent(access, pinId);
input.nodeId = p::GetParent(access, pinId);
}
return input;
}
Expand All @@ -186,7 +184,7 @@ namespace rift::AST
output.nodeId = pinId;
if (!IsNone(output.nodeId) && !access.Has<CExprOutputs>(output.nodeId))
{
output.nodeId = p::ecs::GetParent(access, pinId);
output.nodeId = p::GetParent(access, pinId);
}
return output;
}
Expand Down
Loading