UgFence

CPU–GPU synchronization fence

It

Thin wrapper around a Vulkan fence handle

struct It {
  VkFence handle;
};

create

Create a fence in the signaled state

UgFence.It create(UgContext.It& ctx);

Parameters

  • ctx — Vulkan context

Returns — Initialized fence object


destroy

Destroy a fence

U0 destroy(UgContext.It& ctx, UgFence.It& fence);

Parameters

  • ctx — Vulkan context
  • fence — Fence to destroy

wait

Block the CPU until the fence is signaled

U0 wait(UgContext.It& ctx, UgFence.It& fence);

Parameters

  • ctx — Vulkan context
  • fence — Fence to wait on

reset

Reset a fence back to the unsignaled state

U0 reset(UgContext.It& ctx, UgFence.It& fence);

Parameters

  • ctx — Vulkan context
  • fence — Fence to reset