From 682e42f7ae70a8fadf374199c02de737daa5c70d Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Wed, 23 Apr 2025 18:16:06 -0500 Subject: 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. --- cube/cube.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'cube/cube.cpp') 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 -#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); -- cgit v1.2.3