Monado OpenXR Runtime
|
D3D11-backed fence (timeline semaphore) creation routine. More...
#include "d3d_d3d11_fence.hpp"
#include "util/u_misc.h"
#include "util/u_logging.h"
#include "util/u_debug.h"
#include "util/u_handles.h"
#include "util/u_time.h"
#include "xrt/xrt_windows.h"
#include <Unknwn.h>
#include <d3d11_3.h>
#include <wil/com.h>
#include <wil/result.h>
#include <memory>
Macros | |
#define | DEFAULT_CATCH(...) |
Functions | |
xrt_result_t | xrt::auxiliary::d3d::d3d11::createSharedFence (ID3D11Device5 &device, bool share_cross_adapter, xrt_graphics_sync_handle_t *out_handle, wil::com_ptr< ID3D11Fence > &out_d3dfence) |
Allocate a fence (ID3D11Fence) that has a corresponding native handle. More... | |
xrt_result_t | xrt::auxiliary::d3d::d3d11::waitOnFenceWithTimeout (wil::com_ptr< ID3D11Fence > fence, wil::unique_event_nothrow &event, uint64_t value, std::chrono::milliseconds timeout_ms) |
Wait for a fence to be signaled with value equal or greater than value within timeout_ns nanoseconds. More... | |
D3D11-backed fence (timeline semaphore) creation routine.
#define DEFAULT_CATCH | ( | ... | ) |
xrt_result_t xrt::auxiliary::d3d::d3d11::createSharedFence | ( | ID3D11Device5 & | device, |
bool | share_cross_adapter, | ||
xrt_graphics_sync_handle_t * | out_handle, | ||
wil::com_ptr< ID3D11Fence > & | out_d3dfence | ||
) |
Allocate a fence (ID3D11Fence) that has a corresponding native handle.
D3D fences are roughly equivalent to Vulkan timeline semaphores.
device | A D3D device to allocate with. | |
share_cross_adapter | True if the fence should be shared across adapters, not only across ID3D11Device instances. | |
[out] | out_handle | A graphics sync handle to populate |
[out] | out_d3dfence | A COM pointer to the D3D11 fence to populate |
References xrt::auxiliary::d3d::d3d11::createSharedFence(), and XRT_SUCCESS.
Referenced by xrt::auxiliary::d3d::d3d11::createSharedFence().
xrt_result_t xrt::auxiliary::d3d::d3d11::waitOnFenceWithTimeout | ( | wil::com_ptr< ID3D11Fence > | fence, |
wil::unique_event_nothrow & | event, | ||
uint64_t | value, | ||
std::chrono::milliseconds | timeout_ms | ||
) |
Wait for a fence to be signaled with value equal or greater than value
within timeout_ns
nanoseconds.
fence | The fence to wait on. |
event | An event to use to wait. Please use a dedicated event for a single thread's calls to this function. |
value | The desired fence value |
timeout_ms | After this long, we may return early with XRT_TIMEOUT even before the fence reaches the value. |
References xrt::auxiliary::d3d::d3d11::waitOnFenceWithTimeout(), XRT_SUCCESS, and XRT_TIMEOUT.
Referenced by xrt::auxiliary::d3d::d3d11::waitOnFenceWithTimeout().