xrt: Add interfaces for D3D11

This commit is contained in:
Ryan Pavlik 2021-10-19 16:07:08 -05:00 committed by Jakob Bornecrantz
parent 8bcc2cd195
commit bbfc06cc3e
2 changed files with 97 additions and 0 deletions

View file

@ -11,6 +11,14 @@
#include "xrt/xrt_defines.h"
#include "xrt/xrt_handles.h"
#include "xrt/xrt_config_os.h"
#if defined(XRT_OS_WINDOWS)
#include "xrt/xrt_windows.h"
#include "d3d11.h"
#elif defined(XRT_DOXYGEN)
struct ID3D11Texture2D;
#endif
#ifdef __cplusplus
extern "C" {
@ -1573,6 +1581,53 @@ xrt_compositor_vk(struct xrt_compositor *xc)
return (struct xrt_compositor_vk *)xc;
}
#if defined(XRT_OS_WINDOWS) || defined(XRT_DOXYGEN)
/*
*
* D3D11 interface.
*
*/
/*!
* Base class for a D3D11 client swapchain.
*
* @ingroup xrt_iface comp_client
* @extends xrt_swapchain
*/
struct xrt_swapchain_d3d11
{
//! @public Base
struct xrt_swapchain base;
//! Images to be used by the caller.
ID3D11Texture2D *images[XRT_MAX_SWAPCHAIN_IMAGES];
};
/*!
* Base class for a D3D11 client compositor.
*
* @ingroup xrt_iface comp_client
* @extends xrt_compositor
*/
struct xrt_compositor_d3d11
{
//! @public Base
struct xrt_compositor base;
};
/*!
* Graphics usage requirements for D3D APIs.
*
* @ingroup xrt_iface
*/
struct xrt_d3d_requirements
{
LUID adapter_luid;
D3D_FEATURE_LEVEL min_feature_level;
};
#endif // XRT_OS_WINDOWS
/*
*

View file

@ -0,0 +1,42 @@
// Copyright 2021, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Header defining a D3D11 graphics interface
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
* @ingroup xrt_iface
*/
#pragma once
#include "xrt/xrt_device.h"
#include "xrt/xrt_compositor.h"
#include "xrt/xrt_config_os.h"
#include "xrt/xrt_windows.h"
#if defined(XRT_OS_WINDOWS)
#include "d3d11.h"
#elif defined(XRT_DOXYGEN)
struct ID3D11Device;
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if defined(XRT_OS_WINDOWS) || defined(XRT_DOXYGEN)
/*!
* Create a D3D11 compositor client.
*
* @ingroup xrt_iface
* @public @memberof xrt_compositor_native
*/
struct xrt_compositor_d3d11 *
xrt_gfx_d3d11_provider_create(struct xrt_compositor_native *xcn, ID3D11Device *device);
#endif // XRT_OS_WINDOWS || XRT_DOXYGEN
#ifdef __cplusplus
}
#endif