Move some includes on client
This commit is contained in:
@@ -19,7 +19,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
// #include <chrono>
|
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <iterator>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace utils
|
namespace utils
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <iterator>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
|||||||
@@ -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,6 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "utils/named_thread.h"
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include "utils/handle.h"
|
#include "utils/handle.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <vulkan/vulkan.h>
|
|
||||||
#include <openxr/openxr.h>
|
#include <openxr/openxr.h>
|
||||||
|
|
||||||
namespace xr
|
namespace xr
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "fb_face_tracker2.h"
|
#include "fb_face_tracker2.h"
|
||||||
#include "wivrn_packets.h"
|
#include "wivrn_packets.h"
|
||||||
|
#include "xr/instance.h"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <openxr/openxr.h>
|
#include <openxr/openxr.h>
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
#include "wivrn_packets.h"
|
#include "wivrn_packets.h"
|
||||||
#include <openxr/openxr.h>
|
#include <openxr/openxr.h>
|
||||||
|
|
||||||
#include "instance.h"
|
|
||||||
|
|
||||||
namespace xr
|
namespace xr
|
||||||
{
|
{
|
||||||
|
class instance;
|
||||||
|
|
||||||
XrResult destroy_fb_face_tracker2(XrFaceTracker2FB);
|
XrResult destroy_fb_face_tracker2(XrFaceTracker2FB);
|
||||||
|
|
||||||
class fb_face_tracker2 : public utils::handle<XrFaceTracker2FB, destroy_fb_face_tracker2>
|
class fb_face_tracker2 : public utils::handle<XrFaceTracker2FB, destroy_fb_face_tracker2>
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "hand_tracker.h"
|
#include "hand_tracker.h"
|
||||||
|
#include "xr/check.h"
|
||||||
|
#include "xr/instance.h"
|
||||||
#include "xr/session.h"
|
#include "xr/session.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,8 @@
|
|||||||
#include "utils/handle.h"
|
#include "utils/handle.h"
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <utility>
|
|
||||||
#include <openxr/openxr.h>
|
#include <openxr/openxr.h>
|
||||||
|
|
||||||
#include "instance.h"
|
|
||||||
|
|
||||||
namespace xr
|
namespace xr
|
||||||
{
|
{
|
||||||
class instance;
|
class instance;
|
||||||
|
|||||||
@@ -29,9 +29,7 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <vulkan/vulkan.h>
|
|
||||||
#include <openxr/openxr.h>
|
#include <openxr/openxr.h>
|
||||||
#include <openxr/openxr_platform.h>
|
|
||||||
|
|
||||||
namespace xr
|
namespace xr
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#include "passthrough.h"
|
#include "passthrough.h"
|
||||||
#include "openxr/openxr.h"
|
#include "openxr/openxr.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
#include "xr/check.h"
|
||||||
|
#include "xr/instance.h"
|
||||||
|
|
||||||
static PFN_xrDestroyPassthroughLayerFB xrDestroyPassthroughLayerFB{};
|
static PFN_xrDestroyPassthroughLayerFB xrDestroyPassthroughLayerFB{};
|
||||||
static PFN_xrDestroyPassthroughFB xrDestroyPassthroughFB{};
|
static PFN_xrDestroyPassthroughFB xrDestroyPassthroughFB{};
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "details/enumerate.h"
|
#include "details/enumerate.h"
|
||||||
#include "utils/ranges.h"
|
#include "utils/ranges.h"
|
||||||
|
#include "xr/instance.h"
|
||||||
#include "xr/system.h"
|
#include "xr/system.h"
|
||||||
#include <vulkan/vulkan.h>
|
#include <vulkan/vulkan.h>
|
||||||
#include <openxr/openxr_platform.h>
|
#include <openxr/openxr_platform.h>
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <vulkan/vulkan_raii.hpp>
|
#include <vulkan/vulkan_raii.hpp>
|
||||||
#include <openxr/openxr.h>
|
#include <openxr/openxr.h>
|
||||||
#include <openxr/openxr_platform.h>
|
|
||||||
|
|
||||||
namespace xr
|
namespace xr
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user