Skip to content

Should I always use a fence in rendering #484

Answered by SaschaWillems
guijiangheng asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, using multiple fences to wait for command buffer completion is the proper way. The samples that don't use fences work because they use other means of synchronization like vkDeviceWaitIdle or vkQueueWaitIdle, which you should not use in practice.

So to sum it up:

  • Uses fences (per command buffer)
  • Use multiple uniform buffers per command buffer in flight
  • Don't use heavy sync functions like vkDeviceWaitIdle or vkQueueWaitIdle

We may update the API samples to use better sync in the future, but that's not a small task. Those samples are mainly meant to showcase how to use a certain part of the API, so synchronization is secondary in those.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by guijiangheng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants