Prepare to support Vulkan 1.2

No way to test for now because no Vulkan SDK available.
This commit is contained in:
Adam Sawicki 2020-01-20 17:19:41 +01:00
parent b98cba1cf3
commit cdd30bb46d
3 changed files with 19 additions and 2 deletions

View File

@ -59,6 +59,7 @@ include all public interface declarations. Example:
//#define VMA_DEBUG_GLOBAL_MUTEX 1
//#define VMA_MEMORY_BUDGET 0
//#define VMA_VULKAN_VERSION 1002000 // Vulkan 1.2
#define VMA_VULKAN_VERSION 1001000 // Vulkan 1.1
//#define VMA_VULKAN_VERSION 1000000 // Vulkan 1.0

View File

@ -1172,7 +1172,15 @@ static void InitializeApplication()
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
appInfo.pEngineName = "Adam Sawicki Engine";
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
appInfo.apiVersion = VMA_VULKAN_VERSION == 1001000 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0;
#if VMA_VULKAN_VERSION == 1002000
appInfo.apiVersion = VK_API_VERSION_1_2;
#elif VMA_VULKAN_VERSION == 1001000
appInfo.apiVersion = VK_API_VERSION_1_1;
#elif VMA_VULKAN_VERSION == 1000000
appInfo.apiVersion = VK_API_VERSION_1_0;
#else
#error Invalid VMA_VULKAN_VERSION.
#endif
VkInstanceCreateInfo instInfo = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO };
instInfo.pApplicationInfo = &appInfo;

View File

@ -1785,7 +1785,9 @@ available through VmaAllocatorCreateInfo::pRecordSettings.
// where AAA = major, BBB = minor, CCC = patch.
// If you want to use version > 1.0, it still needs to be enabled via VmaAllocatorCreateInfo::vulkanApiVersion.
#if !defined(VMA_VULKAN_VERSION)
#if defined(VK_VERSION_1_1)
#if defined(VK_VERSION_1_2)
#define VMA_VULKAN_VERSION 1002000
#elif defined(VK_VERSION_1_1)
#define VMA_VULKAN_VERSION 1001000
#else
#define VMA_VULKAN_VERSION 1000000
@ -14908,6 +14910,12 @@ VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) :
VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT set but required extension is disabled by preprocessor macros.");
}
#endif
#if VMA_VULKAN_VERSION < 1002000
if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 2, 0))
{
VMA_ASSERT(0 && "vulkanApiVersion >= VK_API_VERSION_1_2 but required Vulkan version is disabled by preprocessor macros.");
}
#endif
#if VMA_VULKAN_VERSION < 1001000
if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
{