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

Add parallel rendering and game update support #195

Open
ensisoft opened this issue Mar 1, 2024 · 0 comments
Open

Add parallel rendering and game update support #195

ensisoft opened this issue Mar 1, 2024 · 0 comments

Comments

@ensisoft
Copy link
Owner

ensisoft commented Mar 1, 2024

If the renderer runs frame late it should be possible to run game update and renderer render in parallel in different threads.

For Frame N

  • The update for frame N+1is kicked off
  • Renderer produces frame based on frame N-1 data.
  • Get the result of the update thread and apply state changes on the renderer to prepare it for the next frame

For frame N+1
The update for frame N+2 is kicked off
Renderer produces frame based on frame N-+1 data.

  • etc
ensisoft added a commit that referenced this issue Mar 7, 2024
Restructure the engine update and rendering loops with the intention
to move things more forward a model where the "update" step can be
executed as a task in a separate thread and the time step used by
the update is then fed to the renderer in order to update the renderer
material animations etc.

The current blocker is that the renderer is still creating gfx
resources during the draw operation and accessess the entity/entity
node objects for this purpose. This would require locking and would
not produce the best parallelism. A refactoring should be done to
restructure the renderer so that no access to scene/entity/entity nodes
is needed during render.

Issue #195
ensisoft added a commit that referenced this issue Mar 7, 2024
Restructure the engine update and rendering loops with the intention
to move things more forward a model where the "update" step can be
executed as a task in a separate thread and the time step used by
the update is then fed to the renderer in order to update the renderer
material animations etc.

The current blocker is that the renderer is still creating gfx
resources during the draw operation and accessess the entity/entity
node objects for this purpose. This would require locking and would
not produce the best parallelism. A refactoring should be done to
restructure the renderer so that no access to scene/entity/entity nodes
is needed during render.

Issue #195
ensisoft added a commit that referenced this issue Mar 7, 2024
Restructure the engine update and rendering loops with the intention
to move things more forward a model where the "update" step can be
executed as a task in a separate thread and the time step used by
the update is then fed to the renderer in order to update the renderer
material animations etc.

The current blocker is that the renderer is still creating gfx
resources during the draw operation and accessess the entity/entity
node objects for this purpose. This would require locking and would
not produce the best parallelism. A refactoring should be done to
restructure the renderer so that no access to scene/entity/entity nodes
is needed during render.

Issue #195
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant