![]() |
Vireo
0.0
Vireo 3D Rendering Hardware Interface
|
A fence is a GPU/CPU synchronization primitive. It's used to lets the CPU know when submitted GPU work has completed.
There is two uses of vireo::Fence :
Synchronizing the frame rendering is mandatory if you want multiple frames in flight. You need one vireo::Fence per frame then use them in the rendering loop :
Waiting for a command submission to end involve creating a vireo::Fence with vireo::Vireo::createFence, use it with vireo::SubmitQueue::submit then vireo::Fence::wait (blocking the CPU code).
At initialization, create the fence in signaled state to be able use vireo::Fence::reset the first time without using a condition :
Use the fence :