Skip to content
New issue

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

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

Already on GitHub? # to your account

Support for UPDATE_AFTER_BIND descriptors. #1706

Closed
AustinJ235 opened this issue Sep 12, 2021 · 2 comments · Fixed by #2358
Closed

Support for UPDATE_AFTER_BIND descriptors. #1706

AustinJ235 opened this issue Sep 12, 2021 · 2 comments · Fixed by #2358

Comments

@AustinJ235
Copy link
Member

I think this would be a cool feature to have. If I understand it correctly it would allow much better reuse of a command buffer where everything is the same except for the descriptor sets in use. Only safety caveat would be that two threads can't update a set at the same time. This has been promoted to core in vulkan 1.2 and is supported by the majority of devices.

Changes required that I can think of:

  • UnsafeDescriptorPool would need an additional field or a flags struct similar to ImageCreateFlags.
  • DescriptorSetLayout would also need to set this flag. Currently creating this doesn't take any flags.
  • Would need to ensure that both the pool and the layout agree on the flags.
  • Somehow would need to have mutable access to UnsafeDescriptorSet if we were to use this feature in the PersistentDescriptorSet and SingleLayoutDescSet.
    • Perhaps this would be stored in a mutex?
@Rua
Copy link
Contributor

Rua commented Sep 12, 2021

There would need to be some locking mechanism to ensure that descriptor sets aren't updated while the GPU is using them. This requires changes to SyncCommandBuffer. Buffers and images currently have locking, but there's no provision for locking of other types of resources. This is the reason why queries aren't fully safe to use yet, so they should also be considered in any refactoring.

@Rua
Copy link
Contributor

Rua commented Nov 2, 2021

Something else I realised while investigating #1743: Because the descriptors can change after the descriptor set was bound in a command buffer, the only way to validate them would be at submission time. This will require quite a bit more refactoring.

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

Successfully merging a pull request may close this issue.

2 participants