Closed zakorgy closed 4 years ago
Thank you, this is amazing work! It's unfortunate that both the device and the PMBuffer need to be shared between threads now. I hope it's only temporary, as at the end of the day we should be handling everything on the render backend side.
The current solution:
B::Device
andHeaps<B>
are shared across the Renderer and RenderBackend threads.PMBuffer
in theRenderBackend
, and we write the updates in place instead of sendening them to theRenderer
.PMBuffer
'sB::Device
buffer handle is shared with theRenderer
soDevice
can use it in the descriptor sets.PMBuffer
(upon clear or resize), the oldPMBuffer
is sent to theRenderer
and we store it until the frame(s) which still use it are in flight.PMBuffer
recreation aBufferMemorySlice
struct is also sent to the Renderer which is used for handlingDeferredResolve
s. This is a workaround until the mainDevic
e logic is in the Renderer thread.~The last missing thing is transitioning the
PMBuffer
s to their proper state. For this we either record the transition in theRenderBackend
and send it to theRenderer
thread or send additional info from the state of thePMBuffer
and use it for the transitions in theRenderer
.~This change is![Reviewable](https://reviewable.io/review_button.svg)