diff options
| author | Charles Giessen <charles@lunarg.com> | 2025-04-23 18:16:06 -0500 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2025-04-25 13:11:28 -0600 |
| commit | 682e42f7ae70a8fadf374199c02de737daa5c70d (patch) | |
| tree | 25e90302493dec297224e92fbccf37cf8424067e /cube/cube.cpp | |
| parent | 3e9d7a008869360dccbd8c812f4795afa7f8b416 (diff) | |
| download | usermoji-682e42f7ae70a8fadf374199c02de737daa5c70d.tar.xz | |
build: Remove Volk dependency
The intent of using Volk for function loading was to validate Volk's
implementation continually with each header update. This didn't end up
occurring, as Volk does not get updated in lock step with Vulkan-Tools,
leading to Vulkan-Tools using an older version of Volk. And then during
SDK release the version would need to be updated at the last minute,
causing churn and extra work.
Function loading now occurs in two new files, cube_functions.h and
vulkaninfo_functions.h. Since both cube and vulkaninfo's function
usage are fixed (as in not code-generated), it is straightforward to
implement the necessary Vulkan-Loader library opening and function
loading code.
Diffstat (limited to 'cube/cube.cpp')
| -rw-r--r-- | cube/cube.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/cube/cube.cpp b/cube/cube.cpp index 544c6aa3..e1d67e85 100644 --- a/cube/cube.cpp +++ b/cube/cube.cpp @@ -57,13 +57,8 @@ #define VULKAN_HPP_NO_EXCEPTIONS #define VULKAN_HPP_TYPESAFE_CONVERSION 1 -// Volk requires VK_NO_PROTOTYPES before including vulkan.hpp -#define VK_NO_PROTOTYPES #include <vulkan/vulkan.hpp> -#define VOLK_IMPLEMENTATION -#include "volk.h" - VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE #include "linmath.h" @@ -1566,18 +1561,7 @@ VKAPI_ATTR vk::Bool32 VKAPI_CALL Demo::debug_messenger_callback(vk::DebugUtilsMe } void Demo::init_vk() { - // 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); + VULKAN_HPP_DEFAULT_DISPATCHER.init(); uint32_t apiVersion = 0; vk::Result enumerate_instance_version_result = vk::enumerateInstanceVersion(&apiVersion); |
