Monado OpenXR Runtime
|
Misc D3D12 helper routines. More...
#include "d3d_d3d12_helpers.hpp"
#include "d3d_d3d12_bits.h"
#include "util/u_logging.h"
#include <d3d12.h>
#include <wil/com.h>
#include <wil/result.h>
#include <vector>
#include <stdexcept>
Functions | |
wil::com_ptr< ID3D12Device > | xrt::auxiliary::d3d::d3d12::createDevice (const wil::com_ptr< IDXGIAdapter > &adapter=nullptr, u_logging_level log_level=U_LOGGING_INFO) |
Create a D3D12 Device object. More... | |
HRESULT | xrt::auxiliary::d3d::d3d12::createCommandLists (ID3D12Device &device, ID3D12CommandAllocator &command_allocator, ID3D12Resource &resource, enum xrt_swapchain_usage_bits bits, wil::com_ptr< ID3D12CommandList > out_acquire_command_list, wil::com_ptr< ID3D12CommandList > out_release_command_list) |
Create command lists for a resource transitioning to/from app control. More... | |
HRESULT | xrt::auxiliary::d3d::d3d12::createCommandListImageCopy (ID3D12Device &device, ID3D12CommandAllocator &command_allocator, ID3D12Resource &resource_src, ID3D12Resource &resource_dst, D3D12_RESOURCE_STATES src_resource_state, D3D12_RESOURCE_STATES dst_resource_state, wil::com_ptr< ID3D12CommandList > &out_copy_command_list) |
Create a command list for image resource copying. More... | |
wil::com_ptr< ID3D12Resource > | xrt::auxiliary::d3d::d3d12::importImage (ID3D12Device &device, HANDLE h) |
Imports an image into D3D12 from a handle. More... | |
wil::com_ptr< ID3D12Fence1 > | xrt::auxiliary::d3d::d3d12::importFence (ID3D12Device &device, HANDLE h) |
Imports a fence into D3D12 from a handle. More... | |
Misc D3D12 helper routines.
HRESULT xrt::auxiliary::d3d::d3d12::createCommandListImageCopy | ( | ID3D12Device & | device, |
ID3D12CommandAllocator & | command_allocator, | ||
ID3D12Resource & | resource_src, | ||
ID3D12Resource & | resource_dst, | ||
D3D12_RESOURCE_STATES | src_resource_state, | ||
D3D12_RESOURCE_STATES | dst_resource_state, | ||
wil::com_ptr< ID3D12CommandList > & | out_copy_command_list | ||
) |
Create a command list for image resource copying.
device | D3D12 device | |
command_allocator | ||
resource_src | Source image | |
resource_dst | Destination image | |
src_resource_state | ||
dst_resource_state | ||
[out] | out_copy_command_list | Command list output |
References xrt::auxiliary::d3d::d3d12::createCommandListImageCopy().
Referenced by xrt::auxiliary::d3d::d3d12::createCommandListImageCopy().
HRESULT xrt::auxiliary::d3d::d3d12::createCommandLists | ( | ID3D12Device & | device, |
ID3D12CommandAllocator & | command_allocator, | ||
ID3D12Resource & | resource, | ||
enum xrt_swapchain_usage_bits | bits, | ||
wil::com_ptr< ID3D12CommandList > | out_acquire_command_list, | ||
wil::com_ptr< ID3D12CommandList > | out_release_command_list | ||
) |
Create command lists for a resource transitioning to/from app control.
device | D3D12 device | |
command_allocator | ||
resource | image | |
bits | Swapchain usage bits | |
[out] | out_acquire_command_list | Command list to populate for xrAcquireSwapchainImage |
[out] | out_release_command_list | Command list to populate for xrReleaseSwapchainImage |
References xrt::auxiliary::d3d::d3d12::createCommandLists().
Referenced by xrt::auxiliary::d3d::d3d12::createCommandLists().
wil::com_ptr< ID3D12Device > xrt::auxiliary::d3d::d3d12::createDevice | ( | const wil::com_ptr< IDXGIAdapter > & | adapter = nullptr , |
u_logging_level | log_level = U_LOGGING_INFO |
||
) |
Create a D3D12 Device object.
adapter | optional: adapter to create on. |
log_level | The level to compare against for internal log messages |
wil::ResultException | in case of error |
wil::com_ptr< ID3D12Fence1 > xrt::auxiliary::d3d::d3d12::importFence | ( | ID3D12Device & | device, |
HANDLE | h | ||
) |
Imports a fence into D3D12 from a handle.
device | D3D12 device |
h | handle corresponding to a shared fence |
std::logic_error | if the handle is invalid, wil exceptions if the operation failed. |
References xrt::auxiliary::d3d::d3d12::importFence().
Referenced by xrt::auxiliary::d3d::d3d12::importFence().
wil::com_ptr< ID3D12Resource > xrt::auxiliary::d3d::d3d12::importImage | ( | ID3D12Device & | device, |
HANDLE | h | ||
) |
Imports an image into D3D12 from a handle.
device | D3D12 device |
h | handle corresponding to a shared image |
std::logic_error | if the handle is invalid, wil exceptions if the operation failed. |
References xrt::auxiliary::d3d::d3d12::importImage().
Referenced by xrt::auxiliary::d3d::d3d12::importImage().