zeux/volk

volkInitialize return 0 even if vulkan is available on the system

dortamiguel opened this issue · 4 comments

I added volk to my project so I can make a build that dynamically loads vulkan.

I did as the documentation asked, and included volk.h

#pragma once

#define VK_USE_PLATFORM_WIN32_KHR
#include "volk.h"

#define VMA_STATIC_VULKAN_FUNCTIONS 0
#include "vk_mem_alloc.h"

and in a .cpp included the implementation

#include "vulkan.hpp"

#define VOLK_IMPLEMENTATION
#include "volk.h"

#define VMA_IMPLEMENTATION
#include "vk_mem_alloc.h"

then finally volkInitialize() gets called but it returns 0, this means that the vulkan loader wasn't found.

I am missing something? I know for sure my laptop has a vulkan driver. It works fine if I dynamicaly link vulkan-1

zeux commented

volkInitialize returns VkResult; VkResult success code is 0 (VK_SUCCESS).

zeux commented

P.S. I probably wouldn't recommend trying to combine volk with vulkan.hpp; it may work but both wrap vulkan.h so I would not be surprised if some sort of conflicts arise.

Sorry you are right, 0 is success. Thank you!

ah! that vulkan.hpp is not coming from the official one, its the header Im using to include volk