Frame phases primal.frame and queued entity changes #17
No assignees
Labels
No labels
area/build
area/content
area/editor
area/engine
area/graphics
area/platform
area/repo-wide
area/tests
area/tools
bug
optional
roadmap
size/L
size/M
size/S
No project
No milestone
Blocks
Depends on
#19 Archetype ECS
UnflavoredMeson/Primal_Plus_Plus
#16 Job system module primal.jobs
UnflavoredMeson/Primal_Plus_Plus
Reference
No Branch/Tag specified
Notifications
1 participant
Due date
No due date set.
Reference
UnflavoredMeson/Primal_Plus_Plus#17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Once work runs on several threads, entities can't be created or removed at any moment. A frame with fixed phases and a sync point says when structural changes happen and when data may be read in parallel.
Decided
frame::run(dt, render)(moduleprimal.frame,Engine/Core/Frame.ixx): sync point, game code, transforms, render.game_entity::queue_create()/queue_remove(), applied at the next sync point; the immediate calls assert that they run between frames.begin_play()at the sync point after creation;end_play()before removal (only afterbegin_play()).transform::update_matrices(), render preparation reads transforms from several threads, so nothing there may write a component.Read first
Steps
UnitTests/FrameTests.cpp: a queued entity exists from the next frame;begin_play()runs once;end_play()runs only afterbegin_play().frame::run().parallel_forand measure 100,000 entities with and without jobs.Done when
Claude can help with
Learn