From 658a21a17798a5d9fa52083de7abe5b9783ba9f3 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 22 May 2022 12:02:47 +0100 Subject: [PATCH] a/d3d: Tidy headers --- src/xrt/auxiliary/d3d/d3d_d3d11_allocator.h | 4 ++-- src/xrt/auxiliary/d3d/d3d_d3d11_allocator.hpp | 4 +++- src/xrt/auxiliary/d3d/d3d_dxgi_formats.h | 12 ++++++++++++ src/xrt/auxiliary/d3d/d3d_helpers.hpp | 2 ++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/xrt/auxiliary/d3d/d3d_d3d11_allocator.h b/src/xrt/auxiliary/d3d/d3d_d3d11_allocator.h index 279161ff8..6806f2aaf 100644 --- a/src/xrt/auxiliary/d3d/d3d_d3d11_allocator.h +++ b/src/xrt/auxiliary/d3d/d3d_d3d11_allocator.h @@ -2,8 +2,7 @@ // SPDX-License-Identifier: BSL-1.0 /*! * @file - * @brief Header exposing factory function for D3D11-backed image - buffer allocator. + * @brief Header for D3D11-backed image buffer allocator factory function. * @author Ryan Pavlik * @ingroup aux_d3d */ @@ -14,6 +13,7 @@ #include + #ifdef __cplusplus extern "C" { #endif diff --git a/src/xrt/auxiliary/d3d/d3d_d3d11_allocator.hpp b/src/xrt/auxiliary/d3d/d3d_d3d11_allocator.hpp index 6c50ba8d4..f72997b0d 100644 --- a/src/xrt/auxiliary/d3d/d3d_d3d11_allocator.hpp +++ b/src/xrt/auxiliary/d3d/d3d_d3d11_allocator.hpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BSL-1.0 /*! * @file - * @brief Higher-level D3D11-backed image buffer allocation routine + * @brief Higher-level D3D11-backed image buffer allocation routine. * @author Ryan Pavlik * @ingroup aux_d3d */ @@ -21,6 +21,7 @@ namespace xrt::auxiliary::d3d { + /** * Allocate images (ID3D11Texture2D1) that have a corresponding native handle. * @@ -46,4 +47,5 @@ allocateSharedImages(ID3D11Device5 &device, bool keyed_mutex, std::vector> &out_images, std::vector &out_handles); + }; // namespace xrt::auxiliary::d3d diff --git a/src/xrt/auxiliary/d3d/d3d_dxgi_formats.h b/src/xrt/auxiliary/d3d/d3d_dxgi_formats.h index a94d80bf5..5b96df23c 100644 --- a/src/xrt/auxiliary/d3d/d3d_dxgi_formats.h +++ b/src/xrt/auxiliary/d3d/d3d_dxgi_formats.h @@ -7,11 +7,18 @@ * @ingroup aux_d3d */ +#pragma once + #include "xrt/xrt_windows.h" #include "xrt/xrt_vulkan_includes.h" #include + +#ifdef __cplusplus +extern "C" { +#endif + static inline DXGI_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; } } + static inline DXGI_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; } + +#ifdef __cplusplus +} +#endif diff --git a/src/xrt/auxiliary/d3d/d3d_helpers.hpp b/src/xrt/auxiliary/d3d/d3d_helpers.hpp index b58bba445..97313ad72 100644 --- a/src/xrt/auxiliary/d3d/d3d_helpers.hpp +++ b/src/xrt/auxiliary/d3d/d3d_helpers.hpp @@ -20,6 +20,7 @@ #include + 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> createD3D11Device(const wil::com_ptr &adapter = nullptr, u_logging_level log_level = U_LOGGING_INFO); + } // namespace xrt::auxiliary::d3d