Monado OpenXR Runtime
comp_d3d_common.hpp File Reference

Functionality common to D3D11 and D3D12 for client side compositor implementation. More...

#include "xrt/xrt_compositor.h"
#include "xrt/xrt_deleters.hpp"
#include "xrt/xrt_results.h"
#include "util/u_handles.h"
#include "util/u_logging.h"
#include <wil/com.h>
#include <wil/resource.h>
#include <wil/result_macros.h>
#include <d3d11_3.h>
#include <memory>
#include <vector>
#include <stdint.h>
Include dependency graph for comp_d3d_common.hpp:

Go to the source code of this file.

Data Structures

class  xrt::compositor::client::KeyedMutexCollection
 A collection of DXGIKeyedMutex objects, one for each swapchain image in a swapchain. More...
 

Typedefs

using xrt::compositor::client::unique_swapchain_ref = std::unique_ptr< struct xrt_swapchain, xrt::deleters::reference_deleter< struct xrt_swapchain, xrt_swapchain_reference > >
 

Functions

static xrt_result_t xrt::compositor::client::importFromHandleDuplicates (xrt_compositor_native &xcn, std::vector< wil::unique_handle > const &handles, const struct xrt_swapchain_create_info &vkinfo, const std::uint64_t image_mem_size, bool use_dedicated_allocation, unique_swapchain_ref &out_xsc)
 Import the provided handles into a native compositor, without consuming them. More...
 
static xrt_result_t xrt::compositor::client::importFromDxgiHandles (xrt_compositor_native &xcn, std::vector< HANDLE > const &handles, const struct xrt_swapchain_create_info &vkinfo, bool use_dedicated_allocation, unique_swapchain_ref &out_xsc)
 Import the provided handles into a native compositor. More...
 

Detailed Description

Functionality common to D3D11 and D3D12 for client side compositor implementation.

Author
Rylie Pavlik rylie.nosp@m..pav.nosp@m.lik@c.nosp@m.olla.nosp@m.bora..nosp@m.com
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Fernando Velazquez Innella finne.nosp@m.lla@.nosp@m.magic.nosp@m.leap.nosp@m..com
Korcan Hussein korca.nosp@m.n.hu.nosp@m.ssein.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ importFromDxgiHandles()

static xrt_result_t xrt::compositor::client::importFromDxgiHandles ( xrt_compositor_native xcn,
std::vector< HANDLE > const &  handles,
const struct xrt_swapchain_create_info vkinfo,
bool  use_dedicated_allocation,
unique_swapchain_ref &  out_xsc 
)
inlinestatic

Import the provided handles into a native compositor.

Parameters
xcnThe native compositor
handlesA vector of DXGI handles.
vkinfoThe swapchain create info, with format as a Vulkan constant
use_dedicated_allocationPassed through to xrt_image_native
[out]out_xscThe swapchain to populate
Returns
XRT_SUCCESS if everything went well, otherwise whatever error a call internally returned.

References xrt_compositor_native::base, xrt_image_native::handle, xrt::compositor::client::importFromDxgiHandles(), and XRT_SUCCESS.

Referenced by xrt::compositor::client::importFromDxgiHandles().

◆ importFromHandleDuplicates()

static xrt_result_t xrt::compositor::client::importFromHandleDuplicates ( xrt_compositor_native xcn,
std::vector< wil::unique_handle > const &  handles,
const struct xrt_swapchain_create_info vkinfo,
const std::uint64_t  image_mem_size,
bool  use_dedicated_allocation,
unique_swapchain_ref &  out_xsc 
)
inlinestatic

Import the provided handles into a native compositor, without consuming them.

Parameters
xcnThe native compositor
handlesA vector of uniquely-owned handles. These will be duplicated, not consumed, by this import.
vkinfoThe swapchain create info, with format as a Vulkan constant
image_mem_sizeThe image memory allocation size in bytes
use_dedicated_allocationPassed through to xrt_image_native
[out]out_xscThe swapchain to populate
Returns
XRT_SUCCESS if everything went well, otherwise whatever error a call internally returned.

References xrt::compositor::client::importFromHandleDuplicates().

Referenced by xrt::compositor::client::importFromHandleDuplicates().