Monado OpenXR Runtime
xrt::compositor::client::KeyedMutexCollection Class Reference

A collection of DXGIKeyedMutex objects, one for each swapchain image in a swapchain. More...

#include <client/comp_d3d_common.hpp>

Collaboration diagram for xrt::compositor::client::KeyedMutexCollection:

Public Member Functions

 KeyedMutexCollection (u_logging_level log_level) noexcept
 Construct a new Keyed Mutex Collection object. More...
 
xrt_result_t init (const std::vector< wil::com_ptr< ID3D11Texture2D1 > > &images) noexcept
 Make the keyed mutex vector before starting to use the images. More...
 
xrt_result_t waitKeyedMutex (uint32_t index, uint64_t timeout_ns) noexcept
 Wait for acquisition of the keyed mutex. More...
 
xrt_result_t releaseKeyedMutex (uint32_t index) noexcept
 Release the keyed mutex. More...
 

Static Public Attributes

static constexpr uint64_t kKeyedMutexKey = 0
 

Detailed Description

A collection of DXGIKeyedMutex objects, one for each swapchain image in a swapchain.

Constructor & Destructor Documentation

◆ KeyedMutexCollection()

xrt::compositor::client::KeyedMutexCollection::KeyedMutexCollection ( u_logging_level  log_level)
explicitnoexcept

Construct a new Keyed Mutex Collection object.

Parameters
log_levelThe compositor log level to use

Member Function Documentation

◆ init()

xrt_result_t xrt::compositor::client::KeyedMutexCollection::init ( const std::vector< wil::com_ptr< ID3D11Texture2D1 > > &  images)
noexcept

Make the keyed mutex vector before starting to use the images.

Parameters
imagesYour vector of textures to acquire keyed mutexes from.

References XRT_SUCCESS.

◆ releaseKeyedMutex()

xrt_result_t xrt::compositor::client::KeyedMutexCollection::releaseKeyedMutex ( uint32_t  index)
noexcept

Release the keyed mutex.

Parameters
indexSwapchain image index
Returns
xrt_result_t

◆ waitKeyedMutex()

xrt_result_t xrt::compositor::client::KeyedMutexCollection::waitKeyedMutex ( uint32_t  index,
uint64_t  timeout_ns 
)
noexcept

Wait for acquisition of the keyed mutex.

Parameters
indexSwapchain image index
timeout_nsTimeout in nanoseconds or XRT_INFINITE_DURATION
Returns
xrt_result_t: XRT_SUCCESS, XRT_TIMEOUT, or some error

The documentation for this class was generated from the following files: