D3D11 backed image buffer allocator.
More...
#include "d3d_d3d11_allocator.h"
#include "d3d_d3d11_allocator.hpp"
#include "d3d_d3d11_bits.h"
#include "d3d_dxgi_formats.h"
#include "util/u_misc.h"
#include "util/u_logging.h"
#include "util/u_debug.h"
#include "util/u_handles.h"
#include "xrt/xrt_windows.h"
#include <Unknwn.h>
#include <d3d11_3.h>
#include <wil/com.h>
#include <wil/result.h>
#include <memory>
|
#define | DEFAULT_CATCH(...) |
|
#define | D3DA_TRACE(...) U_LOG_IFL_T(debug_get_log_option_d3d11_log(), __VA_ARGS__) |
|
#define | D3DA_DEBUG(...) U_LOG_IFL_D(debug_get_log_option_d3d11_log(), __VA_ARGS__) |
|
#define | D3DA_INFO(...) U_LOG_IFL_I(debug_get_log_option_d3d11_log(), __VA_ARGS__) |
|
#define | D3DA_WARN(...) U_LOG_IFL_W(debug_get_log_option_d3d11_log(), __VA_ARGS__) |
|
#define | D3DA_ERROR(...) U_LOG_IFL_E(debug_get_log_option_d3d11_log(), __VA_ARGS__) |
|
|
HANDLE | xrt::auxiliary::d3d::d3d11::getSharedHandle (const wil::com_ptr< ID3D11Texture2D1 > &image) |
|
xrt_result_t | xrt::auxiliary::d3d::d3d11::allocateSharedImages (ID3D11Device5 &device, const xrt_swapchain_create_info &xsci, size_t image_count, bool keyed_mutex, std::vector< wil::com_ptr< ID3D11Texture2D1 > > &out_images, std::vector< HANDLE > &out_handles) |
| Allocate images (ID3D11Texture2D1) that have a corresponding native handle. More...
|
|
static xrt_result_t | d3d11_images_allocate (struct xrt_image_native_allocator *xina, const struct xrt_swapchain_create_info *xsci, size_t image_count, struct xrt_image_native *out_images) |
|
static xrt_result_t | d3d11_images_free (struct xrt_image_native_allocator *xina, size_t image_count, struct xrt_image_native *images) |
|
static void | d3d11_destroy (struct xrt_image_native_allocator *xina) |
|
struct xrt_image_native_allocator * | d3d11_allocator_create (ID3D11Device *device) |
| Create a XINA that allocates D3D11 textures. More...
|
|
◆ DEFAULT_CATCH
#define DEFAULT_CATCH |
( |
|
... | ) |
|
Value: catch (wil::ResultException const &e) \
{ \
U_LOG_E("Caught exception: %s", e.what()); \
return __VA_ARGS__; \
} \
catch (std::exception const &e) \
{ \
U_LOG_E("Caught exception: %s", e.what()); \
return __VA_ARGS__; \
} \
catch (...) \
{ \
U_LOG_E("Caught exception"); \
return __VA_ARGS__; \
}
◆ allocateSharedImages()
xrt_result_t xrt::auxiliary::d3d::d3d11::allocateSharedImages |
( |
ID3D11Device5 & |
device, |
|
|
const xrt_swapchain_create_info & |
xsci, |
|
|
size_t |
image_count, |
|
|
bool |
keyed_mutex, |
|
|
std::vector< wil::com_ptr< ID3D11Texture2D1 > > & |
out_images, |
|
|
std::vector< HANDLE > & |
out_handles |
|
) |
| |
◆ d3d11_allocator_create()
Create a XINA that allocates D3D11 textures.
- Parameters
-
device | A device to allocate the textures with. Be sure it will not be used from other threads while this allocator allocates. |
- Returns
- struct xrt_image_native_allocator*
References U_ZERO.