From 7cd0097f46ccd1298334b710bc79498d32d95d0d Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Fri, 4 Oct 2024 00:15:14 +0200 Subject: [PATCH] Move some includes on client --- client/utils/async.h | 1 - client/utils/files.h | 2 + client/utils/ranges.h | 1 + client/vk/details/enumerate.h | 77 ---------------------------------- client/wivrn_discover.h | 1 - client/xr/actionset.h | 1 - client/xr/fb_face_tracker2.cpp | 1 + client/xr/fb_face_tracker2.h | 4 +- client/xr/hand_tracker.cpp | 2 + client/xr/hand_tracker.h | 3 -- client/xr/instance.h | 2 - client/xr/passthrough.cpp | 2 + client/xr/session.cpp | 1 + client/xr/swapchain.h | 1 - 14 files changed, 11 insertions(+), 88 deletions(-) delete mode 100644 client/vk/details/enumerate.h diff --git a/client/utils/async.h b/client/utils/async.h index e40e0851..de966331 100644 --- a/client/utils/async.h +++ b/client/utils/async.h @@ -19,7 +19,6 @@ #pragma once #include -// #include #include #include #include diff --git a/client/utils/files.h b/client/utils/files.h index 7fef9e61..2c2e05d1 100644 --- a/client/utils/files.h +++ b/client/utils/files.h @@ -18,7 +18,9 @@ #pragma once +#include #include +#include #include namespace utils diff --git a/client/utils/ranges.h b/client/utils/ranges.h index 3d260d92..5631c7de 100644 --- a/client/utils/ranges.h +++ b/client/utils/ranges.h @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include diff --git a/client/vk/details/enumerate.h b/client/vk/details/enumerate.h deleted file mode 100644 index 03b4eb49..00000000 --- a/client/vk/details/enumerate.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * WiVRn VR streaming - * Copyright (C) 2022 Guillaume Meunier - * Copyright (C) 2022 Patrick Nicolas - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "utils/typename.h" -#include "vk/vk.h" -#include -#include -#include - -namespace vk::details -{ - -template -struct structure_traits_base -{ - static constexpr inline VkStructureType type = VK_STRUCTURE_TYPE_MAX_ENUM; - using base = T; -}; - -template -struct structure_traits : structure_traits_base -{}; - -template -constexpr inline VkStructureType structure_type = structure_traits::type; - -template -auto enumerate(F f, Args &&... args) -> auto -{ - std::vector array; - uint32_t count; - VkResult result; - - result = f(std::forward(args)..., &count, nullptr); - - if (result >= 0) - { - if constexpr (structure_type == VK_STRUCTURE_TYPE_MAX_ENUM) - { - array.resize(count); - } - else - { - T default_value{}; - default_value.type = structure_type; - array.resize(count, default_value); - } - result = f(std::forward(args)..., &count, reinterpret_cast::base *>(array.data())); - } - - if (result < 0) - { - throw std::system_error(result, vk::error_category(), "enumerating " + type_name()); - } - - return array; -} - -} // namespace vk::details diff --git a/client/wivrn_discover.h b/client/wivrn_discover.h index 7b31b426..cd32a231 100644 --- a/client/wivrn_discover.h +++ b/client/wivrn_discover.h @@ -1,6 +1,5 @@ #pragma once -#include "utils/named_thread.h" #include #include #include diff --git a/client/xr/actionset.h b/client/xr/actionset.h index 3db9f596..f0549605 100644 --- a/client/xr/actionset.h +++ b/client/xr/actionset.h @@ -22,7 +22,6 @@ #include "utils/handle.h" #include #include -#include #include namespace xr diff --git a/client/xr/fb_face_tracker2.cpp b/client/xr/fb_face_tracker2.cpp index da2a1bb4..b173c328 100644 --- a/client/xr/fb_face_tracker2.cpp +++ b/client/xr/fb_face_tracker2.cpp @@ -18,6 +18,7 @@ #include "fb_face_tracker2.h" #include "wivrn_packets.h" +#include "xr/instance.h" #include #include diff --git a/client/xr/fb_face_tracker2.h b/client/xr/fb_face_tracker2.h index 499a1a49..29e0787c 100644 --- a/client/xr/fb_face_tracker2.h +++ b/client/xr/fb_face_tracker2.h @@ -22,10 +22,10 @@ #include "wivrn_packets.h" #include -#include "instance.h" - namespace xr { +class instance; + XrResult destroy_fb_face_tracker2(XrFaceTracker2FB); class fb_face_tracker2 : public utils::handle diff --git a/client/xr/hand_tracker.cpp b/client/xr/hand_tracker.cpp index 2e273c92..814350ef 100644 --- a/client/xr/hand_tracker.cpp +++ b/client/xr/hand_tracker.cpp @@ -18,6 +18,8 @@ */ #include "hand_tracker.h" +#include "xr/check.h" +#include "xr/instance.h" #include "xr/session.h" #include diff --git a/client/xr/hand_tracker.h b/client/xr/hand_tracker.h index 95cc19f1..73e9d05e 100644 --- a/client/xr/hand_tracker.h +++ b/client/xr/hand_tracker.h @@ -22,11 +22,8 @@ #include "utils/handle.h" #include #include -#include #include -#include "instance.h" - namespace xr { class instance; diff --git a/client/xr/instance.h b/client/xr/instance.h index 94691c14..1de0232d 100644 --- a/client/xr/instance.h +++ b/client/xr/instance.h @@ -29,9 +29,7 @@ #include #include #include -#include #include -#include namespace xr { diff --git a/client/xr/passthrough.cpp b/client/xr/passthrough.cpp index 0a481046..8e7dc568 100644 --- a/client/xr/passthrough.cpp +++ b/client/xr/passthrough.cpp @@ -20,6 +20,8 @@ #include "passthrough.h" #include "openxr/openxr.h" #include "session.h" +#include "xr/check.h" +#include "xr/instance.h" static PFN_xrDestroyPassthroughLayerFB xrDestroyPassthroughLayerFB{}; static PFN_xrDestroyPassthroughFB xrDestroyPassthroughFB{}; diff --git a/client/xr/session.cpp b/client/xr/session.cpp index 1313c8dd..bf5f3bce 100644 --- a/client/xr/session.cpp +++ b/client/xr/session.cpp @@ -21,6 +21,7 @@ #include "details/enumerate.h" #include "utils/ranges.h" +#include "xr/instance.h" #include "xr/system.h" #include #include diff --git a/client/xr/swapchain.h b/client/xr/swapchain.h index 0e57b8a3..373120df 100644 --- a/client/xr/swapchain.h +++ b/client/xr/swapchain.h @@ -27,7 +27,6 @@ #include #include #include -#include namespace xr {