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

Synchronize update of Buffer/Image possibly in use by GPU #23

Open
brayner1 opened this issue Nov 18, 2023 · 0 comments
Open

Synchronize update of Buffer/Image possibly in use by GPU #23

brayner1 opened this issue Nov 18, 2023 · 0 comments
Labels
bug Something isn't working renderer Renderer related issues

Comments

@brayner1
Copy link
Owner

Now, when updating a Buffer/Image, a transfer command is recorded in the current frame's transfer command buffer, and a memory barrier (or queue ownership transfer) is recorded. This consider synchronization of the memory usage for this specific frame.
But this approach does not consider that the Buffer/Image might be in use in a previously recorded frame that is still being rendered by the GPU.

Think of an approach to fix this, making sure that when the Buffer/Image is updated, it is not being used by the GPU.
Options:

  1. Double (or Triple) buffering. Creating multiple copies of the same resource, such that each frame uses its own version of the Buffer/Image.
  2. Store latest frame used by the Buffer/Image. Only execute current frame if latest frame already have finished (using Semaphore or Fence, need to think).
  3. Create a new Buffer/Image with new data that replaces the current Buffer/Image. Put the current Buffer/Image in deletion list.
@brayner1 brayner1 added bug Something isn't working renderer Renderer related issues labels Nov 18, 2023
@brayner1 brayner1 added this to the Basic Rendering Engine milestone Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working renderer Renderer related issues
Projects
None yet
Development

No branches or pull requests

1 participant