diff options
| author | Juan Ramos <juan@lunarg.com> | 2023-12-20 10:35:00 -0700 |
|---|---|---|
| committer | Juan Ramos <114601453+juan-lunarg@users.noreply.github.com> | 2023-12-20 11:05:59 -0700 |
| commit | f474dadc476a9998d933d7b90bfe7a5c55bd5dbf (patch) | |
| tree | 58e4a4e0cadea3c6b7c9963e3987e9f894adba2f | |
| parent | b42addf414739c48fdb7683febe47057c890b1ab (diff) | |
| download | usermoji-f474dadc476a9998d933d7b90bfe7a5c55bd5dbf.tar.xz | |
Fix vkcubepp installation on MacOS
Avoids relying on Vulkan-Hpp for fixing vkcubepp regression
| -rw-r--r-- | cube/cube.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cube/cube.cpp b/cube/cube.cpp index a0ed023e..9ed4dca4 100644 --- a/cube/cube.cpp +++ b/cube/cube.cpp @@ -43,6 +43,9 @@ #define VULKAN_HPP_TYPESAFE_CONVERSION #include <vulkan/vulkan.hpp> +#define VOLK_IMPLEMENTATION +#include "volk.h" + VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE #include "linmath.h" @@ -1117,7 +1120,18 @@ VKAPI_ATTR VkBool32 VKAPI_CALL Demo::debug_messenger_callback(VkDebugUtilsMessag } void Demo::init_vk() { - VULKAN_HPP_DEFAULT_DISPATCHER.init(); + // See https://github.com/KhronosGroup/Vulkan-Hpp/pull/1755 + // Currently Vulkan-Hpp doesn't check for libvulkan.1.dylib + // Which affects vkcube installation on Apple platforms. + VkResult err = volkInitialize(); + if (err != VK_SUCCESS) { + ERR_EXIT( + "Unable to find the Vulkan runtime on the system.\n\n" + "This likely indicates that no Vulkan capable drivers are installed.", + "Installation Failure"); + } + + VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr); std::vector<char const *> instance_validation_layers = {"VK_LAYER_KHRONOS_validation"}; |
