Skip to content

LiteFX::Rendering::Backends::DirectX12Queue::waitFor

Lets the command queue wait for a certain fence value to complete on another queue.

Synopsis

Declared in <litefx/backends/dx12.hpp>

[[dllimport, dllexport]] void waitFor(
    DirectX12Queue const& queue,
    UInt64 fence) const;

Description

This overload performs a GPU-side wait, i.e., the current command queue waits until queue has passed the fence value provided by the fence parameter. This overload does return immediately and does not block the CPU.

Waiting for a fence that is larger than ICommandQueue::currentFence on queue logs a warning, since it would wait for a future submission, that may be blocked by another wait. This can cause deadlocks and should be avoided. A fence value of 0 is a no-op, as it is always satisfied.

Parameters

NameDescription
queueThe queue to wait upon.
fenceThe value of the fence to wait upon on the other queue.