42#include <vulkan/vulkan.h>
44#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
45#if !defined(DEFINE_NON_DISPATCHABLE_HANDLE)
46 #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
47 #define DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
49 #define DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
65struct VkApplicationInfo;
68 struct SwapChainSupportDetails;
73 extern VkResult vkExecute(VkResult result,
const char* error_message);
80 static void setupModule(
Module& module);
81 static Module VulkanBackupModule();
90 const String& surfaceType()
const;
92 VkInstance
vkInstance()
const {
lib_assert(m_vk_instance,
"Instance not yet created, but access is attempted");
return m_vk_instance; }
95 bool supportsKHRSwapchain()
const;
96 bool supportsTriangleFan()
const;
100 virtual uint04 deviceSuitableScore(VkPhysicalDevice device);
101 bool isSoftwareRendered()
const;
103 virtual VkResult createVkInstance(
const VkInstanceCreateInfo& create_info);
104 virtual VkInstanceCreateInfo createInfo();
105 virtual VkApplicationInfo applicationInfo(
const String& app_name);
106 virtual uint04 setupExtensions(
const char**& extensions);
107 virtual uint04 setupLayers(
const char**& layers);
108 void initializeAll();
110 static String HardwareRenderedVulkanLib();
111 static String SoftwareRenderedVulkanLib();
114 bool checkLayerSupport(
const String& layer);
115 bool checkExtensionSupport(
const String& layer);
116 bool checkValidationSupport();
117 virtual void setAvailablePhysicalDevices();
118 virtual void setupInstance();
119 virtual void setAvailableExtensionInfo();
120 virtual void setAvailableLayerInfo();
121 virtual void setupDebug();
140 bool m_is_init =
false;
141 bool m_is_software_rendered =
false;
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
#define VK_DEFINE_HANDLE(object)
Definition VulkanInstance.h:44
#define DEFINE_NON_DISPATCHABLE_HANDLE(object)
Definition VulkanInstance.h:49
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition Pointer.hpp:303
Definition MemoryManager.h:283
Definition ProgressInfo.hpp:43
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition VulkanInstance.h:76
const Buffer< String > & validationLayers() const
Definition VulkanInstance.h:98
VkInstance vkInstance() const
Definition VulkanInstance.h:92
Buffer< VkLayerProperties, uint04, ObjectAllocator< true > > m_available_layer_info
Definition VulkanInstance.h:134
String vulkanLibUsed() const
Buffer< String > m_validation_layers
Definition VulkanInstance.h:138
ProgressInfo * log()
Definition VulkanInstance.h:87
const Buffer< VkPhysicalDevice > & physicalDevices() const
Definition VulkanInstance.h:99
Buffer< VkPhysicalDevice > m_available_physical_devices
Definition VulkanInstance.h:135
ProgressInfo * m_log
Definition VulkanInstance.h:130
bool supportsValidation() const
Definition VulkanInstance.h:97
String m_surface_type
Definition VulkanInstance.h:143
bool m_supports_validation
Definition VulkanInstance.h:139
Buffer< String > m_extensions
Definition VulkanInstance.h:137
bool m_supports_tri_fan
Definition VulkanInstance.h:142
Buffer< VkExtensionProperties, uint04, ObjectAllocator< true > > m_available_extension_info
Definition VulkanInstance.h:133
VkDebugReportCallbackEXT m_debug_callback
Definition VulkanInstance.h:131
Time m_creation_time
Definition VulkanInstance.h:144
static Buffer< VulkanInstance * > s_instances
Definition VulkanInstance.h:127
Time creationTime() const
Definition VulkanInstance.h:125
VkInstance m_vk_instance
Definition VulkanInstance.h:129
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
m_creation_time(Time::SystemTime())
Definition VulkanInstance.cpp:132
Definition ModuleManager.h:54