- More Documentation
- Updated Copyright
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// =====================================================================================================================
|
||||
// fennec, a free and open source game engine
|
||||
// Copyright © 2025 Medusa Slockbower
|
||||
// Copyright © 2025 - 2026 Medusa Slockbower
|
||||
//
|
||||
// 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
|
||||
@@ -17,14 +17,14 @@
|
||||
// =====================================================================================================================
|
||||
|
||||
///
|
||||
/// \file instance.h
|
||||
/// \file fennec/renderers/vulkan/lib/app_info.h
|
||||
/// \brief
|
||||
///
|
||||
///
|
||||
/// \details
|
||||
/// \author Medusa Slockbower
|
||||
///
|
||||
/// \copyright Copyright © 2025 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
|
||||
/// \copyright Copyright © 2025 - 2026 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
|
||||
///
|
||||
///
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
namespace fennec::vk
|
||||
{
|
||||
|
||||
///
|
||||
/// \brief Wrapper class for VkApplicationInfo
|
||||
struct app_info : private VkApplicationInfo {
|
||||
|
||||
// Constructors & Destructor ===========================================================================================
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// =====================================================================================================================
|
||||
// fennec, a free and open source game engine
|
||||
// Copyright © 2025 Medusa Slockbower
|
||||
// Copyright © 2025 - 2026 Medusa Slockbower
|
||||
//
|
||||
// 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
|
||||
@@ -17,14 +17,14 @@
|
||||
// =====================================================================================================================
|
||||
|
||||
///
|
||||
/// \file instance.h
|
||||
/// \file fennec/renderers/vulkan/lib/instance.h
|
||||
/// \brief
|
||||
///
|
||||
///
|
||||
/// \details
|
||||
/// \author Medusa Slockbower
|
||||
///
|
||||
/// \copyright Copyright © 2025 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
|
||||
/// \copyright Copyright © 2025 - 2026 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
|
||||
///
|
||||
///
|
||||
|
||||
@@ -40,12 +40,105 @@
|
||||
namespace fennec::vk
|
||||
{
|
||||
|
||||
///
|
||||
/// \brief Wrapper class for VkInstance
|
||||
struct instance {
|
||||
public:
|
||||
using create_flags = VkInstanceCreateFlags;
|
||||
|
||||
// Definitions =========================================================================================================
|
||||
public:
|
||||
using create_flags = VkInstanceCreateFlags; //!< Alias for VkInstanceCreateFlags
|
||||
|
||||
|
||||
///
|
||||
/// \brief Wrapper class for VkInstanceCreateInfo
|
||||
struct create_info : private VkInstanceCreateInfo {
|
||||
|
||||
// Constructors & Destructor ---------------------------------------------------------------------------------------
|
||||
public:
|
||||
|
||||
///
|
||||
/// \brief Constructor, acts as default constructor, takes \f$nullptr\f$ for \f$info\f$
|
||||
/// \param flags
|
||||
/// \param ext
|
||||
create_info(
|
||||
create_flags flags = {}, nullptr_t = nullptr,
|
||||
void* ext = nullptr
|
||||
) : VkInstanceCreateInfo {
|
||||
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
||||
.pNext = ext,
|
||||
.flags = flags,
|
||||
.pApplicationInfo = nullptr,
|
||||
.enabledLayerCount = 0,
|
||||
.ppEnabledLayerNames = nullptr,
|
||||
.enabledExtensionCount = 0,
|
||||
.ppEnabledExtensionNames = nullptr,
|
||||
} {
|
||||
}
|
||||
|
||||
///
|
||||
/// \brief
|
||||
/// \param flags
|
||||
/// \param info
|
||||
/// \param ext
|
||||
create_info(
|
||||
create_flags flags, const app_info& info,
|
||||
void* ext = nullptr
|
||||
) : VkInstanceCreateInfo {
|
||||
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
||||
.pNext = ext,
|
||||
.flags = flags,
|
||||
.pApplicationInfo = info,
|
||||
.enabledLayerCount = 0,
|
||||
.ppEnabledLayerNames = nullptr,
|
||||
.enabledExtensionCount = 0,
|
||||
.ppEnabledExtensionNames = nullptr,
|
||||
} {
|
||||
}
|
||||
|
||||
template<size_t LayersN>
|
||||
create_info(
|
||||
create_flags flags, const app_info& info,
|
||||
const cstring (&layers)[LayersN], nullptr_t,
|
||||
void* ext
|
||||
) : VkInstanceCreateInfo {
|
||||
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
||||
.pNext = ext,
|
||||
.flags = flags,
|
||||
.pApplicationInfo = info,
|
||||
.enabledLayerCount = LayersN,
|
||||
.ppEnabledLayerNames = nullptr,
|
||||
.enabledExtensionCount = 0,
|
||||
.ppEnabledExtensionNames = nullptr,
|
||||
} {
|
||||
_layers.reserve(LayersN);
|
||||
for (const auto& layer : layers) { _layers.push_back(layer); }
|
||||
|
||||
ppEnabledLayerNames = _layers.data();
|
||||
ppEnabledExtensionNames = _extensions.data();
|
||||
}
|
||||
|
||||
template<size_t ExtensionsN>
|
||||
create_info(
|
||||
create_flags flags, const app_info& info,
|
||||
nullptr_t, const cstring (&extensions)[ExtensionsN],
|
||||
void* ext
|
||||
) : VkInstanceCreateInfo {
|
||||
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
||||
.pNext = ext,
|
||||
.flags = flags,
|
||||
.pApplicationInfo = info,
|
||||
.enabledLayerCount = 0,
|
||||
.ppEnabledLayerNames = nullptr,
|
||||
.enabledExtensionCount = ExtensionsN,
|
||||
.ppEnabledExtensionNames = nullptr,
|
||||
} {
|
||||
_extensions.reserve(ExtensionsN);
|
||||
for (const auto& extension : extensions) { _extensions.push_back(extension); }
|
||||
|
||||
ppEnabledLayerNames = _layers.data();
|
||||
ppEnabledExtensionNames = _extensions.data();
|
||||
}
|
||||
|
||||
template<size_t LayersN, size_t ExtensionsN>
|
||||
create_info(
|
||||
create_flags flags, const app_info& info,
|
||||
@@ -71,6 +164,72 @@ public:
|
||||
ppEnabledExtensionNames = _extensions.data();
|
||||
}
|
||||
|
||||
create_info(
|
||||
create_flags flags, const app_info& info,
|
||||
const dynarray<cstring>& layers, nullptr_t,
|
||||
void* ext
|
||||
) : VkInstanceCreateInfo {
|
||||
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
||||
.pNext = ext,
|
||||
.flags = flags,
|
||||
.pApplicationInfo = info,
|
||||
.enabledLayerCount = layers.size(),
|
||||
.ppEnabledLayerNames = nullptr,
|
||||
.enabledExtensionCount = 0,
|
||||
.ppEnabledExtensionNames = nullptr,
|
||||
} {
|
||||
_layers.reserve(enabledLayerCount);
|
||||
for (const auto& layer : layers) { _layers.push_back(layer); }
|
||||
|
||||
ppEnabledLayerNames = _layers.data();
|
||||
ppEnabledExtensionNames = _extensions.data();
|
||||
}
|
||||
|
||||
create_info(
|
||||
create_flags flags, const app_info& info,
|
||||
nullptr_t, const dynarray<cstring>& extensions,
|
||||
void* ext
|
||||
) : VkInstanceCreateInfo {
|
||||
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
||||
.pNext = ext,
|
||||
.flags = flags,
|
||||
.pApplicationInfo = info,
|
||||
.enabledLayerCount = 0,
|
||||
.ppEnabledLayerNames = nullptr,
|
||||
.enabledExtensionCount = extensions.size(),
|
||||
.ppEnabledExtensionNames = nullptr,
|
||||
} {
|
||||
_extensions.reserve(enabledExtensionCount);
|
||||
for (const auto& extension : extensions) { _extensions.push_back(extension); }
|
||||
|
||||
ppEnabledLayerNames = _layers.data();
|
||||
ppEnabledExtensionNames = _extensions.data();
|
||||
}
|
||||
|
||||
create_info(
|
||||
create_flags flags, const app_info& info,
|
||||
const dynarray<cstring>& layers, const dynarray<cstring>& extensions,
|
||||
void* ext
|
||||
) : VkInstanceCreateInfo {
|
||||
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
||||
.pNext = ext,
|
||||
.flags = flags,
|
||||
.pApplicationInfo = info,
|
||||
.enabledLayerCount = layers.size(),
|
||||
.ppEnabledLayerNames = nullptr,
|
||||
.enabledExtensionCount = extensions.size(),
|
||||
.ppEnabledExtensionNames = nullptr,
|
||||
} {
|
||||
_layers.reserve(enabledLayerCount);
|
||||
for (const auto& layer : layers) { _layers.push_back(layer); }
|
||||
|
||||
_extensions.reserve(enabledExtensionCount);
|
||||
for (const auto& extension : extensions) { _extensions.push_back(extension); }
|
||||
|
||||
ppEnabledLayerNames = _layers.data();
|
||||
ppEnabledExtensionNames = _extensions.data();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// =====================================================================================================================
|
||||
// fennec, a free and open source game engine
|
||||
// Copyright © 2025 Medusa Slockbower
|
||||
// Copyright © 2025 - 2026 Medusa Slockbower
|
||||
//
|
||||
// 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// =====================================================================================================================
|
||||
// fennec, a free and open source game engine
|
||||
// Copyright © 2025 Medusa Slockbower
|
||||
// Copyright © 2025 - 2026 Medusa Slockbower
|
||||
//
|
||||
// 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
|
||||
@@ -17,14 +17,14 @@
|
||||
// =====================================================================================================================
|
||||
|
||||
///
|
||||
/// \file context.h
|
||||
/// \file fennec/renderers/vulkan/vkcontext.h
|
||||
/// \brief
|
||||
///
|
||||
///
|
||||
/// \details
|
||||
/// \author Medusa Slockbower
|
||||
///
|
||||
/// \copyright Copyright © 2025 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
|
||||
/// \copyright Copyright © 2025 - 2026 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
|
||||
///
|
||||
///
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
#include <fennec/platform/interface/fwd.h>
|
||||
#include <fennec/renderers/interface/gfxcontext.h>
|
||||
|
||||
#include <volk.h>
|
||||
|
||||
namespace fennec
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user