#Transfer and Graphics Queue Family Transfers

3 messages · Page 1 of 1 (latest)

cunning comet
#

Hey everyone, I am trying to figure out how to handle async/background thread resource uploading, and performing queue family transfer operations between transfer family and graphics family queues.

Assuming transfer queue family != graphics queue family, and that there is a timeline semaphore that is incremented every time a unique resource (or batch of resources) is uploaded

My idea is as follow for e.g. uploading a mesh (this is a single copy, but imagine they could be batched).

  • Allocate host visible buffer
  • Copy host memory to host visible buffer
  • Get transfer command buffer
  • buffermemorybarrier the copy
  • put copy in cmd buf
  • buffermemorybarrier the transfer
  • Queue submit, waiting on last timeline semaphore, and signaling next semaphore

My question is, what is the best way to submit the graphics queue transfer operations?

  1. Do I need to batch all of the destination queue family transfers into a single pipeline barrier on the graphics queue?
  2. Can I simply submit a single queue family transfer to the graphics queue, waiting on the timeline semaphore? Would any following graphics queue submit be blocked by those barriers since they are read in-order?

I'm still trying to wrap my head around everything, so maybe I have made some mistakes here

chrome trellis
#

The first and most important question is: why do you need a transfer queue? Normally, you only need it to transfer stuff ASYNChronously. If not, just use graphics

#

But to answer your questions:

  1. I think either works, but I would expect batching in 1 barrier to be quickest.