Add support for Vulkan 1.1 & 1.2

This commit is contained in:
Lynix
2020-03-26 20:42:57 +01:00
parent 42d58bd77c
commit d892e8eaff
12 changed files with 143 additions and 45 deletions

View File

@@ -8,10 +8,10 @@
#define NAZARA_VULKANRENDERER_VKINSTANCE_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Core/String.hpp>
#include <Nazara/VulkanRenderer/Config.hpp>
#include <Nazara/VulkanRenderer/Wrapper/Loader.hpp>
#include <vulkan/vulkan.h>
#include <string>
#include <unordered_set>
namespace Nz
@@ -27,13 +27,16 @@ namespace Nz
inline ~Instance();
bool Create(const VkInstanceCreateInfo& createInfo, const VkAllocationCallbacks* allocator = nullptr);
inline bool Create(const String& appName, UInt32 appVersion, const String& engineName, UInt32 engineVersion, const std::vector<const char*>& layers, const std::vector<const char*>& extensions, const VkAllocationCallbacks* allocator = nullptr);
inline bool Create(const std::string& appName, UInt32 appVersion, const std::string& engineName, UInt32 engineVersion, const std::vector<const char*>& layers, const std::vector<const char*>& extensions, const VkAllocationCallbacks* allocator = nullptr);
inline void Destroy();
bool EnumeratePhysicalDevices(std::vector<VkPhysicalDevice>* physicalDevices);
inline PFN_vkVoidFunction GetDeviceProcAddr(VkDevice device, const char* name);
inline UInt32 GetApiVersion() const;
inline VkResult GetLastErrorCode() const;
bool GetPhysicalDeviceExtensions(VkPhysicalDevice device, std::vector<VkExtensionProperties>* extensionProperties);
inline VkPhysicalDeviceFeatures GetPhysicalDeviceFeatures(VkPhysicalDevice device);
inline VkFormatProperties GetPhysicalDeviceFormatProperties(VkPhysicalDevice device, VkFormat format);
@@ -42,10 +45,8 @@ namespace Nz
inline VkPhysicalDeviceProperties GetPhysicalDeviceProperties(VkPhysicalDevice device);
bool GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice device, std::vector<VkQueueFamilyProperties>* queueFamilyProperties);
inline VkResult GetLastErrorCode() const;
inline bool IsExtensionLoaded(const String& extensionName);
inline bool IsLayerLoaded(const String& layerName);
inline bool IsExtensionLoaded(const std::string& extensionName);
inline bool IsLayerLoaded(const std::string& layerName);
inline bool IsValid() const;
Instance& operator=(const Instance&) = delete;
@@ -57,9 +58,11 @@ namespace Nz
#define NAZARA_VULKANRENDERER_INSTANCE_EXT_BEGIN(ext)
#define NAZARA_VULKANRENDERER_INSTANCE_EXT_END()
#define NAZARA_VULKANRENDERER_INSTANCE_FUNCTION(func) PFN_##func func;
#define NAZARA_VULKANRENDERER_INSTANCE_CORE_EXT_FUNCTION(func, ...) NAZARA_VULKANRENDERER_INSTANCE_FUNCTION(func)
#include <Nazara/VulkanRenderer/Wrapper/InstanceFunctions.hpp>
#undef NAZARA_VULKANRENDERER_INSTANCE_CORE_EXT_FUNCTION
#undef NAZARA_VULKANRENDERER_INSTANCE_EXT_BEGIN
#undef NAZARA_VULKANRENDERER_INSTANCE_EXT_END
#undef NAZARA_VULKANRENDERER_INSTANCE_FUNCTION
@@ -73,8 +76,9 @@ namespace Nz
VkAllocationCallbacks m_allocator;
VkInstance m_instance;
VkResult m_lastErrorCode;
std::unordered_set<String> m_loadedExtensions;
std::unordered_set<String> m_loadedLayers;
UInt32 m_apiVersion;
std::unordered_set<std::string> m_loadedExtensions;
std::unordered_set<std::string> m_loadedLayers;
};
}
}