|
Monado OpenXR Runtime
|
D3D12-backed fence (timeline semaphore) creation routine. More...
#include "d3d_d3d12_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 <d3d12.h>#include <dxgi1_2.h>#include <wil/com.h>#include <wil/result.h>#include <memory>
Macros | |
| #define | DEFAULT_CATCH(...) |
Functions | |
| xrt_result_t | xrt::auxiliary::d3d::d3d12::createSharedFence (ID3D12Device &device, bool share_cross_adapter, xrt_graphics_sync_handle_t *out_handle, wil::com_ptr< ID3D12Fence > &out_d3dfence) |
| Allocate a fence (ID3D12Fence) that has a corresponding native handle. More... | |
| xrt_result_t | xrt::auxiliary::d3d::d3d12::waitOnFenceWithTimeout (wil::com_ptr< ID3D12Fence > 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... | |
D3D12-backed fence (timeline semaphore) creation routine.
| #define DEFAULT_CATCH | ( | ... | ) |
| xrt_result_t xrt::auxiliary::d3d::d3d12::createSharedFence | ( | ID3D12Device & | device, |
| bool | share_cross_adapter, | ||
| xrt_graphics_sync_handle_t * | out_handle, | ||
| wil::com_ptr< ID3D12Fence > & | out_d3dfence | ||
| ) |
Allocate a fence (ID3D12Fence) 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 ID3D12Device instances. | |
| [out] | out_handle | A graphics sync handle to populate |
| [out] | out_d3dfence | A COM pointer to the D3D12 fence to populate |
References XRT_SUCCESS.
| xrt_result_t xrt::auxiliary::d3d::d3d12::waitOnFenceWithTimeout | ( | wil::com_ptr< ID3D12Fence > | 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_SUCCESS, and XRT_TIMEOUT.