a/d3d: Tidy headers

This commit is contained in:
Jakob Bornecrantz 2022-05-22 12:02:47 +01:00 committed by Ryan Pavlik
parent b8b42a4bcb
commit 658a21a177
4 changed files with 19 additions and 3 deletions

View file

@ -2,8 +2,7 @@
// SPDX-License-Identifier: BSL-1.0 // SPDX-License-Identifier: BSL-1.0
/*! /*!
* @file * @file
* @brief Header exposing factory function for D3D11-backed image * @brief Header for D3D11-backed image buffer allocator factory function.
buffer allocator.
* @author Ryan Pavlik <ryan.pavlik@collabora.com> * @author Ryan Pavlik <ryan.pavlik@collabora.com>
* @ingroup aux_d3d * @ingroup aux_d3d
*/ */
@ -14,6 +13,7 @@
#include <d3d11.h> #include <d3d11.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: BSL-1.0 // SPDX-License-Identifier: BSL-1.0
/*! /*!
* @file * @file
* @brief Higher-level D3D11-backed image buffer allocation routine * @brief Higher-level D3D11-backed image buffer allocation routine.
* @author Ryan Pavlik <ryan.pavlik@collabora.com> * @author Ryan Pavlik <ryan.pavlik@collabora.com>
* @ingroup aux_d3d * @ingroup aux_d3d
*/ */
@ -21,6 +21,7 @@
namespace xrt::auxiliary::d3d { namespace xrt::auxiliary::d3d {
/** /**
* Allocate images (ID3D11Texture2D1) that have a corresponding native handle. * Allocate images (ID3D11Texture2D1) that have a corresponding native handle.
* *
@ -46,4 +47,5 @@ allocateSharedImages(ID3D11Device5 &device,
bool keyed_mutex, bool keyed_mutex,
std::vector<wil::com_ptr<ID3D11Texture2D1>> &out_images, std::vector<wil::com_ptr<ID3D11Texture2D1>> &out_images,
std::vector<wil::unique_handle> &out_handles); std::vector<wil::unique_handle> &out_handles);
}; // namespace xrt::auxiliary::d3d }; // namespace xrt::auxiliary::d3d

View file

@ -7,11 +7,18 @@
* @ingroup aux_d3d * @ingroup aux_d3d
*/ */
#pragma once
#include "xrt/xrt_windows.h" #include "xrt/xrt_windows.h"
#include "xrt/xrt_vulkan_includes.h" #include "xrt/xrt_vulkan_includes.h"
#include <dxgiformat.h> #include <dxgiformat.h>
#ifdef __cplusplus
extern "C" {
#endif
static inline DXGI_FORMAT static inline DXGI_FORMAT
d3d_vk_format_to_dxgi(int64_t format) d3d_vk_format_to_dxgi(int64_t format)
{ {
@ -37,6 +44,7 @@ d3d_vk_format_to_dxgi(int64_t format)
default: return (DXGI_FORMAT)0; default: return (DXGI_FORMAT)0;
} }
} }
static inline DXGI_FORMAT static inline DXGI_FORMAT
d3d_dxgi_format_to_typeless_dxgi(DXGI_FORMAT format) d3d_dxgi_format_to_typeless_dxgi(DXGI_FORMAT format)
{ {
@ -91,3 +99,7 @@ d3d_convert_usage_bits_to_bind_flags(enum xrt_swapchain_usage_bits xsub)
} }
return ret; return ret;
} }
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,7 @@
#include <utility> #include <utility>
namespace xrt::auxiliary::d3d { namespace xrt::auxiliary::d3d {
/** /**
@ -61,4 +62,5 @@ getAdapterByLUID(const xrt_luid_t &luid, u_logging_level log_level = U_LOGGING_I
*/ */
std::pair<wil::com_ptr<ID3D11Device>, wil::com_ptr<ID3D11DeviceContext>> std::pair<wil::com_ptr<ID3D11Device>, wil::com_ptr<ID3D11DeviceContext>>
createD3D11Device(const wil::com_ptr<IDXGIAdapter> &adapter = nullptr, u_logging_level log_level = U_LOGGING_INFO); createD3D11Device(const wil::com_ptr<IDXGIAdapter> &adapter = nullptr, u_logging_level log_level = U_LOGGING_INFO);
} // namespace xrt::auxiliary::d3d } // namespace xrt::auxiliary::d3d