TheAtlasEngine
 
Loading...
Searching...
No Matches
vk_context.hpp
1#pragma once
2#include <drivers/graphics_context.hpp>
3#include <vulkan/vulkan.h>
4#include <deque>
5#include <drivers/vulkan-cpp/vk_driver.hpp>
6
7namespace atlas::vk {
13 public:
14 vk_context(const std::string& p_tag);
15
27 static void submit_resource_free(std::function<void()>&& p_resource);
28
41 static PFN_vkSetDebugUtilsObjectNameEXT get_debug_object_name() {
42 return s_instance->m_vk_set_debug_utils_object_name_ext;
43 }
44
48 static VkInstance handler();
49
54 return s_instance->m_physical;
55 }
56
60 static vk_driver driver_context() { return s_instance->m_driver; }
61
62 private:
63 void resource_free(std::function<void()>&& p_resource);
64
65 private:
66 void destroy_context() override;
67
68 private:
69 static vk_context* s_instance;
70 VkInstance m_instance_handler = nullptr;
71 vk_physical_driver m_physical{};
72 vk_driver m_driver{};
73 std::deque<std::function<void()>> m_resources_free{};
74
75 PFN_vkSetDebugUtilsObjectNameEXT m_vk_set_debug_utils_object_name_ext;
76 };
77};
graphics API-agnostic that is centralized to the graphics API themselves
Definition graphics_context.hpp:9
vulkan-specific implementation that is the backend of the graphics contextd
Definition vk_context.hpp:12
static void submit_resource_free(std::function< void()> &&p_resource)
used for providing a way to submit all vulkan metaobjects before the destruction of the vulkan logica...
static PFN_vkSetDebugUtilsObjectNameEXT get_debug_object_name()
returns function pointer to allow for setting debug object name
Definition vk_context.hpp:41
static vk_physical_driver physical_driver()
direct access to the vulkan physical device
Definition vk_context.hpp:53
static vk_driver driver_context()
direct access to the vulkan logical device
Definition vk_context.hpp:60
static VkInstance handler()
Gives you direct access to the vulkan instance.
logical device implementation wrapper around the VkDevice
Definition vk_driver.hpp:20
vulkan-specific implementation wrapper around VkPhysicalDevice
Definition vk_physical_driver.hpp:23