Now using Volk rather than statically linking the Vulkan loader

This commit is contained in:
2020-06-23 15:08:39 -07:00
parent 4761bbc66b
commit 172ca74f70
6 changed files with 59 additions and 4 deletions

View File

@@ -640,6 +640,12 @@ void KRContext::receivedMemoryWarning()
void
KRContext::createDeviceContexts()
{
VkResult res = volkInitialize();
if (res != VK_SUCCESS) {
destroyDeviceContexts();
return;
}
// initialize the VkApplicationInfo structure
VkApplicationInfo app_info = {};
app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
@@ -662,10 +668,12 @@ KRContext::createDeviceContexts()
inst_info.enabledLayerCount = 0;
inst_info.ppEnabledLayerNames = NULL;
VkResult res = vkCreateInstance(&inst_info, NULL, &m_vulkanInstance);
res = vkCreateInstance(&inst_info, NULL, &m_vulkanInstance);
if (res != VK_SUCCESS) {
destroyDeviceContexts();
}
volkLoadInstance(m_vulkanInstance);
}
void

View File

@@ -100,6 +100,7 @@ using std::unordered_multimap;
using std::hash;
#include <vulkan/vulkan.h>
#include <volk.h>
#if defined(ANDROID)
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>