Move some includes on client

This commit is contained in:
Patrick Nicolas
2024-10-04 00:15:14 +02:00
parent 647be80d55
commit 7cd0097f46
14 changed files with 11 additions and 88 deletions
-1
View File
@@ -19,7 +19,6 @@
#pragma once
#include <atomic>
// #include <chrono>
#include <condition_variable>
#include <exception>
#include <functional>
+2
View File
@@ -18,7 +18,9 @@
#pragma once
#include <filesystem>
#include <fstream>
#include <iterator>
#include <vector>
namespace utils
+1
View File
@@ -20,6 +20,7 @@
#pragma once
#include <cstddef>
#include <iterator>
#include <type_traits>
#include <utility>
-77
View File
@@ -1,77 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2022 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022 Patrick Nicolas <patricknicolas@laposte.net>
*
* 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 <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "utils/typename.h"
#include "vk/vk.h"
#include <system_error>
#include <vector>
#include <vulkan/vulkan.h>
namespace vk::details
{
template <typename T>
struct structure_traits_base
{
static constexpr inline VkStructureType type = VK_STRUCTURE_TYPE_MAX_ENUM;
using base = T;
};
template <typename T>
struct structure_traits : structure_traits_base<T>
{};
template <typename T>
constexpr inline VkStructureType structure_type = structure_traits<T>::type;
template <typename T, typename F, typename... Args>
auto enumerate(F f, Args &&... args) -> auto
{
std::vector<T> array;
uint32_t count;
VkResult result;
result = f(std::forward<Args>(args)..., &count, nullptr);
if (result >= 0)
{
if constexpr (structure_type<T> == VK_STRUCTURE_TYPE_MAX_ENUM)
{
array.resize(count);
}
else
{
T default_value{};
default_value.type = structure_type<T>;
array.resize(count, default_value);
}
result = f(std::forward<Args>(args)..., &count, reinterpret_cast<typename structure_traits<T>::base *>(array.data()));
}
if (result < 0)
{
throw std::system_error(result, vk::error_category(), "enumerating " + type_name<T>());
}
return array;
}
} // namespace vk::details
-1
View File
@@ -1,6 +1,5 @@
#pragma once
#include "utils/named_thread.h"
#include <chrono>
#include <map>
#include <memory>
-1
View File
@@ -22,7 +22,6 @@
#include "utils/handle.h"
#include <string>
#include <vector>
#include <vulkan/vulkan.h>
#include <openxr/openxr.h>
namespace xr
+1
View File
@@ -18,6 +18,7 @@
#include "fb_face_tracker2.h"
#include "wivrn_packets.h"
#include "xr/instance.h"
#include <cstdint>
#include <openxr/openxr.h>
+2 -2
View File
@@ -22,10 +22,10 @@
#include "wivrn_packets.h"
#include <openxr/openxr.h>
#include "instance.h"
namespace xr
{
class instance;
XrResult destroy_fb_face_tracker2(XrFaceTracker2FB);
class fb_face_tracker2 : public utils::handle<XrFaceTracker2FB, destroy_fb_face_tracker2>
+2
View File
@@ -18,6 +18,8 @@
*/
#include "hand_tracker.h"
#include "xr/check.h"
#include "xr/instance.h"
#include "xr/session.h"
#include <cassert>
-3
View File
@@ -22,11 +22,8 @@
#include "utils/handle.h"
#include <array>
#include <optional>
#include <utility>
#include <openxr/openxr.h>
#include "instance.h"
namespace xr
{
class instance;
-2
View File
@@ -29,9 +29,7 @@
#include <string_view>
#include <unordered_map>
#include <vector>
#include <vulkan/vulkan.h>
#include <openxr/openxr.h>
#include <openxr/openxr_platform.h>
namespace xr
{
+2
View File
@@ -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{};
+1
View File
@@ -21,6 +21,7 @@
#include "details/enumerate.h"
#include "utils/ranges.h"
#include "xr/instance.h"
#include "xr/system.h"
#include <vulkan/vulkan.h>
#include <openxr/openxr_platform.h>
-1
View File
@@ -27,7 +27,6 @@
#include <vector>
#include <vulkan/vulkan_raii.hpp>
#include <openxr/openxr.h>
#include <openxr/openxr_platform.h>
namespace xr
{