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

Feature Request: One time, excecute on next frame #160

Open
QuantumEntangledAndy opened this issue Apr 20, 2022 · 1 comment
Open

Feature Request: One time, excecute on next frame #160

QuantumEntangledAndy opened this issue Apr 20, 2022 · 1 comment
Labels
feature request New feature request research Problem and solution research

Comments

@QuantumEntangledAndy
Copy link
Contributor

There are times, such as when computing one off jobs on the gpu, you need to run something on the next frame once.

For example: In the PR #159 there is a method to copy textures from the GPU to the cpu. For this to work we need to enqueue a command to the gpu and wait for the next frame cycle so that it is completed.

As another example, we could compute bounding boxes on the gpu and then copy them back to the cpu next frame for collision or raycasting analysis.

This is a tracking issue to discuss how should we implement it.

@QuantumEntangledAndy QuantumEntangledAndy added research Problem and solution research feature request New feature request labels Apr 20, 2022
@QuantumEntangledAndy
Copy link
Contributor Author

Possible ways to achieve this:

  1. Async method that allows us to await a frame change, have some std::future::Future object that completes once a frame has incremented
  2. Make cycle could an Arc<AtomicU32> and expose methods to share it. This could be abusable if them modify it.
  3. Make systems cancel-able in some way. For example if a system returns STOP then we remove it. This way the user can enqueue a system do what every they need like check cycle count and act on it and remove when done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request research Problem and solution research
Projects
None yet
Development

No branches or pull requests

1 participant